Skip to main content
texfaq
Source Link
David Carlisle
  • 828.7k
  • 74
  • 1.7k
  • 2.6k

I was advised once to test on functionality rather than on class name. The problem is that both appendix.sty and IEEEtran.cls defines \appendices. So only load the appendix package if there isn't already a command \appendices defined. Here is a working example:

\documentclass{IEEEtran} \title{Test of conditional use of the appendix package} \usepackage{lipsum} % just for dummy text \ifcsname appendices\endcsname % do nothing \else \usepackage{appendix} \fi \begin{document} \maketitle \section{Foo} \lipsum \section{Bar} \lipsum \appendix \section{Appendix} \lipsum \end{document} 

\ifcsame is available on all e-TeX builds and is documented (along with other ways to check if a command is defined) herehere.

I was advised once to test on functionality rather than on class name. The problem is that both appendix.sty and IEEEtran.cls defines \appendices. So only load the appendix package if there isn't already a command \appendices defined. Here is a working example:

\documentclass{IEEEtran} \title{Test of conditional use of the appendix package} \usepackage{lipsum} % just for dummy text \ifcsname appendices\endcsname % do nothing \else \usepackage{appendix} \fi \begin{document} \maketitle \section{Foo} \lipsum \section{Bar} \lipsum \appendix \section{Appendix} \lipsum \end{document} 

\ifcsame is available on all e-TeX builds and is documented (along with other ways to check if a command is defined) here.

I was advised once to test on functionality rather than on class name. The problem is that both appendix.sty and IEEEtran.cls defines \appendices. So only load the appendix package if there isn't already a command \appendices defined. Here is a working example:

\documentclass{IEEEtran} \title{Test of conditional use of the appendix package} \usepackage{lipsum} % just for dummy text \ifcsname appendices\endcsname % do nothing \else \usepackage{appendix} \fi \begin{document} \maketitle \section{Foo} \lipsum \section{Bar} \lipsum \appendix \section{Appendix} \lipsum \end{document} 

\ifcsame is available on all e-TeX builds and is documented (along with other ways to check if a command is defined) here.

replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

I was advised once to test on functionality rather than on class nameI was advised once to test on functionality rather than on class name. The problem is that both appendix.sty and IEEEtran.cls defines \appendices. So only load the appendix package if there isn't already a command \appendices defined. Here is a working example:

\documentclass{IEEEtran} \title{Test of conditional use of the appendix package} \usepackage{lipsum} % just for dummy text \ifcsname appendices\endcsname % do nothing \else \usepackage{appendix} \fi \begin{document} \maketitle \section{Foo} \lipsum \section{Bar} \lipsum \appendix \section{Appendix} \lipsum \end{document} 

\ifcsame is available on all e-TeX builds and is documented (along with other ways to check if a command is defined) here.

I was advised once to test on functionality rather than on class name. The problem is that both appendix.sty and IEEEtran.cls defines \appendices. So only load the appendix package if there isn't already a command \appendices defined. Here is a working example:

\documentclass{IEEEtran} \title{Test of conditional use of the appendix package} \usepackage{lipsum} % just for dummy text \ifcsname appendices\endcsname % do nothing \else \usepackage{appendix} \fi \begin{document} \maketitle \section{Foo} \lipsum \section{Bar} \lipsum \appendix \section{Appendix} \lipsum \end{document} 

\ifcsame is available on all e-TeX builds and is documented (along with other ways to check if a command is defined) here.

I was advised once to test on functionality rather than on class name. The problem is that both appendix.sty and IEEEtran.cls defines \appendices. So only load the appendix package if there isn't already a command \appendices defined. Here is a working example:

\documentclass{IEEEtran} \title{Test of conditional use of the appendix package} \usepackage{lipsum} % just for dummy text \ifcsname appendices\endcsname % do nothing \else \usepackage{appendix} \fi \begin{document} \maketitle \section{Foo} \lipsum \section{Bar} \lipsum \appendix \section{Appendix} \lipsum \end{document} 

\ifcsame is available on all e-TeX builds and is documented (along with other ways to check if a command is defined) here.

added working example and fixed `\ifcsname` problem.
Source Link
Matthew Leingang
  • 47.1k
  • 14
  • 139
  • 206

I was advised once to test on functionality rather than on class name. Like you said, the The problem is that both appendix.sty and IEEEtran.cls defines \appendix\appendices. So only load the appendix package if there isn't already ana command \appendix\appendices defined. Here is a working example:

\ifcsname\documentclass{IEEEtran} \title{Test of conditional use of the appendix package} \usepackage{lipsum} % just for dummy text \ifcsname appendices\endcsname % do nothing \else \usepackage{appendix} \fi \begin{document} \maketitle \section{Foo} \lipsum \section{Bar} \lipsum \appendix \section{Appendix} \lipsum \end{document} 

\ifcsame is available on all e-TeX builds and is documented (along with other ways to check if a command is defined) here.

I was advised once to test on functionality rather than on class name. Like you said, the problem is that IEEEtran.cls defines \appendix. So only load the appendix package if there isn't already an \appendix defined.

\ifcsname appendix % do nothing \else \usepackage{appendix} \fi 

\ifcsame is available on all e-TeX builds and is documented (along with other ways to check if a command is defined) here.

I was advised once to test on functionality rather than on class name. The problem is that both appendix.sty and IEEEtran.cls defines \appendices. So only load the appendix package if there isn't already a command \appendices defined. Here is a working example:

\documentclass{IEEEtran} \title{Test of conditional use of the appendix package} \usepackage{lipsum} % just for dummy text \ifcsname appendices\endcsname % do nothing \else \usepackage{appendix} \fi \begin{document} \maketitle \section{Foo} \lipsum \section{Bar} \lipsum \appendix \section{Appendix} \lipsum \end{document} 

\ifcsame is available on all e-TeX builds and is documented (along with other ways to check if a command is defined) here.

Source Link
Matthew Leingang
  • 47.1k
  • 14
  • 139
  • 206
Loading