ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Andreas Schneider <aksdb@gmx.de>
To: ntg-context@ntg.nl
Subject: Re: Bibliography -- complete inline citations in footnotes
Date: Thu, 21 Jan 2010 12:22:44 +0100	[thread overview]
Message-ID: <hj9de3$bs6$1@ger.gmane.org> (raw)
In-Reply-To: <674630171001202237l2c0e306aq1f2a9de5e80d9c87@mail.gmail.com>

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

  reply	other threads:[~2010-01-21 11:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-21  6:37 Piotr Lesnicki
2010-01-21 11:22 ` Andreas Schneider [this message]
2011-04-01 16:56   ` Steffen Wolfrum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='hj9de3$bs6$1@ger.gmane.org' \
    --to=aksdb@gmx.de \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).