
我正在处理我的简历moderncv
,并试图让文本环绕页面时项目符号列表正确对齐。
我一直在使用$\bullet$
s 和换行符,但文本换行不正确。结束这里,一位用户建议使用
\newcommand\mybitem[1]{%
\parbox[t]{3mm}{\textbullet}\parbox[t]{10cm}{#1}\\[1.6mm]}
但尝试这样做会导致编译错误:
! 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}}
?
以下是我现在所拥有的:
\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{[email protected]} % 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}
答案1
您可以尝试\mybitem
像您链接到的答案中那样定义的命令,但现在长度已经正确计算:
\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{[email protected]}
\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}
但是,为什么不使用修改后的itemize
环境呢?
\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{[email protected]}
\extrainfo{info}
\begin{document}
\maketitle
\section{Experience}
\cventry{years}{degree/job title}{institution/employer}{localization}{grade}
{\begin{itemize}[label=\textbullet]
\item some bulleted item
\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}
答案2
\cventry{2020}{job title}{\textsc{Company name}}{City}{Country}
{\begin{itemize}
\item[\textbullet] Point 1
\item[\textbullet] Point 2
\end{itemize}
}
经过尝试后,这对我很有用!
答案3
gmedina 的回答此主题对我来说效果更好。复制于此处以方便参考:
\documentclass{moderncv}
\firstname{John}
\familyname{Doe}
\newcommand\mybitem[1]{%
\parbox[t]{3mm}{\textbullet}\parbox[t]{10cm}{#1}\\[1.6mm]}
\begin{document}
\cventry{years}{degree/job title}{institution/employer}{localization}{grade}{%
\mybitem{First item text text text text text text text text text text text text text text
text text text text text text text text text text text text text text text text text text text
text text text.}
\mybitem{Second item}}
\end{document}