1

I need to repeat footnote references on each page instead of creating lots of footnotes with references to previous footnotes. I found this answer which looks like it does exactly what I want except that I'm using gost-footnote style:

\usepackage[
  style=gost-footnote,
  maxcitenames=3,
  maxbibnames=100
]{biblatex}

With this style using the code from that answer directly does not work because it can't find cite:init, cite:comp and other macros. I tried to adapt it to gost-footnote by looking to the latter's footcite implementation and came up with this:

\DeclareCiteCommand{\sfcite}[\cbx@superscript]
  {\let\multicitedelim\supercitedelim%
   \usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite:super:foot}}
  {}
  {\usebibmacro{cite:postnote}}

However, it does not work correctly. That is, it does seem to show footnotes exactly in the order I want, but all actual numbers, both in text and in footnotes disappear:

result

Additionally, it somehow breaks separators. The following redefinition works with vanilla footcites:

\renewcommand{\newunitpunct}{\adddot\space---\space}

but stops with sfcite.

How do I solve these issues? My TeX knowledge is not enough to deal with these arcane macros :(

Here is an example document which shows the problem:

\documentclass[oneside]{scrbook}

\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[russian]{babel}

\usepackage[
  style=gost-footnote,
  autocite=footnote,
  autopunct=false,
  maxcitenames=3,
  maxbibnames=100
]{biblatex}

\makeatletter
% user-level citation command
\DeclareCiteCommand{\sfcite}[\cbx@superscript]
  {\let\multicitedelim\supercitedelim%
   \usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite:super:foot}}
  {}
  {\usebibmacro{cite:postnote}}

% save instcount, save key and last inline instcount 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@sfcite}
  \mkbibsuperscript{#1}%
  \cbx@footnote%
  \global\togglefalse{cbx@sfcite}}
\newtoggle{cbx@sfcite}

\AtEveryCitekey{%
  \ifciteseen{}{\csnumgdef{cbx@instcount@\thefield{entrykey}}{-1}}%
  \iftoggle{cbx@sfcite}{}{\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}

\usepackage{fnpct}
\AdaptNoteOpt\sfcite\multfootcite

\renewcommand{\newunitpunct}{\adddot\space---\space}

\begin{document}

\toggletrue{bbx:gostbibliography}

\pagestyle{plain}

\null\vfill

Example \sfcite{bertram}\sfcite{doody}, example \sfcite{gillies}

\end{document}

things go bad

  • 1
    Welcome! Code fragments are good for explaining but not great for reproducing problems. Please can you edit your question to give us a complete, minimal document we can copy-paste-compile to reproduce the issue. Obviously, we'll need one or two sample .bib entries - you can use e.g. biblatex-examples.bib which everyone with Biblatex has already. – cfr Aug 14 '15 at 00:13
  • Mhhh.... The first problem I see is that the solution you linked to is based on a numeric kind of style, while gost-footnote seems to be a verbose-y style. So the commands there might be tailored to that specific situation. Have you tried Multiply cited reference in footnotes, which seems very similar, but is based on authortitle. – moewe Aug 14 '15 at 06:35
  • @cfr, sorry, it was very late here when I was writing this question, so I couldn't prepare an MCVE. I've updated my question now. – Vladimir Matveev Aug 15 '15 at 20:11
  • @moewe, I saw that answer too but I didn't try it - the answer which I did try also referenced it and said that it is inferior by several points. I guess I'll try this one now. – Vladimir Matveev Aug 15 '15 at 20:13
  • Well, it seems it works. It does not have these problems with missing numbers and with separators between fields, but it have a weird space before the footnote number in text. I would like to know how to make the original example to work, however. – Vladimir Matveev Aug 15 '15 at 20:20
  • But is the output of the other solution any different? If not would urge you to post what you have so far, we can then try and find the culprit fro the superfluous space. Plus, I cannot find where it says in the answer that Multiply cited reference in footnotes, it talks about is there a command analogous to \ifciteseen but within one page?. In one comment it is noted that Multiply cited reference in footnotes is superior in that it allows for postnotes. – moewe Aug 16 '15 at 04:09
  • So what do you say? Is the second solution OK? Do you miss anything important? – moewe Aug 19 '15 at 07:45
  • Oh, sorry, I couldn't get to post here. Well, the second solution is fine for me now, I've just added \!s in appropriate places and it seems to look normally. I'll update the question with the code when I will be able to. – Vladimir Matveev Aug 19 '15 at 08:35
  • OK, I think we should close this as a duplicate of the second solution then. If you have questions about the spaces (I think there is a more elegant solution than using \!), please ask a new question including the new code . – moewe Aug 20 '15 at 05:07

0 Answers0