1

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
baam
  • 169
  • 1
  • 9
  • 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 06:38
  • 1
  • 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 06:47
  • Would you be able to set up a full MWE so we can try out what you are doing? Plus it would be helpful if you could explain where you want the page reference to go. In the superscript brackets would look odd and in the footnote would probably not be the best idea because the page reference might change. Really superscript references don't lend themselves to pre and postnotes. – moewe Oct 21 '15 at 08:19
  • You might want to tell whoever created this (it is not exactly from the question I linked to, someone did some changes) that the double redefinition of \renewcommand\@makefntext is useless, the first block can be dropped. I also believe that one could achieve what you want much easier. – moewe Oct 21 '15 at 11:12

1 Answers1

2

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

moewe
  • 175,683