1

How to set up the citation square brackets and numbers in upright in theorems while keeping other stuffs slanted? (This style is suggest by my professor.)

The usual appearance is the following

Theorem. There is no biggest prime number (see [1, Theorem 30 at page 100]).

I would like to achieve

Theorem. There is no biggest prime number (see [1, Theorem 30 at page 100]).

I could manually set \textup to numbers to upright but can not set the square brackets to upright.

  • Do you use a citation management package such as cite or natbib? Would you be OK with putting all material, rather than just the numbers, inside the square brackets in upright font? – Mico May 21 '14 at 15:39
  • I am using biblatex. – Ma Ming May 21 '14 at 15:43
  • 2
    am i correct in assuming that the brackets are provided by your use of \cite, and that's why you can't change them? (certainly, \textup applied directly to brackets works as expected.) – barbara beeton May 21 '14 at 15:57
  • This is related to tex.stackexchange.com/questions/13048, but the answer there seems not work for me. – Ma Ming Jun 6 '14 at 23:26
3

\emph appears to be your friend.

upright cite

Code:

\documentclass{article}
\usepackage{amsthm,amsmath}

\newtheorem*{thm}{Theorem}

\begin{document}

\begin{thm}
There is no biggest prime number \emph{(\cite[Theorem 30 at page 100]{A})}.
\end{thm}

\begin{thm}
There is no biggest prime number \emph{(\cite[\emph{Theorem} 30 \emph{at page} 100]{A})}.
\end{thm}

\begin{thebibliography}{1}

\bibitem{A} author, title

\end{thebibliography}

\end{document}
  • Now I found that this solution is unrealistic as my file is quite long. It is bitter to change a style afterwards. I also tried ctan.org/pkg/embrac, it seems not work. – Ma Ming Jun 6 '14 at 23:21
1

here is a possible solution that also forcibly causes the cited item number to use \textup, so it will not be entirely appropriate if non-numeric labels are used for the bibliography.

it redefines several commands from latex.ltx. it could be more compactly expressed using a "patch" mechanism, but i'm not so adept at that technique yet.

the third "theorem" uses the redefined mechanism.

output of example code

\documentclass{article}
\usepackage{amsthm,amsmath}

\newtheorem*{thm}{Theorem}

\makeatletter
\DeclareRobustCommand\thmcite{%
  \@ifnextchar [{\@tempswatrue\@thmcitex}{\@tempswafalse\@thmcitex[]}}
\def\@thmcitex[#1]#2{\leavevmode
  \let\@citea\@empty
  \@thmcite{\@for\@citeb:=#2\do
    {\@citea\def\@citea{,\penalty\@m\ }%
     \edef\@citeb{\expandafter\@firstofone\@citeb\@empty}%
     \if@filesw\immediate\write\@auxout{\string\citation{\@citeb}}\fi
     \@ifundefined{b@\@citeb}{\hbox{\reset@font\bfseries ?}%
       \G@refundefinedtrue
       \@latex@warning
         {Citation `\@citeb' on page \thepage \space undefined}}%
       {\@cite@ofmt{\csname b@\@citeb\endcsname}}}}{#1}}
\def\@thmcite#1#2{\textup{[}{\textup{#1}\if@tempswa , #2\fi}\textup{]}}
\makeatother

\begin{document}

\begin{thm}
There is no biggest prime number \textup{(}see \textup{[1,}
Theorem \textup{30} at page \textup{100]}.
\end{thm}

\begin{thm}
There is no biggest prime number (see [1,
Theorem 30 at page 100].
\end{thm}

\begin{thm}
There is no biggest prime number \textup{(}see
\thmcite[Theorem \textup{30} at page \textup{100}]{A}.
\end{thm}

\begin{thebibliography}{1}

\bibitem{A}
author, title

\end{thebibliography}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.