Sign up ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have looking for TeXT Placement movememnt in the class file. Requirement is store the value and print in another places.

My LaTeX code is:


and my class file is

\ifthenelse{\equal{#1}{1}}{Sample 1}{}%
\ifthenelse{\equal{#1}{2}}{Sample 2}{}%
\ifthenelse{\equal{#1}{3}}{Sample 3}{}
\ifthenelse{\equal{#1}{4}}{Sample 4}{}
\ifthenelse{\equal{#1}{5}}{Sample 5}{}

If \jnl{2} is found need to change the \jnl{Sample 2} and like to place in after \maketitle. How do achieve this in class file?

share|improve this question
It is not clear to me what you are asking. Is it general conditional setting of macros, or a construction for case statements or ...? Note that the macros provided by etoolbox are to be preferred over those from ifthen, see – Andrew Swann Aug 3 '13 at 14:55

1 Answer 1

up vote 3 down vote accepted

You want to use \protected@edef in a different way; with that code the definition of \@jnl will never be used. Moreover, \ifthenelse cannot be used in \protected@edef.


\makeatletter % this shouldn't be used in the class file
     Sample 1\or
     Sample 2\or
     Sample 3\or
     Sample 4\or
     Sample 5\else
    {Invalid argument to \protect\jnl}
    {The argument to \protect\jnl\space should be
     between 1 and 5 (included)}%
\makeatother % this shouldn't be used in the class file


In the first and last case, \@jnl will raise an error.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.