I am writing my own cv using moderncv. In the section "education" I have an entry that does not suit the inputs required by \cventry. Generally, \cventry requires 6 fields, but I only need 4. My problem is that if I insert text only where I need, and leave the curvy brakets I do not need empty, what I get is:

01.2001-02-2002: Name, City, .
Text that briefly describes it.

As you can see, after the label "City" there is a ", " that I don't want. How can I get rid of it? My current \cventry is like this:

 \cventry{Date1-Date2}{Name}{}{City}{\textit{}}{Some text}

I tried to switch "City" to the empty bracket on its right, I get rid of the ", " but my city name turns into italics. On the other hand, if I shift my "City" label to the left, I still get the ", " sign and the city name becomes italics.

  • Go to the .cls file and change the code there
    – user95439
    Commented May 28, 2016 at 16:30
  • I created a new class immediatelly below \cventryspecial that requires less inputs therefore should be fine, but when I run it the code tell me \cventryspecial not defined. I already Refreshed FNDB and Updated Formats with MikTex options, so what is the problem? Commented May 28, 2016 at 17:46
  • Please check the license of the clas file before you make any changes to it. This is common sense.
    – Johannes_B
    Commented May 29, 2016 at 5:06
  • Get rid of the useless \textit{} in the next pair of braces?
    – Johannes_B
    Commented May 29, 2016 at 5:13
  • Thank you everybody, since the error was much more trivial, I stopped and simply removed the \texit{} from the code to solve my problem. Thank you anyway for your suggestion @Johannes_B, as I also wrote below, I was not aware that was the issue because, being new to LaTeX, I was not aware where to look for an solution. Commented May 29, 2016 at 16:00

1 Answer 1


Moderncv should account for this, the following is the extract which defines \cventry in the package (moderncvbodyi.sty in http://ctan.org/tex-archive/macros/latex/contrib/moderncv).

    \ifthenelse{\equal{#4}{}}{}{, {\slshape#4}}%
    \ifthenelse{\equal{#5}{}}{}{, #5}%
    \ifthenelse{\equal{#6}{}}{}{, #6}%

\ifthenelse checks whether the fourth, fifth, or sixth elements are empty or not, so as to avoid commas between blank spaces. If there is nothing in a pair of braces it will not insert the comma but if the pair of braces is not empty, it adds the comma and inserts the contents of the braces. Note that this works in your example as no blank comma appears for the {} you use between Name and City.

I believe the problem is that {\textit{}} is not equal to {}, while no print text is defined in the argument the test finds that \textit{} is distinct from nothing. Removing this and using \cventry{Date1-Date2}{Name}{}{City}{}{Some text} should then resolve problems.

To define a short entry (assuming you never use the optional argument), the following should suffice but is probably not worth the hassle

  • Thank you a lot, as I said I am new to LaTeX and I did not know where to look for a solution to my problem. Indeed, I removed the `\textit{} and now it works. Thank you a lot again, I will be more careful and look directly in the .sty file for an explanation next time Commented May 29, 2016 at 15:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .