3

As the title suggests, using this MCVE:

\documentclass{article}
\usepackage{filecontents}
\usepackage[style=verbose-ibid,backend=bibtex]{biblatex}
\AtEveryCitekey{
    \clearfield{location}
    \clearfield{publisher}
}

\begin{filecontents}{the.bib}
    @article{label,
        title = {Best paper ever},
        author = {Best author in universe},
        location = {Earth},
        publisher = {fiend},
        date = {0000},
    }
\end{filecontents}
\bibliography{the}

\begin{document}
    Why the heck is there a space:\cite{label}?
\end{document}

enter image description here

Produces a space between : and the word "Best" from the author field. This space is increased per field cleared. You can verify this space is gone by commenting out the ATEveryCitekey command. This also happens for a numeric cite - the square brackets have additional spacing within.

My current fix is to manually \hspace the citation backwards, but this has to be done for every citation as they are a bit differently indented depending on the bibliographic content!

How do I get \clearfield to stop spacing things?

kabanus
  • 219
  • 3
    Add % to the end of lines in \AtEveryCitekey. See https://tex.stackexchange.com/q/7453/35864 for an in-depth explanation why that is necessary (also https://tex.stackexchange.com/q/40946/35864). – moewe Mar 13 '19 at 11:20
  • @moewe Correct! how anti-climactic. I should have thought about newlines! – kabanus Mar 13 '19 at 11:22
  • Sorry, that the solution is not more exciting. ;-) Do we close this as a duplicate or do you want an answer? (Ah, I see Steven was quicker than me...) – moewe Mar 13 '19 at 11:23

1 Answers1

5

I just added % at the end of the \AtEveryCitekey lines, to prevent stray spaces from being introduced.

\documentclass{article}
\usepackage{filecontents}
\usepackage[style=verbose-ibid,backend=bibtex]{biblatex}
\AtEveryCitekey{%
    \clearfield{location}%
    \clearfield{publisher}%
}

\begin{filecontents}{the.bib}
    @article{label,
        title = {Best paper ever},
        author = {Best author in universe},
        location = {Earth},
        publisher = {fiend},
        date = {0000},
    }
\end{filecontents}
\bibliography{the}

\begin{document}
    Why the heck is there a space:\cite{label}?
\end{document}

enter image description here