Sunteți pe pagina 1din 4

6/6/2018 Bulleted lists in moderncv cventry - TeX - LaTeX Stack Exchange

Bulleted lists in moderncv cventry

I'm working on my CV in moderncv , and am trying to have a bulleted list that is correctly aligned when the text wraps around the page.

I've been using $\bullet$ s and newlines, but the text wraps incorrectly. Over here, a user suggests using

\newcommand\mybitem[1]{%
\parbox[t]{3mm}{\textbullet}\parbox[t]{10cm}{#1}\\[1.6mm]}

but trying that gives me an error on compilation:

! Use of \LT@array doesn't match its definition.


\@ifnextchar ... \reserved@d =#1\def \reserved@a {
#2}\def \reserved@b {#3}\f...
l.37 \mybitem{Second item}}

Here is what I have now:

\documentclass[11pt,a4paper]{moderncv}

% moderncv themes
\moderncvtheme[blue]{casual} % optional argument are 'blue' (default),
'orange', 'red', 'green', 'grey' and 'roman' (for roman fonts, instead of sans serif
fonts)

\usepackage[utf8]{inputenc} % replace by the encoding you are using

\usepackage[scale=0.8]{geometry}
\recomputelengths % required when changes are made to page
layout lengths

% personal data
\firstname{first}
\familyname{last}
%\quote{} % optional, remove the line if not wanted
\address{123 First St}{Somewhere, CA 90210} % optional, remove the line if not wanted
\mobile{555.555.5555} % optional, remove the line if not wanted
\email{me@me.com} % optional, remove the line if not wanted
\extrainfo{info} % optional, remove the line if not wanted

\newcommand\mybitem[1]{%
\parbox[t]{3mm}{\textbullet}\parbox[t]{10cm}{#1}\\[1.6mm]}

\begin{document}
\maketitle

\section{Experience}

\cventry{years}{degree/job title}{institution/employer}{localization}{grade}
{$\bullet$ Hacky, non-indented method.\newline
$\bullet$ line two lorem ipsum}

\closesection{} % needed to renewcommands


\renewcommand{\listitemsymbol}{-} % change the symbol for lists

\end{document}

{lists} {moderncv}

asked Mar 8 '11 at 23:21


Cev
225 2 3 7

This question has an open bounty worth +50 reputation from fstang ending in 7 days.
The question is widely applicable to a large audience A detailed canonical answer is required to address all the concerns
https://tex.stackexchange.com/questions/13000/bulleted-lists-in-moderncv-cventry 1/4
6/6/2018 Bulleted lists in moderncv cventry - TeX - LaTeX Stack Exchange
The question is widely applicable to a large audience. A detailed canonical answer is required to address all the concerns.

The currently-accepted answer has flaws: 1. the itemize environment suggested in cventry doesn't compile with xelatex. 2. the \mybitem command puts
two items on one line and overflows the page. Please help fix these issues or provide a better answer. I use MacTex (texlive on mac) Thanks!

3 Answers

You can try the \mybitem command defined like in the answer you linked to, but with the
lengths now properly calculated:

\documentclass[11pt,a4paper]{moderncv}
\moderncvtheme[blue]{casual}
\usepackage[utf8]{inputenc}

\usepackage[scale=0.8]{geometry}
\recomputelengths

\firstname{first}
\familyname{last}
\address{123 First St}{Somewhere, CA 90210}
\mobile{555.555.5555}
\email{me@me.com}
\extrainfo{info}

\newlength\mylen
\addtolength\mylen{\linewidth}
\addtolength\mylen{-\hintscolumnwidth}
\addtolength\mylen{-\separatorcolumnwidth}
\addtolength\mylen{-3mm}

\newcommand\mybitem[1]{%
\parbox[t]{3mm}{\textbullet}\parbox[t]{\mylen}{#1}}

\begin{document}
\maketitle

\section{Experience}

\cventry{years}{degree/job title}{institution/employer}{localization}{grade}
{\mybitem{some bulleted entry}
\mybitem{some bulleted entry which is so long that it will span more than a single line,
or at least, that's what I hope}
}

\closesection{}

\end{document}

However, why don't you use a modified itemize environment?

\documentclass[11pt,a4paper]{moderncv}
\moderncvtheme[blue]{casual}
\usepackage[utf8]{inputenc}
\usepackage{enumitem}
\usepackage[scale=0.8]{geometry}
\recomputelengths

\firstname{first}
\familyname{last}
\address{123 First St}{Somewhere, CA 90210}
\mobile{555.555.5555}
\email{me@me.com}
\extrainfo{info}

\begin{document}
\maketitle

\section{Experience}

\cventry{years}{degree/job title}{institution/employer}{localization}{grade}
{\begin{itemize}[label=\textbullet]
\item some bulleted item

https://tex.stackexchange.com/questions/13000/bulleted-lists-in-moderncv-cventry 2/4
6/6/2018 Bulleted lists in moderncv cventry - TeX - LaTeX Stack Exchange
\item another bulleted item, this time so long that it will span more than one line,
let's add some more text .
\end{itemize}
}

\closesection{}

\end{document}

edited Mar 9 '11 at 1:18 answered Mar 8 '11 at 23:57


Gonzalo Medina
379k 35 1238
1524

1 I tried the second option in your list, but it fails to compile: ! LaTeX Error: Environment description
undefined. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate
help. ... l.775 \renewenvironment{description} [1][] ? I've tried it with both miktex on windows and
pdflatex on osx (just adding the package enumitem causes the error) –  Cev Mar 9 '11 at 1:03

@Cev: Both my example codes work OK in my system (TeX Live2010); perhaps your LaTeX installations are
outdated? Which version of MiKTeX and of MacTeX (I assume) are you using? The latest versions are MiKTeX2.9
and MacTeX-2010. – Gonzalo Medina Mar 9 '11 at 1:14

Figured it out: the version of moderncv I used from this site had an older version incompatible with enumitem.
Thanks! –  Cev Mar 9 '11 at 1:31

1 I realize this is hopelessly unspecific, but my pdflatex gives me the error ! LaTeX Error: Something's
wrong--perhaps a missing \item. when using the modified itemize environment suggested in the answer.
What could be the reason? What could I do to further debug this? – Christoph Wurm May 10 '12 at 16:49

I'm using \cvlist instead of \cventry , so my code is \cvline{}{\begin{itemize}


[label=\textbullet]...\end{itemize}} . Maybe that has something to do with it. Perhaps I should open a new
question... – Christoph Wurm May 10 '12 at 16:59

I have been confronted with the same error. In my situation, when I use the classic style,
there is no problem, but when I change the style to banking or casual, there generate a error
with the following prompt:

! LaTeX Error: Something's wrong--perhaps a missing \item.

See the LaTeX manual or LaTeX Companion for explanation.


Type H <return> for immediate help.
...

l.107 \makecvtitle

Since the error is at the \makecvtitle , so it seems that the problem exists in the personal data
of my CV. So I recalled my recent modification, I finally found the problem is that I add a line
feed command \\\\ in the \extrainfo , it looks like that as follows,

\extrainfo{item1 \\ item2}

Then, I deleted the line feed command \\ , the error vanished.

So, I wish this can be a possible way to address the similar errors anyone has confronted
with.
This site uses cookies to deliver our services and to show you relevant ads and job listings. By using our site, you acknowledge that you have read and
understand our Cookie Policy, Privacy Policy, and our Terms of Service. Your use of Stack Overflow’s Products and Services, including the Stack
edited May 20 '16 at 8:56 answered May 20 '16 at 8:25
Overflow Network, is subject to these policies and terms.
Stefan Pinnow J. Yu
17.4k 8 31 67 1

Welcome to tex.SX J. Yu. Are you sure this is "the same error"? It isn't the same error message. – sheß May 20 '16
at 8:39

@sheß: I am sorry. I really made a mistake. I think I opened many webpages in my browser and mixed them up. I
will resend the above answer to the corresponding question. – J. Yu May 27 '16 at 7:52

gmedina's answer in this thread works better for me. Copied here for easy reference:

https://tex.stackexchange.com/questions/13000/bulleted-lists-in-moderncv-cventry 3/4
6/6/2018 Bulleted lists in moderncv cventry - TeX - LaTeX Stack Exchange

\documentclass{moderncv}

\firstname{John}
\familyname{Doe}

\newcommand\myitem{\item[\textbullet]\hspace*{.5em} }

\begin{document}

\cventry{years}{degree/job title}{institution/employer}{localization}{grade}{%
\begin{itemize}\setlength\itemindent{6pt}
\myitem First item.
\myitem Second item.
\myitem Third item.
\end{itemize}}

\end{document}

answered 8 hours ago


fstang
51 2

https://tex.stackexchange.com/questions/13000/bulleted-lists-in-moderncv-cventry 4/4

S-ar putea să vă placă și