I was editing a poster and didn’t know whether or not to include a bibliography. I had already added \cite
commands and wanted to get an idea of what it looks like without bibliography. So I commented out \printbiliography
to get rid of the bibliography, but the numbers were still in the text. Removing all \cite
commands wasn’t an option in case I wanted to have them back.
At first, I tried to overwrite \cite
with a command that doesn’t exist:
\let\cite\undefined % \undefined is not defined
This wouldn’t work because \cite
becomes undefined and is still called in the text. The LaTeX engine returns “Undefined control sequence”.
The solution was to “renew” \cite
to do nothing:
\renewcommand\cite[2][]{}
scottishsnow
Clever trick! I’d probably have gone for brute force and ignorance doing a find and replace on \cite with blank. My backup plan being that the cited edition would be held in version control.
tom
I would assume most people don’t use version control, at least not for their tex files.
scottishsnow
It’s becoming more common in my branch of academia. Really helps when collaborating on a paper. I’m finding it useful for solo work too, especially with multiple revisions. Key thing is to have each sentence on its own line, for ease of the change log.
Herbert
that is not clever, because
\cite{foo}
will output “foo” in the text.is a better choice.
tom
Thanks, I’ll update the post with your solution, which is better indeed…