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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I encountered a problem that I want to compare the \CurrentOption with a string.

In the .tex file I have a code below.


Then I want to use \ifx to determine whether I use en-ver option or not. This is the code I use now.

\ifx \CurrentOption \en-ver

I have declared the option en-ver using:

{\hspace*{-0.6in} \includegraphics[scale=0.07]{Header_En_ver.jpg}}} 

However, this \ifx code doesn't work at all.

share|improve this question
Welcome to TeX.SE! Sounds like an interesting question :) Do you think you could turn your snippets into a MWE It'll really help folks who wish to look at your problem. Welcome :) – cmhughes Dec 9 '12 at 21:33
up vote 8 down vote accepted

There are several ways to test for the option en-ver:

  • Testing the effect that \cufestatlogo will be defined by the option:

    \let\cufestatlogo\relax % initialization
      % option en-ver not used
      % option en-ver used
  • Adding a switch:

      % option en-ver used
      % option en-ver not used
  • LaTeX's \@ifpackagewith{<package name>}{<option list>}{<then>}{<else>}:

      % option en-ver used
      % option en-ver not used
share|improve this answer
Hi, Heiko, It works. Thank you. – Xiaoxiao Sun Dec 10 '12 at 0:26

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.