ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Bibliography -- complete inline citations in footnotes
@ 2010-01-21  6:37 Piotr Lesnicki
  2010-01-21 11:22 ` Andreas Schneider
  0 siblings, 1 reply; 3+ messages in thread
From: Piotr Lesnicki @ 2010-01-21  6:37 UTC (permalink / raw)
  To: ntg-context

Hi,
I'm new to ConTeXt and I'm greatly appreciating the rejuvenation it
brings me in typesetting after several years using LaTeX.

I'm confronted to a few little problems though, the main one being
that I'd need to have references both in the footnotes and at the end
of a document. Under LaTeX I found that the "inlibib" package is doing
exactly that, inserting some "ibid" and "op.cit." when required for
repeting references. After reading the bibmod-doc, I thought I would
temporarly solve the problem by simply using
\setuppublications[refcommand=data] which I thought would put the
reference in the same format as in the bibliography, but it doesn't
compile.

Does any one have a solution?


Piotr
___________________________________________________________________________________
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] 3+ messages in thread

* Re: Bibliography -- complete inline citations in footnotes
  2010-01-21  6:37 Bibliography -- complete inline citations in footnotes Piotr Lesnicki
@ 2010-01-21 11:22 ` Andreas Schneider
  2011-04-01 16:56   ` Steffen Wolfrum
  0 siblings, 1 reply; 3+ messages in thread
From: Andreas Schneider @ 2010-01-21 11:22 UTC (permalink / raw)
  To: ntg-context

[-- Attachment #1: Type: text/plain, Size: 1673 bytes --]

Piotr Lesnicki wrote:

> Hi,
> I'm new to ConTeXt and I'm greatly appreciating the rejuvenation it
> brings me in typesetting after several years using LaTeX.
> 
> I'm confronted to a few little problems though, the main one being
> that I'd need to have references both in the footnotes and at the end
> of a document. Under LaTeX I found that the "inlibib" package is doing
> exactly that, inserting some "ibid" and "op.cit." when required for
> repeting references. After reading the bibmod-doc, I thought I would
> temporarly solve the problem by simply using
> \setuppublications[refcommand=data] which I thought would put the
> reference in the same format as in the bibliography, but it doesn't
> compile.
> 
> Does any one have a solution?
> 
> 
> Piotr

Hi Piotr,

I did assemble such a solution (with much help from Hans and Wolfgang). It's 
not enough to put it into a complete module yet (although I will probably do 
that sometime soon) and it currently only works with a recent beta of MkIV. 
(It can also be changed easily to work with MkII, but it won't correctly 
recognize repeating citations over page breaks ... long story ;-))

Just put the attached file into the same dir (or near) your document where 
you want to use it and include it with "\module[mycite]".

To use it simply replace \cite[key] with something like \mycite[key]
[page=123, chapter=1.5, suffix={Some manual inserted text.}]
These three parameters are each optional.
Since I wrote this for a German document, you may also want to modify the 
strings in the head of t-mycite.tex. ("Ebenda" = "Ibidem", "S." = Page, 
"vgl." = compare/reference, "Kap." = chapter)

Best Regards,
Andreas.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: t-mycite.tex --]
[-- Type: text/x-tex; name="t-mycite.tex", Size: 1533 bytes --]

\def\mycite{\dodoubleempty\domycite}
\def\defaultciterepeat{Ebenda}
\def\defaultciteprefix{Vgl. }
\def\defaultcitepage{S. }
\def\defaultcitechapter{Kap. }

\def\domycite[#1][#2]{%
  \ifsecondargument%
    \getparameters[MCP][prefix=\defaultciteprefix,page=,chapter=,suffix=,#2]%
    \doinsertmycite[#1]{\MCPprefix}{%
      \expandoneargafter\doifnotempty{\MCPpage}{\ \defaultcitepage\MCPpage.}%
      \expandoneargafter\doifnotempty{\MCPchapter}{\ \defaultcitechapter\MCPchapter.}%
      \expandoneargafter\doifnotempty{\MCPsuffix}{\ \MCPsuffix}%
    }%
  \else%
    \doinsertmycite[#1]{\defaultciteprefix}{}%
  \fi%
}

\def\doinsertmycite[#1]#2#3{%
  \footnote{%
    #2%prefix
    \doifelse{\getvalue{mycitelast}}{#1}%
      {\doifemptyelse{#2}%
        {\defaultciterepeat}%
        {\expandoneargafter\lowercase{\defaultciterepeat}}%If there's a prefix, lower-case the cite-repeat string
        .%
      }%
      {\doifelse{\getvalue{mycitepast #1}}{used}%
        {\bgroup%
         \getcitedata[title][#1] to \bibtitle%
         \getcitedata[arttitle][#1] to \bibarttitle%
         \cite[alternative=authoryear][#1]. {\it\bibtitle\bibarttitle}.%
         \egroup}%
        {\cite[alternative=data][#1]}%
      }%
    #3%suffix
  }%
  \setvalue{mycitelast}{#1}%
  \setvalue{mycitepast #1}{used}%
}

%Reset last citation on page break (which we check when placing footnotes)
\appendtoks
  \doifnoteonsamepageelse[footnote]{}{\global\setvalue{mycitelast}{}}
\to\everyinsidenoteinsert

[-- Attachment #3: 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] 3+ messages in thread

* Re: Bibliography -- complete inline citations in footnotes
  2010-01-21 11:22 ` Andreas Schneider
@ 2011-04-01 16:56   ` Steffen Wolfrum
  0 siblings, 0 replies; 3+ messages in thread
From: Steffen Wolfrum @ 2011-04-01 16:56 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Andreas Schneider

Hi Andreas,

does this module not work with current beta?
Or did I miss something?


<argument> \expandoneargafter 
                              \lowercase {\defaultciterepeat }
\secondoftwoarguments #1#2->#2
                              
<argument> ...er \lowercase {\defaultciterepeat }}
                                                  .
\firstoftwoarguments #1#2->#1
                             
\@@ddfootnotetitle ...te [alternative=data][key]}}
                                                  \expandoneargafter \doifno...
\dododescriptioncomponent ...onparameter \c!title 
                                                  }}}\endgroup \fi \fi \fi \...
...
l.35 ...=1.5, suffix={Some manual inserted text.}]
                                                  
? 
Process aborted



Steffen


Am 21.01.2010 um 12:22 schrieb Andreas Schneider:

> I did assemble such a solution (with much help from Hans and Wolfgang). It's 
> not enough to put it into a complete module yet (although I will probably do 
> that sometime soon) and it currently only works with a recent beta of MkIV. 
> (It can also be changed easily to work with MkII, but it won't correctly 
> recognize repeating citations over page breaks ... long story ;-))
> 
> Just put the attached file into the same dir (or near) your document where 
> you want to use it and include it with "\module[mycite]".
> 
> To use it simply replace \cite[key] with something like \mycite[key]
> [page=123, chapter=1.5, suffix={Some manual inserted text.}]
> These three parameters are each optional.
> Since I wrote this for a German document, you may also want to modify the 
> strings in the head of t-mycite.tex. ("Ebenda" = "Ibidem", "S." = Page, 
> "vgl." = compare/reference, "Kap." = chapter)
> 
> Best Regards,
> Andreas.<t-mycite.tex>___________________________________________________________________________________

___________________________________________________________________________________
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] 3+ messages in thread

end of thread, other threads:[~2011-04-01 16:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-21  6:37 Bibliography -- complete inline citations in footnotes Piotr Lesnicki
2010-01-21 11:22 ` Andreas Schneider
2011-04-01 16:56   ` Steffen Wolfrum

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).