ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* \insertcrossref
@ 2010-02-09 14:36 Philipp Gesang
  2010-02-09 15:01 ` \insertcrossref Taco Hoekwater
  0 siblings, 1 reply; 4+ messages in thread
From: Philipp Gesang @ 2010-02-09 14:36 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 397 bytes --]

Hi all,


is there any way to get \insertcrossref to get the title or the short
title of the crossref'd publication, too?  Right now it only retrieves
author/editor name and the year but that doesn't suffice for some
bibliography specifications.

Thanks,


Philipp 


-- 
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments

[-- Attachment #1.2: Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 486 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: \insertcrossref
  2010-02-09 14:36 \insertcrossref Philipp Gesang
@ 2010-02-09 15:01 ` Taco Hoekwater
  2010-02-09 21:25   ` \insertcrossref Philipp Gesang
  0 siblings, 1 reply; 4+ messages in thread
From: Taco Hoekwater @ 2010-02-09 15:01 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Philipp Gesang wrote:
> Hi all,
> 
> 
> is there any way to get \insertcrossref to get the title or the short
> title of the crossref'd publication, too?  Right now it only retrieves
> author/editor name and the year but that doesn't suffice for some
> bibliography specifications.

\insertcrossref simply runs \cite internally, so whatever \cite fetches
is what you get. However, there is no \cite[title] command, so altering
\cite will not work.  Luckily, \insertcrossref is short, so maybe this
will work:

  \usemodule[bib]
  \unprotect
  \def\bibinsertcrossref#1#2#3%
   {\bibdoifelse{\@@pb@crossref}
      {#1\def\MYtitle{}%
         \getcitedata[title][\@@pb@crossref]to\MYtitle
         [\MYtitle]%
         \@EA\cite\@EA[\@@pb@crossref]#2}
      {#3}}
   \protect
   \starttext
   ....
   \stoptext

(untested, you have to provide a test file if it is doesn't work)


Best wishes,
Taco
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: \insertcrossref
  2010-02-09 15:01 ` \insertcrossref Taco Hoekwater
@ 2010-02-09 21:25   ` Philipp Gesang
  2010-02-09 23:55     ` \insertcrossref Philipp Gesang
  0 siblings, 1 reply; 4+ messages in thread
From: Philipp Gesang @ 2010-02-09 21:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1.1: Type: text/plain, Size: 1395 bytes --]

On 2010-02-09 <16:01:41>, Taco Hoekwater wrote:
> \insertcrossref simply runs \cite internally, so whatever \cite fetches
> is what you get. However, there is no \cite[title] command, so altering
> \cite will not work.  Luckily, \insertcrossref is short, so maybe this
> will work:
> 
>  \usemodule[bib]
>  \unprotect
>  \def\bibinsertcrossref#1#2#3%
>   {\bibdoifelse{\@@pb@crossref}
>      {#1\def\MYtitle{}%
>         \getcitedata[title][\@@pb@crossref]to\MYtitle
>         [\MYtitle]%
>         \@EA\cite\@EA[\@@pb@crossref]#2}
>      {#3}}
>   \protect
>   \starttext
>   ....
>   \stoptext
> 
> (untested, you have to provide a test file if it is doesn't work)
Well, it works and at the same time it doesn't work: the second argument
in "\getcitedata[title][\@@pb@crossref]to\MYtitle", that is
"\@@pg@crossref", has no effect.  I replaced it with the literal key of
the referenced entry and its title was correctly stored in "\MYtitle".
Typing "\@@pb@crossref" somewhere else resolves to the the correct key.
(Putting an \expandafter at some place before it doesn't help either.)
I'll attach the example file I'm working with; it's only part of the
whole bib style I'm preparing so expect to encounter random braces in
the output.

Philipp

-- 
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments

[-- Attachment #1.1.2: minimal_bib.tex --]
[-- Type: text/x-tex, Size: 2457 bytes --]

\usemodule[bib]
\usetypefile[cmu]
\setupbodyfont[computer-modern-unicode, 10pt]

\setuppublications[%
  alternative=apa,
]

\unprotect
\def\bibinsertcrossref#1#2#3%
{\bibdoifelse{\@@pb@crossref}
    {#1\def\MYtitle{}%
      \getcitedata[title][\@@pb@crossref]to\MYtitle
      [\MYtitle]%
      \@EA\cite\@EA[\@@pb@crossref]#2}
    {#3}}
\protect

\setuppublicationlayout[inbook]{%
  \insertauthors
  {\bgroup\it }{\egroup, }%
  {\inserteditors{\bgroup\it}%
    {\egroup\/ (Hrsg.),%
      \global\editedbooktrue%
    }%  
    {\insertthekey{}{, }{}}%
  }%  
  \inserttitle
  { }%
  {. %
    \ifeditedbook
      \global\editedbookfalse
      \insertcrossref
        {(}%
        {\insertvolume{ Nr.~}{}{}%
          \insertseries{ in~}{)}{)}%
        }%  
        {}% 
    \else
      \insertcrossref
        {\insertchap{, }{}{}%
          \insertpages{, S.~}{. }{. }%
          \insertvolume{Bd.~}{ von~}{}%
        }%  
        {}% 
        {\insertvolume
            {, Bd.~}%
            {\insertseries
                { von~\bgroup\it}%
                {\egroup}
                {}} 
            {}% 
          \insertchap{, }{}{}%
          \insertpages{, S.~}{.}{}%
        }%  
      \fi}%
    { }%
  \insertedition{ }{.~Aufl.}{}%
  \insertcity{ }{}{}%
  \insertpubyear{ }{. }{\unskip.}%
}

\startpublication[
    k=psrl,
    t=book,
    a={{{Akademija Nauk~SSSR, Institut Istorii~SSSR}}},
    y={1841--},
    n=27,
    s=PSRL
]
  \editor[]{}[]{}{Akademija Nauk~SSSR, Institut Istorii~SSSR}
  \pubyear{1841--}
  \title{Полное Собрание Русских Летописей}
  \city{Moskva, Sankt Peterburg}
\stoppublication

\startpublication[
    k=l2,
    t=inbook,
    a={{{Akademija Nauk SSSR, Institut Istorii SSSR}}},
    y=1980,
    n=30,
    s=L2
]
  \editor[]{}[]{}{{Akademija Nauk SSSR, Institut Istorii SSSR}}
  \pubyear{1980}
  \title{Litauische Chronik, 2.~Redaktion: Красинского, Археологического Общества, Рачинского, Ольшевская, Румянцевская, Евреиновская}
  \crossref{psrl}
  \pages{91--102, 128--214}
  \volume{35}
  \city{Moskva}
\stoppublication

\starttext
\type{\cite[authoryear]}      \cite[authoryear][psrl].\par
\type{\cite[authoryear]}      \cite[authoryear][l2].\par
\completepublications[criterium=all]
\stoptext

%   vim:ft=context

[-- Attachment #1.2: Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 486 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: \insertcrossref
  2010-02-09 21:25   ` \insertcrossref Philipp Gesang
@ 2010-02-09 23:55     ` Philipp Gesang
  0 siblings, 0 replies; 4+ messages in thread
From: Philipp Gesang @ 2010-02-09 23:55 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 167 bytes --]

It works this way:
      \let\cref\@@pb@crossref
      \getcitedata[title][\cref] to \MYtitle%
Thanks very much, this saves me a lot of work.

Best regards


Philipp


[-- Attachment #1.2: Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 486 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-02-09 23:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-09 14:36 \insertcrossref Philipp Gesang
2010-02-09 15:01 ` \insertcrossref Taco Hoekwater
2010-02-09 21:25   ` \insertcrossref Philipp Gesang
2010-02-09 23:55     ` \insertcrossref Philipp Gesang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).