Text FormattingTheorem numbering - roman vs. alpha

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
merlyn
Posts: 3
Joined: Tue Dec 15, 2009 12:16 am

Theorem numbering - roman vs. alpha

Post by merlyn »

I have been working on trying to find a method to change the label for theorems from the arbic numbers to alpa letters. I currently have the following two lines to define two shadetheorems:

\newshadetheorem{question}{Question}
\newshadetheorem{Qpart}{Scenario}[question]

and the out put is close to what I want:

Question 2 text text text....
Scenario 2.1 text text text...
Scenario 2.2 text text text...

What I would like is this:

Question 2 text text text....
Scenario 2.a text text text...
Scenario 2.b text text text...

I have tried a couple different things, but either no effect on the out put or there is a compile issue. The two things I have tried are:

\renewcommand{\labelQpart}{(\alph{Qpart})}

(compile error)

and

\renewcommand\theQpart{
\ifnum\value{question}>0 \thequestion\fi \alph{\value{Qpart}}}

(compiles fine, but there is no change in the output).

Thanks for the help!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

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

olofos
Posts: 56
Joined: Tue Nov 24, 2009 10:37 pm

Theorem numbering - roman vs. alpha

Post by olofos »

It seems like the counter actually used by the shadethm package is called "shadeQpart", so you need to define "\theshadeQpart", so something like

Code: Select all

\renewcommand{\theshadeQpart}{\ifnum\value{shadequestion}>0 \thequestion\ \fi\alph{shadeQpart}}
Note that \alph should be given the name of the counter. I'm not sure what the test is supposed to do. The shadequestion counter will be positive at any point after the first question environment is started. Maybe you could give us an example on what you want to do. Preferably with some complete, compilable coce.
merlyn
Posts: 3
Joined: Tue Dec 15, 2009 12:16 am

Re: Theorem numbering - roman vs. alpha

Post by merlyn »

The 'if' statement was unneeded, the name of the counter for the shade theorem was the biggest issue. Thank you!

The code in the preamble is:

\newshadetheorem{question}{Question}
\newshadetheorem{Qpart}{Scenario}[question]
\renewcommand{\theshadeQpart}{\thequestion.\alph{shadeQpart}}

then we have in the document itself, the abbreviated text is:

\begin{question}
For each of the following scenarios ....
\end{question}

\begin{Qpart} %2.a
An experiment is designed to compare the effects of four......
\end{Qpart}

The best name to give this design....

\begin{Qpart} %2.b
A Forest Science department is designing
\end{Qpart}



A screen shot of the result is attached.
Attachments
theoremnumber.jpg
theoremnumber.jpg (37.65 KiB) Viewed 4244 times
Post Reply