moderncv 的错误

moderncv 的错误

moderncv我第一次使用该软件包制作简历。我在 Windows 7 上使用 TeXnicCenter 和 MiKTeX 2.9。我moderncv从 CTAN 下载了最新版本...但遇到了问题。我不知道如何解决它们。

\documentclass[12pt,a4paper,naustrian]{moderncv}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{color}
\usepackage{babel}
\usepackage[scale=0.75]{geometry}
\moderncvtheme[grey]{classic}
\firstname{My} \familyname{Name} 
\title{CV} 
\address{Street}{somewhere\protect\[0.1em] country\protect\[0.2em]} 
%\mobile{+1231231231323} %\email{}
\begin{document}
\maketitle
 %\section{Section} %\cvitem{something}{something} %\cvitem{something}{something} Testtext. 
\end{document} 

编辑

感谢您的回复。我刚刚编译了您的示例,但尚未运行。您可以在这里找到 .log 文件中的几行:

! LaTeX Error: Missing \begin{document}.

l.2 < !-- saved from url=(0078)http://mirrors.med.harvard.edu/ctan/macros/lat...

You're in trouble here. Try typing to proceed. If that doesn't work, type X to quit.

Overfull \hbox (28.55835pt too wide) in paragraph at lines 2--4 []\OT1/cmr/m/n/10.95

Overfull \hbox (22.23462pt too wide) in paragraph at lines 2--4 \OT1/cmr/m/n/10.95 from []

Overfull \hbox (447.5515pt too wide) in paragraph at lines 2--4 \OT1/cmr/m/n/10.95 url=(0078)http://mirrors.med.harvard.edu/ctan/macros/latex/c ontrib/etoolbox/etoolbox.sty [] }

感谢您的回复。我刚刚编译了您的示例,但尚未运行。您可以在这里找到 .log 文件中的几行:

{This is pdfTeX, Version 3.1415926-2.3-1.40.12 (MiKTeX 2.9) (preloaded format=pdflatex 2013.4.16)  16 APR 2013 14:34
entering extended mode
**LaTeX2.tex
(C:\Users\iman\Desktop\moderncv\LaTeX2.tex
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, afrikaans, ancientgreek, ar
abic, armenian, assamese, basque, bengali, bokmal, bulgarian, catalan, coptic, 
croatian, czech, danish, dutch, esperanto, estonian, farsi, finnish, french, ga
lician, german, german-x-2009-06-19, greek, gujarati, hindi, hungarian, iceland
ic, indonesian, interlingua, irish, italian, kannada, kurmanji, lao, latin, lat
vian, lithuanian, malayalam, marathi, mongolian, mongolianlmc, monogreek, ngerm
an, ngerman-x-2009-06-19, nynorsk, oriya, panjabi, pinyin, polish, portuguese, 
romanian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedish, swis
sgerman, tamil, telugu, turkish, turkmen, ukenglish, ukrainian, uppersorbian, u
senglishmax, welsh, loaded.
(C:\Users\iman\Desktop\moderncv\moderncv.cls
Document Class: moderncv 2013/02/09 v1.3.0 modern curriculum vitae and letter d
ocument class
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\size11.clo"
File: size11.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
)
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\etoolbox\etoolbox.sty"

! LaTeX Error: Missing \begin{document}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.2 <
     !-- saved from url=(0078)http://mirrors.med.harvard.edu/ctan/macros/lat...

You're in trouble here.  Try typing  <return>  to proceed.
If that doesn't work, type  X <return>  to quit.


Overfull \hbox (28.55835pt too wide) in paragraph at lines 2--4
[]\OT1/cmr/m/n/10.95 <!--
Overfull \hbox (25.91501pt too wide) in paragraph at lines 2--4
\OT1/cmr/m/n/10.95 saved
 []


Overfull \hbox (22.23462pt too wide) in paragraph at lines 2--4
\OT1/cmr/m/n/10.95 from
 []


Overfull \hbox (447.5515pt too wide) in paragraph at lines 2--4
\OT1/cmr/m/n/10.95 url=(0078)http://mirrors.med.harvard.edu/ctan/macros/latex/c
ontrib/etoolbox/etoolbox.sty
 []
 } 

答案1

您可以将代码放入问题中并使用按钮{},它看起来比评论更具可读性。

你有

e\protect\[0.1em] country\protect\[0.2em]}

\[启动显示数学模式(永远找不到匹配项\])你打算

e\protect\\[0.1em] country\protect\\[0.2em]}

强制换行

\documentclass[12pt,a4paper,naustrian]{moderncv}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{color}
\usepackage{babel}
\usepackage[scale=0.75]{geometry}
\moderncvtheme[grey]{classic}
\firstname{My} \familyname{Name} 
\title{CV} 
\address{Street}{somewhere\protect\\[0.1em] country\protect\\[0.2em]} %\mobile{+1231231231323} %\email{}
\begin{document} \maketitle %\section{Section} %\cvitem{something}{something} %\cvitem{something}{something} Testtext. 
\end{document} 

答案2

您不需要\protect在地址中换行,但请确保不要提前结束该组}

示例输出

\documentclass[12pt,a4paper,naustrian]{moderncv}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{color}
\usepackage{babel}
\usepackage[scale=0.75]{geometry}
\moderncvtheme[grey]{classic}
\firstname{My} \familyname{Name} 
\title{CV} 
\address{Street\\somewhere\\[0.1em] country\\[0.2em]} %
\mobile{+1231231231323} 
\email{} 

\begin{document} 
\maketitle 

\section{Section} 

\cvitem{something}{something} 
\cvitem{something}{something} 

Test text. 
\end{document} 

相关内容