# Is there a way to use a global variable? [closed]

I am using multimarkdown to produce LaTeX files. I decided to create a series of templates and use a simple /def/dtype in my document to decided which template to use. The header produced would be something like this:

\def\dtype{Sermon}
\def\mytitle{The Spirit of the Antichrist}
\def\passage{1 John 2:18-29}
\def\myauthor{Pastor John Doe}
\def\mydate{April 16, 2012}
\def\church{Some Church out in the West}
\def\keywords{Antichrist, testing, test, etc.}
\input{mmd-frontmatter}


mmd-header.tex initializes what type of document class is going to be, loads packages, page sizes, etc. I am using \IfStrEqCase{\dtype} to decide which template the program needs to run here and in mmd-frontmatter. This is practical and it compiles perfectly everytime, but I have to continually ignore this warning...

Illegal parameter number in definition of \reserved@a

I would like to fix this warning, but this is way over my head. At this point it is easier to simply ignore the warning, but I would really want to know what is going on, and how to fix it.

UPDATE Ok, I traced the problem to \IfStrEqCase{\dtype}. It seems that if I declare the variable outside(as shown in my example), and then use the \IfStrEqCase{\dtype} inside another file (as shown in my example), XelaTeX throws that error. Will that be enough information?

-
The information is insufficient to give any answer. – egreg May 11 '12 at 23:19
@egreg: Good answer. ;) – Brian M. Hunt May 11 '12 at 23:36
And the title seems unrelated to the question – JLDiaz May 11 '12 at 23:41
The only way I can see to get to the bottom of this is if you compose a fully compilable MWE that reproduces this warning message including the \documentclass and the appropriate packages. – Peter Grill May 11 '12 at 23:47
@tuxtlequino: Which example? Please take a look at the How to Ask-page and try to improve your question according to the guidance found there. After please add a minimal working example (MWE) that illustrates your problem. – Marco Daniel May 15 '12 at 17:13