I need a theorem environment with a custom numbering, so I did
\newtheorem{innercustomgeneric}{\customgenericname}
\providecommand{\customgenericname}{}
\newcommand{\newcustomtheorem}[2]{
\newenvironment{#1}[1]
{
\renewcommand\customgenericname{#2}
\renewcommand\theinnercustomgeneric{##1}
\innercustomgeneric
}
{\endinnercustomgeneric}
}
\newtheoremstyle{customthm}
{}
{}
{\textbf}
{}
{\bfseries}
{.}
{.5em}
{}
\theoremstyle{customthm}
\newcustomtheorem{customthm}{Theorem}
this, but still it gives me italic shpae body text.
What should I change to make it upright text?
Best Answer
There are (at least) two problems with the code.
\newtheoremstyle
needs to be a font declaration, not a font macro taking an argument. Replace\textbf
by\bfseries
.This will make the text of all theorem-like environments bold-face and upright, if the theorem-like environment has been defined after setting the style with
\theoremstyle{customthm}
.\newtheorem{innercustomgeneric}{\customgenericname}
defines the theorem-like environmentinnercustomgeneric
at a point where the default theorem style takes effect -- which is italic. Move the two linesup to a place before
\newtheorem{innercustomgeneric}
.It is not completely clear what your overall goal is, but my feeling is that there might be better ways to achieve it. So, if you run into further problems, it might be worth to explain the whole plan, such that we might come up with a alternate solution.