0

I use a custom cite command cite which puts the citation on first use in the footer. The problem is that there is no possibility to reference a page or section with this cite command.
example: \cite[p. 12]{somebibref} ignores the optional parameter.
The citation should be in brackets like this: ...Lorem explains [1, p.12]... This is the code snipped i got but i dont know how to modify it for my purpose.

What do I need to modify to add the additional parameter only in the citation in the text not in the footer?

\makeatletter

\newtoggle{cbx@togcite}

% remove doi, eprint and url from footnote
%\renewbibmacro*{doi+eprint+url}{}%

% Citation number superscript in brackets
\renewcommand\@makefntext[1]{%
  \iftoggle{cbx@togcite}
    {\@textsuperscript{\normalfont[\@thefnmark]}\enspace #1}
    {\@textsuperscript{\normalfont\@thefnmark}\enspace #1}%
  \global\togglefalse{cbx@togcite}}

\renewcommand\@makefntext[1]{%
  \iftoggle{cbx@togcite}
    {\normalfont[\@thefnmark]\enspace #1}
    {\normalfont\@thefnmark\enspace #1}%
  \global\togglefalse{cbx@togcite}}

\DeclareCiteCommand{\cite}[\cbx@superscript]%
  {\usebibmacro{cite:init}%
   \let\multicitedelim=\supercitedelim
   \iffieldundef{prenote}
     {}
     {\BibliographyWarning{Ignoring prenote argument}}%
   \iffieldundef{postnote}
     {}
     {\BibliographyWarning{Ignoring postnote argument}}}
  {\usebibmacro{citeindex}%
   \usebibmacro{sfcite}%
   \usebibmacro{cite:comp}}
  {}
  {\usebibmacro{cite:dump}}

\newbibmacro*{sfcite}{%
  \ifciteseen
  {}
  {\xappto\cbx@citehook{%
   \global\toggletrue{cbx@togcite}%
   \noexpand\footnotetextA[\thefield{labelnumber}]{%
     \fullcite{\thefield{entrykey}}\addperiod}}}}

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

\let\cbx@citehook=\empty

\endinput
  • What about using \textcite[][p]{foo} where p is the page? – Romain Picot Oct 20 '15 at 20:08
  • \textcite does not put it on first use in the footer and writes all authors out. should be et al.for multiple authors – baam Oct 20 '15 at 20:22
  • Can you give bit more detail what you want? Do you want to have normal sized brackets with a postnote and a footnote otherwise? (The code you have, doesn't incidentally come from another question here? If it does a link would be nice.) – moewe Oct 21 '15 at 6:38
  • 1
    I guess you took the code from Biblatex cite with footnote only once, with use of brackets? – moewe Oct 21 '15 at 6:44
  • I got the Code from a college - but good to know he got it from here ;). Right now it cites on first sight with with a number in the brackets and puts a full citation in the footnote. The only part that is missing, is that i cant figure out how to pass additional parameter like a page reference. I take a look at your link. thanks – baam Oct 21 '15 at 6:47
1

Since you don't actually implement a "supercite" here, but rather a normal bracketed cite you could try

\DeclareCiteCommand{\cite}[\cbx@superscript]%
  {\usebibmacro{prenote}%
   \usebibmacro{cite:init}}
  {\usebibmacro{citeindex}%
   \usebibmacro{sfcite}%
   \usebibmacro{cite:comp}}
  {}
  {\usebibmacro{cite:dump}%
   \usebibmacro{postnote}}

Though I suspect the whole thing could be done even easier.


I believe you can get about the same thing (when using numeric-comp) with only

\makeatletter
\renewbibmacro*{cite:comp}{%
  \addtocounter{cbx@tempcntb}{1}%
  \ifciteseen
    {}
    {\renewcommand{\@makefntext}[1]{\noindent\normalfont##1}%
     \footnotetext{%
       \printtext[labelnumberwidth]{%
         \printfield{prefixnumber}%
         \printfield{labelnumber}}%
       \addspace
       \bibfootnotewrapper{\fullcite{\thefield{entrykey}}}}}%
  \iffieldundef{shorthand}
    {\ifbool{bbx:subentry}
       {\iffieldundef{entrysetcount}
          {\usebibmacro{cite:comp:comp}}
          {\usebibmacro{cite:comp:inset}}}
       {\usebibmacro{cite:comp:comp}}}
    {\usebibmacro{cite:comp:shand}}}
\makeatletter

without all your modifications.

MWE

\documentclass{article}

\usepackage[%
    backend=biber,
    style=numeric-comp,
    citetracker=true,
    ]{biblatex}

\makeatletter
\renewbibmacro*{cite:comp}{%
  \addtocounter{cbx@tempcntb}{1}%
  \ifciteseen
    {}
    {\renewcommand{\@makefntext}[1]{\noindent\normalfont##1}%
     \footnotetext{%
       \printtext[labelnumberwidth]{%
         \printfield{prefixnumber}%
         \printfield{labelnumber}}%
       \addspace
       \bibfootnotewrapper{\fullcite{\thefield{entrykey}}}}}%
  \iffieldundef{shorthand}
    {\ifbool{bbx:subentry}
       {\iffieldundef{entrysetcount}
          {\usebibmacro{cite:comp:comp}}
          {\usebibmacro{cite:comp:inset}}}
       {\usebibmacro{cite:comp:comp}}}
    {\usebibmacro{cite:comp:shand}}}
\makeatletter

\addbibresource{biblatex-examples.bib}


\begin{document}
\cite[1]{sigfridsson,wilde} and \cite[2]{sigfridsson} and \cite[3]{worman} and \cite[4]{geer}

Lorem\footnote{Duizend}

\printbibliography
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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