Text Formatting ⇒ Removing italics/ensuring not italic/theorem environment
Removing italics/ensuring not italic/theorem environment
The replacement works well enough in normal environments, but if I place it inside the theorem environment, it becomes italicized, which is wrong.
Any suggestions would be appreciated, ideally I'd like to use something like \ensureNotItalic{\texttt{\%}}}, but I don't know how to implement something like \ensureNotItalic.
(I'd also like to improve on the font, if anyone has suggestions for that, but getting rid of the italicization is essential.)
Here's a MWE:
\documentclass{article}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsthm}
\newtheorem*{lem}{Lemma}
\let\bmod\undefined
\DeclareMathOperator{\bmod}{\texttt{\%}}
\begin{document}
The command \verb+\bmod+ (in math mode) should look like $\bmod$, but in the text of a theorem environment, it comes out italicized...
\begin{lem}
The extent of $\sigma_{axx}$, where $a$ and $x$ are integers, is $2x + a\bmod2$
\end{lem}
\end{document}
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
Removing italics/ensuring not italic/theorem environment
Code: Select all
\DeclareMathOperator{\bmod}{\%}
Code: Select all
\DeclareMathOperator{\bmod}{\textup{\%}}
Code: Select all
\DeclareMathOperator{\bmod}{\textup{\texttt{\%}}}
Re: Removing italics/ensuring not italic/theorem environment
Well, except that I switch to \texttt inside it in order to get a more appropriate looking operator. The default % sign doesn't look the least bit like a modulo operator.
edit: Posted at about the same time as the (edit to the) post above, sorry for any confusion.
Thanks, \textup does the trick. Now, if I could only find a way to use a font that actually has an appropriately shaped % sign to use as a modulo operator...