This question is a follow up of the answer of this question Spurious space on moderncv \cventry using \if


The problem is that complex content (for example, itemize on the content of the argument) is not handled well when the conditional is set to true.


To emulate and show the problem, I created the following MWE





I would like all this stuff to be raggedright, however. The "year-year" is not important.

I would like all this stuff to be raggedright, however.
% This more complex content breaks existing solutions
  \item Item 1
  \item Item 2


When one executes that with \detailsfalse the code works. However, with \detailstrue there is an error:

! Undefined control sequence. \itemize ...nce \@itemdepth \@ne \edef \@itemitem {labelitem\romannumeral \t...


Thus, what is the correct way of handling the argument, so that the \if inside can be evaluated, as well as the complex content on it. (Like the problem of the question Spurious space on moderncv \cventry using \if)

  • 4
    \begin and \item are fragile, so they don't survive \protected@edef.
    – egreg
    May 10, 2016 at 16:06

1 Answer 1


I admit I don't fully understand what you're trying to do here, but as egreg notes, \begin and \item are fragile which is what's causing the problem. It's easy enough to "fix" this particular example


I don't understand what the point of that conditional is (and I removed the braces around #1).

Since you're using \detokenize, you're relying on e-TeX, so you can use


to make those robust. And assuming that the conditional is to check if \argseven is blank, you can use \ifblank{#1}{true branch}{false branch} from etoolbox.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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