0

I think that latex without ams does supply the theorem environment. I would like to make my own commands based on the built-in theorem functionality without using the ams tools package, so I can write the theorem name in colour. What can I do?

For instance, I would like "Definition" to be printed in orange. I would also like \theorem to print "Theorem" in orange as well.

\newtheorem{lexdefinition}{Definition}[section]
2
  • Is there something stopping you from using amsthm and running \newtheorem{lexdefinition}{\textcolor{orange}{Definition}}[section] along with \let\oldthelexdef\thelexdefinition \renewcommand\thelexdefinition{\textcolor{orange}{\oldthelexdef}}?
    – Mico
    Commented Sep 27, 2022 at 23:40
  • I want to build separate from ams, building from the most basic latex built-in. But I would be fine taking basic code from ams and use colour.
    – Veak
    Commented Sep 27, 2022 at 23:44

1 Answer 1

0

Use \color instead of \textcolor.

\documentclass{article}
\usepackage{xcolor}

\newtheorem{definition}{\color{orange}Definition}

\newtheorem{definitionnormal}{Definition}

\begin{document}

Some text preceding the definition.

\begin{definition}
A definition.
\end{definition}

Some text in the middle.

\begin{definitionnormal}
A definition.
\end{definitionnormal}

Some text to end the test.

\end{document}

I defined another environment just to see that the output is the same, except for the coloring.

enter image description here

You must log in to answer this question.

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