Document ClassesWeird interaction between packages and my document class

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
rspringuel
Posts: 19
Joined: Wed Apr 28, 2010 7:16 pm

Weird interaction between packages and my document class

Post by rspringuel »

So, I've written a document class, based on the report class, which is designed to format a document according to my school's thesis guidelines (well, part written, part inherited). It's been working just fine for a while now, but I just came across an interesting error (and by "interesting" I mean one I can't figure out). It seems that hyperref and ifthen don't like working together when the \equal command gets called inside a sectioning command (level of the command doesn't matter). The error from the log file is:

Code: Select all

./Main.tex:22: Undefined control sequence.
<argument> \equal 
                  {1}{1}
l.22 \subsubsection{\protect\combine{1}}
which is what I'd expect if ifthen wasn't loaded. Not loading the hyperref package causes the error to go away, as does switching the document class to report. The error also goes away if my \combine command doesn't call the \equal command. Any ideas on what kind of interaction might be causing this behavior.

Attached is a MWE which also contains my class file.
Attachments
TEST.zip
(14.46 KiB) Downloaded 228 times
Last edited by rspringuel on Mon Aug 30, 2010 3:20 pm, edited 1 time in total.

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

Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

Weird interaction between packages and my document class

Post by Juanjo »

Instead of bothering finding the cause of the problem, I propose this alternative definition of \combine. It works for me.

Code: Select all

\newcommand{\combine}[1]{%
   \ifcase#1 \or \textit{Correct}
             \or $F \propto v$
             \or \textit{Formal}
             \or \textit{Naive}
             \or \textit{Newton's 3rd}
    \fi}
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
rspringuel
Posts: 19
Joined: Wed Apr 28, 2010 7:16 pm

Re: Weird interaction between packages and my document class

Post by rspringuel »

That does indeed work for me too. It bugs my perfectionist side to not know what was causing the original problem, but my practical side says that at this point in the thesis writing process it's far more important to have a working solution rather than understanding the problem.

Thanks.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Weird interaction between packages and my document class

Post by localghost »

If that solves the problem, please be so kind and mark the topic accordingly as described in Section 3 of the Board Rules.


Best regards
Thorsten
rspringuel
Posts: 19
Joined: Wed Apr 28, 2010 7:16 pm

Re: Weird interaction between packages and my document class

Post by rspringuel »

I'll mark it as solved, but really that's more of a work around rather than a solution. Under other circumstances, (if my shorthand wasn't integers) the problem would still exist.
Post Reply