1

I would like to remove the square brackets around citations, without using any package (like natbib). How can this be done? Here is an almost minimal WE with square brackets:

\documentclass[12pt]{book}

\makeatletter
\def\@biblabel#1{}
\makeatother

\begin{document}

This is a sentence with a citation, namely, \cite{last2000word}. 
Note the square brackets around the citation.

\bibliographystyle{apalike}
\bibliography{example}

\end{document}

with example.bib being:

@article{last2000word,
  title={Word words},
  author={Last, First},
  journal={Journal},
  pages={1--100},
  year={2000},
}
2
  • How come not using packages? I'm just wondering here, there are some people who make this requirement without any explanation.
    – daleif
    Commented Jun 13, 2022 at 8:59
  • 1
    Ah, fair question. I thought, perhaps in ignorance, that this would admit of a simple solution, even without a package. Additionally, I'd like to learn something, and not just use another package, if possible---that is, if someone is willing to explain how to do this without using a package. (I can understand, though, if this is asking too much here.) Commented Jun 13, 2022 at 9:06

1 Answer 1

3

you can do it like this (more or less taken from the LaTeX companion):

\documentclass[12pt]{book}

\makeatletter
\def\@biblabel#1{}
\renewcommand\@cite[2]{{#1\if@tempswa,\nolinebreak[3] #2\fi}}
\makeatother

\begin{document}

This is a sentence with a citation, namely, \cite{doody}.
Note the square brackets around the citation.

\bibliographystyle{apalike}
\bibliography{biblatex-examples}

\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .