TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

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

My biggest enemy is the page limit. I use short versions of my BibTeX entries in order to keep the list of references short. I now have a situation where I include the file in the journal article and also in a book. I want to use the long reference in the book and the short in the journal. I defined a boolean that is set to true if we are in the journal tex files and then defined a command that is supposed to return the short or long key depending on the value of the boolean. But somehow this does not work. Is there a way to reach my goals?




% cite alternate between the long and short citation key


\citet[\page 48]{\citekeyshortlong{XY-short}{XY-long}}

share|improve this question
If you use etoolbox (which I prefer as its syntax seems simpler to me) you should use a toggle: \newtoggle{jl}\toggletrue{jl}, and then \newcommand{\citekeyshortlong}[2]{\iftoggle{jl}{#1}{#2}}. – Peter Grill Nov 14 '12 at 8:42
\ifthenelse is not expandable, whereas \iftoggle from etoolbox is, hence why Peter's suggestion works and yours does not. See eg Why is the ifthen package obsolete? – cyberSingularity Nov 14 '12 at 9:19

I recommend putting the conditional outermost, so defining the \citekeyshortlong conditionally:

\toggletrue{jl} %% Use short refs


(substituting etoolbox for ifthenelse as recommended by Peter Grill - though this will work with ifthenelse).

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.