TeX - LaTeX Asked by Brigitte Bruijns on June 19, 2021
I am writing a thesis and after some chapters I would like to include some supplementary information. I use
beginsupplement
to start my supplement . But how do I end it? My next chapter does now also contain figures and tables that start with ‘S’.
I also used:
newcommand{beginsupplement}{%
setcounter{table}{0}
renewcommand{thetable}{Sarabic{table}}%
setcounter{figure}{0}
renewcommand{thefigure}{Sarabic{figure}}%
}
I think it would be better to use an environment. Environments use grouping, so changes that you make at the start don't affect things after the environment ends. As a demonstration:
documentclass{article}
newenvironment{fred}{renewcommandaaa{AAA}}{}
newcommandaaa{BBB}
begin{document}
aaa
begin{fred}
aaa
end{fred}
aaa
end{document}
This produces BBB AAA BBB. Your case is similar; just put the renewcommand
s and setcounter
s in the first argument to newenvironment
.
Answered by Ian Thompson on June 19, 2021
This is my solution. Posting as it may be useful for others.
In the preamble
% make supplementary sections in chapters be numbered with letters
newcommand{opensupplement}{
setcounter{section}{0}
renewcommandthesection{thechapter.Alph{section}}
}
% restore the numbering system to arabic for the following chapter's sections
newcommand{closesupplement}{
renewcommandthesection{thechapter.arabic{section}}
}
In the document:
opensupplement
section{Supplementary section 1}
(...)
section{Supplementary section 2}
(...)
closesupplement
Answered by Homero Esmeraldo on June 19, 2021
I was having a similar issue, where after using beginsupplment
every other chapter started with S1-SX. My solution was to create a new command to close the supplements and restore the table and figure labels to chapter.figure
newcommand{closesupplement}{
renewcommand{thetable}{thechapter.arabic{table}}
renewcommand{thefigure}{thechapter.arabic{figure}}
}
Answered by Borikev on June 19, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP