编辑:

编辑:

在此文档中,我想停用斜体\cventry

%% start of file `template.tex'.
%% Copyright 2006-2015 Xavier Danaux ([email protected]).
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License version 1.3c,
% available at http://www.latex-project.org/lppl/.


\documentclass[11pt,a4paper,sans]{moderncv}        % possible options include font size ('10pt', '11pt' and '12pt'), paper size ('a4paper', 'letterpaper', 'a5paper', 'legalpaper', 'executivepaper' and 'landscape') and font family ('sans' and 'roman')

% moderncv themes
\moderncvstyle{casual}                             % style options are 'casual' (default), 'classic', 'banking', 'oldstyle' and 'fancy'
\moderncvcolor{blue}                               % color options 'black', 'blue' (default), 'burgundy', 'green', 'grey', 'orange', 'purple' and 'red'
%\renewcommand{\familydefault}{\sfdefault}         % to set the default font; use '\sfdefault' for the default sans serif font, '\rmdefault' for the default roman one, or any tex font name
%\nopagenumbers{}                                  % uncomment to suppress automatic page numbering for CVs longer than one page

% character encoding
%\usepackage[utf8]{inputenc}                       % if you are not using xelatex ou lualatex, replace by the encoding you are using
%\usepackage{CJKutf8}                              % if you need to use CJK to typeset your resume in Chinese, Japanese or Korean

% adjust the page margins
\usepackage[scale=0.75]{geometry}
%\setlength{\hintscolumnwidth}{3cm}                % if you want to change the width of the column with the dates
%\setlength{\makecvheadnamewidth}{10cm}            % for the 'classic' style, if you want to force the width allocated to your name and avoid line breaks. be careful though, the length is normally calculated to avoid any overlap with your personal info; use this at your own typographical risks...

% personal data
\name{John}{Doe}
\title{Resumé title}                               % optional, remove / comment the line if not wanted
\address{street and number}{postcode city}{country}% optional, remove / comment the line if not wanted; the "postcode city" and "country" arguments can be omitted or provided empty
\phone[mobile]{+1~(234)~567~890}                   % optional, remove / comment the line if not wanted; the optional "type" of the phone can be "mobile" (default), "fixed" or "fax"
\phone[fixed]{+2~(345)~678~901}
\phone[fax]{+3~(456)~789~012}
\email{[email protected]}                               % optional, remove / comment the line if not wanted
\homepage{www.johndoe.com}                         % optional, remove / comment the line if not wanted
\social[linkedin]{john.doe}                        % optional, remove / comment the line if not wanted
\social[xing]{john\_doe}                           % optional, remove / comment the line if not wanted
\social[twitter]{jdoe}                             % optional, remove / comment the line if not wanted
\social[github]{jdoe}                              % optional, remove / comment the line if not wanted
\social[gitlab]{jdoe}                              % optional, remove / comment the line if not wanted
\social[skype]{jdoe}                               % optional, remove / comment the line if not wanted
\extrainfo{additional information}                 % optional, remove / comment the line if not wanted
%\photo[64pt][0.4pt]{picture}                       % optional, remove / comment the line if not wanted; '64pt' is the height the picture must be resized to, 0.4pt is the thickness of the frame around it (put it to 0pt for no frame) and 'picture' is the name of the picture file
\quote{Some quote}                                 % optional, remove / comment the line if not wanted

% bibliography adjustements (only useful if you make citations in your resume, or print a list of publications using BibTeX)
%   to show numerical labels in the bibliography (default is to show no labels)
%\makeatletter\renewcommand*{\bibliographyitemlabel}{\@biblabel{\arabic{enumiv}}}\makeatother
\renewcommand*{\bibliographyitemlabel}{[\arabic{enumiv}]}
%   to redefine the bibliography heading string ("Publications")
%\renewcommand{\refname}{Articles}

% bibliography with mutiple entries
%\usepackage{multibib}
%\newcites{book,misc}{{Books},{Others}}
%----------------------------------------------------------------------------------
%            content
%----------------------------------------------------------------------------------
\begin{document}
%\begin{CJK*}{UTF8}{gbsn}                          % to typeset your resume in Chinese using CJK
%-----       resume       ---------------------------------------------------------
\makecvtitle


\section{Experience}
\subsection{Vocational}
\cventry{year--year}{Job title}{Employer}{City}{}{General description no longer than 1--2 lines.\newline{}%
Detailed achievements:}



% Publications from a BibTeX file without multibib
%  for numerical labels: \renewcommand{\bibliographyitemlabel}{\@biblabel{\arabic{enumiv}}}% CONSIDER MERGING WITH PREAMBLE PART
%  to redefine the heading string ("Publications"): \renewcommand{\refname}{Articles}
\nocite{*}
\bibliographystyle{plain}
\bibliography{publications}                        % 'publications' is the name of a BibTeX file

% Publications from a BibTeX file using the multibib package
%\section{Publications}
%\nocitebook{book1,book2}
%\bibliographystylebook{plain}
%\bibliographybook{publications}                   % 'publications' is the name of a BibTeX file
%\nocitemisc{misc1,misc2,misc3}
%\bibliographystylemisc{plain}
%\bibliographymisc{publications}                   % 'publications' is the name of a BibTeX file

\clearpage
\end{document}



    % Publications from a BibTeX file without multibib
    %  for numerical labels: \renewcommand{\bibliographyitemlabel}{\@biblabel{\arabic{enumiv}}}% CONSIDER MERGING WITH PREAMBLE PART
    %  to redefine the heading string ("Publications"): \renewcommand{\refname}{Articles}
    \nocite{*}
    \bibliographystyle{plain}
    \bibliography{publications}                        % 'publications' is the name of a BibTeX file

    % Publications from a BibTeX file using the multibib package
    %\section{Publications}
    %\nocitebook{book1,book2}
    %\bibliographystylebook{plain}
    %\bibliographybook{publications}                   % 'publications' is the name of a BibTeX file
    %\nocitemisc{misc1,misc2,misc3}
    %\bibliographystylemisc{plain}
    %\bibliographymisc{publications}                   % 'publications' is the name of a BibTeX file

    \clearpage
    \end{document}

在此处输入图片描述

第二项(在本例中Employer)始终以斜体表示。

我尝试使用

\xpatchcmd{\cventry}{\itshape#2}{#2}{}{}

但在这种情况下它不起作用。(感谢 egreg 的回答线

此外,我想在每个部分之后添加换行符\cventry。例如:

Job Title
Employer
City

代替

Job Title, Employer, City

答案1

当前版本 2.0.0(您似乎正在使用它)的命令定义\cventry是:

\renewcommand*{\cventry}[7][.25em]{%
  \cvitem[#1]{#2}{%
    {\bfseries#3}%
    \ifthenelse{\equal{#4}{}}{}{, {\slshape#4}}%
    \ifthenelse{\equal{#5}{}}{}{, #5}%
    \ifthenelse{\equal{#6}{}}{}{, #6}%
    .\strut%
    \ifx&#7&%
    \else{\newline{}\begin{minipage}[t]{\linewidth}\small#7\end{minipage}}\fi}}

因此您需要将命令更改xpatchcmd

\usepackage{xpatch}
\xpatchcmd{\cventry}{\slshape#4}{#4}{}{}

使用以下 MWE

\documentclass[11pt,a4paper,sans]{moderncv}
% moderncv themes
\moderncvstyle{casual} % head[left,right] 2 body 1 foot 1
\moderncvcolor{blue} 
%\renewcommand{\familydefault}{\sfdefault} 
%\nopagenumbers{}

% adjust the page margins
\usepackage[scale=0.75]{geometry}
%\setlength{\hintscolumnwidth}{3cm} 
%\setlength{\makecvheadnamewidth}{10cm}

\usepackage{xpatch}
\xpatchcmd{\cventry}{\slshape#4}{#4}{}{}


% personal data
\name{John}{Doe}
\title{Resumé title}
\address{street and number}{postcode city}{country}
\phone[mobile]{+1~(234)~567~890}
\phone[fixed]{+2~(345)~678~901}
\phone[fax]{+3~(456)~789~012}
\email{[email protected]}
\homepage{www.johndoe.com}
\social[linkedin]{john.doe}
\social[xing]{john\_doe}
\social[twitter]{jdoe}
\social[github]{jdoe}
\social[gitlab]{jdoe}
\social[skype]{jdoe}
\extrainfo{additional information}
%\photo[64pt][0.4pt]{picture}
\quote{Some quote}

% bibliography adjustements (only useful if you make citations in your resume, or print a list of publications using BibTeX)
%   to show numerical labels in the bibliography (default is to show no labels)
%\makeatletter\renewcommand*{\bibliographyitemlabel}{\@biblabel{\arabic{enumiv}}}\makeatother
\renewcommand*{\bibliographyitemlabel}{[\arabic{enumiv}]}
%   to redefine the bibliography heading string ("Publications")
%\renewcommand{\refname}{Articles}

% bibliography with mutiple entries
%\usepackage{multibib}
%\newcites{book,misc}{{Books},{Others}}
%----------------------------------------------------------------------------------
%            content
%----------------------------------------------------------------------------------
\begin{document}
%\begin{CJK*}{UTF8}{gbsn}                          % to typeset your resume in Chinese using CJK
%-----       resume       ---------------------------------------------------------
\makecvtitle


\section{Experience}
\subsection{Vocational}
\cventry{year--year}{Job title}{Employer}{City}{}{General description no longer than 1--2 lines.\newline{}%
Detailed achievements:}



% Publications from a BibTeX file without multibib
%  for numerical labels: \renewcommand{\bibliographyitemlabel}{\@biblabel{\arabic{enumiv}}}% CONSIDER MERGING WITH PREAMBLE PART
%  to redefine the heading string ("Publications"): \renewcommand{\refname}{Articles}
\nocite{*}
\bibliographystyle{plain}
\bibliography{publications}                        % 'publications' is the name of a BibTeX file

% Publications from a BibTeX file using the multibib package
%\section{Publications}
%\nocitebook{book1,book2}
%\bibliographystylebook{plain}
%\bibliographybook{publications}                   % 'publications' is the name of a BibTeX file
%\nocitemisc{misc1,misc2,misc3}
%\bibliographystylemisc{plain}
%\bibliographymisc{publications}                   % 'publications' is the name of a BibTeX file

\clearpage
\end{document}

得到结果:

在此处输入图片描述

编辑:

例如,您可以定义一个新命令\mycventry(我认为这比如此艰难地改变要好\cventry):

\newcommand*{\mycventry}[7][.25em]{%
  \cvitem[#1]{#2}{%
    {\bfseries#3}%
    \ifthenelse{\equal{#4}{}}{}{\newline {#4}}%
    \ifthenelse{\equal{#5}{}}{}{\newline #5}%
    \ifthenelse{\equal{#6}{}}{}{\newline #6}%
    .\strut%
    \ifx&#7&%
    \else{\newline{}\begin{minipage}[t]{\linewidth}\small#7\end{minipage}}\fi}}

这里我把逗号改为,\newline并删除了倾斜的打印。

使用以下 MWE

\documentclass[11pt,a4paper,sans]{moderncv}
% moderncv themes
\moderncvstyle{casual} % head[left,right] 2 body 1 foot 1
\moderncvcolor{blue} 
%\renewcommand{\familydefault}{\sfdefault} 
%\nopagenumbers{}

% adjust the page margins
\usepackage[scale=0.75]{geometry}
%\setlength{\hintscolumnwidth}{3cm} 
%\setlength{\makecvheadnamewidth}{10cm}

\usepackage{xpatch}
\xpatchcmd{\cventry}{\slshape#4}{#4}{}{}

\newcommand*{\mycventry}[7][.25em]{%
  \cvitem[#1]{#2}{%
    {\bfseries#3}%
    \ifthenelse{\equal{#4}{}}{}{\newline {#4}}%
    \ifthenelse{\equal{#5}{}}{}{\newline #5}%
    \ifthenelse{\equal{#6}{}}{}{\newline #6}%
    .\strut%
    \ifx&#7&%
    \else{\newline{}\begin{minipage}[t]{\linewidth}\small#7\end{minipage}}\fi}}


% personal data
\name{John}{Doe}
\title{Resumé title}
\address{street and number}{postcode city}{country}
\phone[mobile]{+1~(234)~567~890}
\phone[fixed]{+2~(345)~678~901}
\phone[fax]{+3~(456)~789~012}
\email{[email protected]}
\homepage{www.johndoe.com}
\social[linkedin]{john.doe}
\social[xing]{john\_doe}
\social[twitter]{jdoe}
\social[github]{jdoe}
\social[gitlab]{jdoe}
\social[skype]{jdoe}
\extrainfo{additional information}
%\photo[64pt][0.4pt]{picture}
\quote{Some quote}

% bibliography adjustements (only useful if you make citations in your resume, or print a list of publications using BibTeX)
%   to show numerical labels in the bibliography (default is to show no labels)
%\makeatletter\renewcommand*{\bibliographyitemlabel}{\@biblabel{\arabic{enumiv}}}\makeatother
\renewcommand*{\bibliographyitemlabel}{[\arabic{enumiv}]}
%   to redefine the bibliography heading string ("Publications")
%\renewcommand{\refname}{Articles}

% bibliography with mutiple entries
%\usepackage{multibib}
%\newcites{book,misc}{{Books},{Others}}
%----------------------------------------------------------------------------------
%            content
%----------------------------------------------------------------------------------
\begin{document}
%\begin{CJK*}{UTF8}{gbsn}                          % to typeset your resume in Chinese using CJK
%-----       resume       ---------------------------------------------------------
\makecvtitle


\section{Experience}
\subsection{Vocational}
\cventry{year--year-2}{Job title-3}{Employer-4}{City-5}{-6}{General description no longer than 1--2 lines-7}
\mycventry{year--year-2}{Job title-3}{Employer-4}{City-5}{-6}{General description no longer than 1--2 lines-7}


% Publications from a BibTeX file without multibib
%  for numerical labels: \renewcommand{\bibliographyitemlabel}{\@biblabel{\arabic{enumiv}}}% CONSIDER MERGING WITH PREAMBLE PART
%  to redefine the heading string ("Publications"): \renewcommand{\refname}{Articles}
\nocite{*}
\bibliographystyle{plain}
\bibliography{publications}                        % 'publications' is the name of a BibTeX file

% Publications from a BibTeX file using the multibib package
%\section{Publications}
%\nocitebook{book1,book2}
%\bibliographystylebook{plain}
%\bibliographybook{publications}                   % 'publications' is the name of a BibTeX file
%\nocitemisc{misc1,misc2,misc3}
%\bibliographystylemisc{plain}
%\bibliographymisc{publications}                   % 'publications' is the name of a BibTeX file

\clearpage
\end{document}

你会得到:

第二个结果

相关内容