6

I am currently writing my thesis, and I would like to put a placeholder for "cf." in my autocite like so:

\autocite[\cf][]{Author.2016}

Reason: in case my mentor wants me to use a citation style that requires cf., I want to "toggle" the cf. on and off. However, if I define the \cf command as empty (\newcommand{\cf}{}), the autocite command automatically adds a space in front of the author: ( Schmidt et al. 2013).

Undefining the cf command with \let\cf\undefined (as suggested in "undefining custom commands") does not work, since the command is, well, undefined :D

Any ideas how to tell LaTeX to just "ignore" \cf (or to remove the space after the empty note)?

Thanks!!

EDIT: Working example

document.tex:

\documentclass{scrreprt}

\usepackage[backend=biber,bibencoding=utf8,style=authoryear-icomp]{biblatex}
\addbibresource{bibliography.bib}

\newcommand{\cf}{}

\begin{document}
    This is some text~\autocite[\cf][]{Schmidt.2013}
\end{document}

bibliography.bib:

@book{Schmidt.2013,
 author = {Schmidt},
 year = {2013},
 title = {Some Title}
}
hbrgnr
  • 163
  • 5

1 Answers1

7

Nasty trick!

\begin{filecontents*}{\jobname.bib}
@book{Schmidt.2013,
 author = {Schmidt},
 year = {2013},
 title = {Some Title}
}
\end{filecontents*}

\documentclass{scrreprt}

\usepackage[backend=biber,bibencoding=utf8,style=authoryear-icomp]{biblatex}
\addbibresource{\jobname.bib}

\newcommand\nocfspace{\renewcommand{\prenotedelim}{}}
\newcommand{\cf}{\aftergroup\nocfspace}

\begin{document}

This is some text~\autocite[\cf][]{Schmidt.2013}

This is some other text \autocite[as in][]{Schmidt.2013}

\end{document}

enter image description here

egreg
  • 1,121,712