我正在尝试使用 LaTeX 准备我的简历,但每次编译后,我都会在句子后面看到一个不必要的“。”。代码片段如下所示:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% "ModernCV" CV and Cover Letter
% LaTeX Template
% Version 1.1 (9/12/12)
%
% This template has been downloaded from:
% http://www.LaTeXTemplates.com
%
% Original author:
% Xavier Danaux ([email protected])
%
% License:
% CC BY-NC-SA 3.0 (http://creativecommons.org/licenses/by-nc-sa/3.0/)
%
% Important note:
% This template requires the moderncv.cls and .sty files to be in the same
% directory as this .tex file. These files provide the resume style and themes
% used for structuring the document.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%----------------------------------------------------------------------------------------
% PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
%----------------------------------------------------------------------------------------
\documentclass[10pt,a4paper,sans]{moderncv} % Font sizes: 10, 11, or 12; paper sizes: a4paper, letterpaper, a5paper, legalpaper, executivepaper or landscape; font families: sans or roman
\moderncvstyle{casual} % CV theme - options include: 'casual' (default), 'classic', 'oldstyle' and 'banking'
\moderncvcolor{black} % CV color - options include: 'blue' (default), 'orange', 'green', 'red', 'purple', 'grey' and 'black'
\usepackage{lipsum} % Used for inserting dummy 'Lorem ipsum' text into the template
\usepackage[german]{babel}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage[scale=0.85]{geometry} % Reduce document margins
%\setlength{\hintscolumnwidth}{3cm} % Uncomment to change the width of the dates column
%\setlength{\makecvtitlenamewidth}{10cm} % For the 'classic' style, uncomment to adjust the width of the space allocated to your name
%----------------------------------------------------------------------------------------
% NAME AND CONTACT INFORMATION SECTION
%----------------------------------------------------------------------------------------
\firstname{Dilip} % Your first name
\familyname{Rachuri} % Your last name
% All information in this block is optional, comment out any lines you don't need
\title{Lebenslauf}
\address{xx}{xxxx, xx}
\mobile{(xx) xx}
\email{xx.xxx}
%\homepage{staff.org.edu/~jsmith}{staff.org.edu/$\sim$jsmith} % The first argument is the url for the clickable link, the second argument is the url displayed in the template - this allows special characters to be displayed such as the tilde in this example
\photo[70pt][0.4pt]{pictures/picture} % The first bracket is the picture height, the second is the thickness of the frame around the picture (0pt for no frame)
%\quote{"A witty and playful quotation" - John Smith}
%----------------------------------------------------------------------------------------
\begin{document}
\makecvtitle % Print the CV title
%----------------------------------------------------------------------------------------
% EDUCATION SECTION
%----------------------------------------------------------------------------------------
\section{Angaben zur Person}
\medskip
\cventry{Name}{xxx}{}{}{\textit{}}{} % Arguments not required can be left empty
\cventry{Adresse}{xxx}{xx, xx}{}{\textit{}}{} % Arguments not required can be left empty
\cventry{Telefon}{xx-xx}{}{}{\textit{}}{} % Arguments not required can be left empty
\cventry{E-Mail}{[email protected]}{}{}{\textit{}}{} % Arguments not required can be left empty
\cventry{Staatsh\"origskeit}{xx}{}{}{\textit{}}{} % Arguments not required can be left empty
\cventry{Geburtsdatum}{x xx}{}{}{\textit{}}{} % Arguments not required can be left empty
\cventry{Geschlecht}{xx}{}{}{\textit{}}{} % Arguments not required can be left empty
\cventry{Gew\"unschtes Berufsfeld}{Ingenieur}{}{}{\textit{}}{} % Arguments not required can be left empty
\end{document}
如果编译上述相同的代码,则可能会重现此故障。有人能帮助我吗?
谢谢你迪利普
答案1
使用
{}
不是
{\textit{}}
该类检测空参数并省略逗号和空格但使其\textit
非空。
.
直接通过添加,但\cventry
您可以在设置 cv 主题后重新定义它:
\makeatletter
\expandafter\def\csname\string\cventry\endcsname[#1]#2#3#4#5#6#7{\cvitem [#1]{#2}{{\bfseries #3}\ifthenelse {\equal
{#4}{}}{}{, {\slshape #4}}\ifthenelse {\equal {#5}{}}{}{, #5}%
\ifthenelse {\equal {#6}{}}{}{, #6}%%%%%%%%%%%%%%%%%%%%%.
\strut \ifx &\else {\newline {}\begin {minipage}[t]{\linewidth }\small #7\end {minipage}}\fi}}
\makeatother