Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm writing a report and using biblatex with the biblatex-chem package, and using the \fullfootcite command because of the integration with footnotes. However I've noticed that

  1. If the same reference is called more than once, it will appear with different reference numbers and twice in the footer;
  2. despite me using the autopunct=true option, the citation in the text still appears before the comma and not after as it should be.

    \documentclass[11pt,a4paper]{memoir}
    \usepackage[backend=biber,style=chem-acs,subentry,minnames=3,maxnames=100,autopunct=true]{biblatex}
    \bibliography{bibli}
    
    \begin{document}
    A procedure\footfullcite{Harjani:2009hd}, which was reported. The same procedure\footfullcite{Harjani:2009hd} applied with another product.
    \end{document}
    
share|improve this question
add comment

1 Answer

Only \autocite moves trailing punctuation. The chem-acs style loads the option settings autopunct=true and autocite=superscript. So you can achieve the desired inline citation output with \autocite instead of \footfullcite. For the footnotes you can redefine \supercite to \superfullcite from another citation style by Joseph Wright.

\documentclass{article}
\usepackage[style=chem-acs,subentry,citetracker]{biblatex}
\usepackage[colorlinks]{hyperref}

\makeatletter
% http://www.texdev.net/2010/03/08/biblatex-numbered-citations-as-footnotes/
\DeclareCiteCommand{\supercite}[\cbx@superscript]%
  {\usebibmacro{cite:init}%
   \let\multicitedelim=\supercitedelim
   \iffieldundef{prenote}{}{\BibliographyWarning{Ignoring prenote argument}}%
   \iffieldundef{postnote}{}{\BibliographyWarning{Ignoring postnote argument}}}
  {\usebibmacro{citeindex}%
   \usebibmacro{superfullcite}%
   \usebibmacro{cite:comp}}
  {}
  {\usebibmacro{cite:dump}}

\newbibmacro*{superfullcite}{%
  \ifciteseen{}{\xappto\cbx@citehook{%
    \noexpand\footnotetext[\thefield{labelnumber}]{\fullcite{\thefield{entrykey}}.}}}}

\newrobustcmd{\cbx@superscript}[1]{%
  \mkbibsuperscript{#1}%
  \cbx@citehook
  \global\let\cbx@citehook=\empty}
\let\cbx@citehook=\empty
\makeatother

\addbibresource{biblatex-examples.bib}
\begin{document}
\null\vfill\noindent
New citation \autocite{stdmodel}.
New and recurrent citations \autocite{stdmodel,companion}.
\clearpage
\null\vfill\noindent
New citation \autocite{ctan}.
Recurrent citations from previous and current pages \autocite{companion,glashow,ctan}.
\clearpage
\printbibliography
\end{document}

Here is the output for the first page:

enter image description here

And the second:

enter image description here

Note that this avoids recurrent footnote citations by printing the footnote only the first time the entry is cited. Printing the footnotes at most once on every page can be done, but the solution is relatively messy.

\documentclass{article}
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[style=chem-acs,subentry,citetracker,pagetracker=page]{biblatex}
\usepackage[colorlinks]{hyperref}

\makeatletter
% user-level citation command
\DeclareCiteCommand{\supercite}[\cbx@superscript]
  {\usebibmacro{cite:init}%
   \let\multicitedelim\supercitedelim
   \iffieldundef{prenote}{}{\BibliographyWarning{Ignoring prenote argument}}%
   \iffieldundef{postnote}{}{\BibliographyWarning{Ignoring postnote argument}}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite:super:foot}%
   \usebibmacro{cite:comp}}
  {}
  {\usebibmacro{cite:dump}}

% save current and last inline instcount, save key if seen first on page
\newbibmacro*{cite:super:foot}{%
  \xdef\cbx@key{\thefield{entrykey}}%
  \ifsamepage{\value{instcount}}{\csuse{cbx@instcount@\cbx@key}}{}{%
    \listxadd{\cbx@savelist}{\cbx@key}%
    \ifnumequal{\value{cbx@tempcntd}}{0}{%
      \defcounter{cbx@tempcntc}{\value{instcount}}%
      \loop\ifnum\value{cbx@tempcntc}>0
        \ifsamepage{\value{instcount}}{\value{cbx@tempcntc}}
          {\ifcsundef{blx@fnpage@\number\numexpr\value{cbx@tempcntc}}
             {\setcounter{cbx@tempcntd}{\value{cbx@tempcntc}}}{}%
           \stepcounter{cbx@tempcntc}}
          {\setcounter{cbx@tempcntc}{0}}%
      \repeat}{}}%
  \csnumgdef{cbx@instcount@\cbx@key}{\value{instcount}}}
\let\cbx@savelist\@empty
\newcounter{cbx@tempcntc}
\newcounter{cbx@tempcntd}
\setcounter{cbx@tempcntd}{0}

\newrobustcmd*{\cbx@superscript}[1]{%
  \global\toggletrue{cbx@supercite}
  \mkbibsuperscript{#1}%
  \cbx@footnote%
  \global\togglefalse{cbx@supercite}}
\let\cbx@savelist\@empty
\newtoggle{cbx@supercite}

\AtEveryCitekey{%
  \ifciteseen{}{\csnumgdef{cbx@instcount@\thefield{entrykey}}{-1}}%
  \iftoggle{cbx@supercite}{}{\cbx@footnote}}
\AtEveryBibitem{\cbx@footnote}
\AtEveryLositem{\cbx@footnote}

% defer citation footnotes to last inline reference instance on page
\newrobustcmd*{\cbx@footnote}{%
  \ifboolexpr{ not test {\ifdefempty{\cbx@savelist}}
               and test {\ifnumequal{\value{instcount}}{\value{cbx@tempcntd}}} }
    {\cbx@sortlist@init%
     \let\do\cbx@do
     \dolistloop{\cbx@sortlist}%
     \global\let\cbx@savelist\@empty
     \setcounter{cbx@tempcntd}{0}}{}}

% print footnotes in 'sorting' order
\def\cbx@do#1{%
  \ifinlist{#1}{\cbx@savelist}
    {\begingroup
     \blx@resetdata
     \blx@getdata@cite{#1}%
     \blx@setoptions@type\abx@field@entrytype
     \blx@setoptions@entry
     \blx@execute
     \blx@beglang
     \iffieldundef{shorthand}
       {\gdef\@thefnmark{\printfield{prefixnumber}\printfield{labelnumber}}}
       {\gdef\@thefnmark{\printfield{shorthand}}}%
     \gappto\@thefnmark{\blx@initunit}%
     \ifhyperref
       {\H@@footnotetext{\blx@driver\abx@field@entrytype}}
       {\@footnotetext{\blx@driver\abx@field@entrytype}}%
     \blx@endlang
     \endgroup}
    {}}

% access internal list of sorted entry keys
\def\cbx@sortlist@init{%
  \ifcsundef{blx@sort@\the\c@refsection}
    {\global\letcs{\cbx@sortlist}
       {blx@slists@\the\c@refsection @entry@\blx@sorting}}% Biber
    {\global\letcs{\cbx@sortlist}{blx@sort@\the\c@refsection}}}% BibTeX
\let\cbx@sortlist\@empty
\makeatother

\addbibresource{biblatex-examples.bib}
\renewcommand*{\thefootnote}{\fnsymbol{footnote}}
\begin{document}
\null\vfill\noindent
New citation \autocite{stdmodel}.
New and recurrent citations \autocite{stdmodel,companion}.
Vanilla footnote with citation.\footnote{Following \textcite{weinberg}...}
\clearpage
\null\vfill\noindent
New citation \autocite{ctan}.
Recurrent citations from previous and current pages \autocite{companion,glashow,ctan}.
\clearpage
\printbibliography
\end{document}

Here is the output for the first page:

enter image description here

And the second:

enter image description here

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.