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{\@@p...@crossref}
>      {#1\def\MYtitle{}%
>         \getcitedata[title][\@@p...@crossref]to\mytitle
>         [\MYtitle]%
>         \...@ea\cite\@EA[\@@p...@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][\@@p...@crossref]to\mytitle", that is
"\@@p...@crossref", has no effect.  I replaced it with the literal key of
the referenced entry and its title was correctly stored in "\MYtitle".
Typing "\@@p...@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
\usemodule[bib]
\usetypefile[cmu]
\setupbodyfont[computer-modern-unicode, 10pt]

\setuppublications[%
  alternative=apa,
]

\unprotect
\def\bibinsertcrossref#1#2#3%
{\bibdoifelse{\@@p...@crossref}
    {#1\def\MYtitle{}%
      \getcitedata[title][\@@p...@crossref]to\mytitle
      [\MYtitle]%
      \...@ea\cite\@EA[\@@p...@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: pgpHBoIgbbWIx.pgp
Description: PGP signature

___________________________________________________________________________________
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
___________________________________________________________________________________

Reply via email to