I am using cite
package to manage citations (compressing many citations, superscripting). And I am trying to use the package's \citen
command to display the in-line version of a reference, but within square brackets (in the answer to @Steven B. Segletes's "self-referential-ness": so as not to have to put square brackets all the time when I need them).
I came to this (as suggested by @Steven B. Segletes and @TeXnician I removed mathmode):
\newcommand{\citin}[1]{%
[\citen{#1}]%
}%
Although I get no errors nor warnings and the output looks nice, I would like to know if this is the proper way to define square brackets within macro, if else, please tell, I am new in macro definitions. I also worry if those brackets will keep together with the number inside on line break.
Is this also the way I should follow to get square bracketed superscripted output?
EDIT: MWE
\documentclass[11pt,a4paper]{article}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage[super,nobreak]{cite}% cytowania w indeksie górnym, bez łamania wyliczeń cytowanych
\newcommand{\citin}[1]{% użyj \citin do cytowania w linii (np. Wg [1] sprawa ma się tak...)
[\citen{#1}]%
}%
\begin{document}%
\blindtext \cite{przyklad} \par
Or maybe not all from \citin{kowalski}.
\begin{thebibliography}{9}
\bibitem{przyklad}
D. Przyklad.
\newblock Title 1.
\newblock {\em APL}, 1:1–2, 2015.
\bibitem{kowalski}
D. Kowalski.
\newblock Title 2.
\newblock {\em JPC}, 2:2–5, 2017.
\end{thebibliography}
\end{document}
[\citen{#1}]
should be sufficient. However, your definition is self-referential.\documentclass
, ending with\end{document}
) in which you use the macros as you are intending to use them. That will help us see what exactly it is you are trying to accomplish, and may help us give you the best answer.cite
package