我想删除详细信息(电话、社交)之间的分隔点。我假设我需要进行更改moderncvheadiii.sty
,但我不知道应该在哪里编辑。有人可以帮忙吗?
%% start of file `moderncvheadiii.sty'.
%% 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/.
%-------------------------------------------------------------------------------
% identification
%-------------------------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{moderncvheadiii}[2015/07/28 v2.0.0 modern curriculum vitae and letter header variant: 3]
% details options: "details" (default) or "nodetails"
\@initializeif{\if@details}\@detailsfalse
\DeclareOption{details}{\@detailstrue}
\DeclareOption{nodetails}{\@detailsfalse}
\DeclareOption*{}% avoid choking on unknown options
\ExecuteOptions{details}
\ProcessOptions*\relax% \ProcessOptions* processes the options in the order provided (i.e., with the later ones possibly overriding the former ones), while \ProcessOptions processes them in the order of the package
%-------------------------------------------------------------------------------
% required packages
%-------------------------------------------------------------------------------
%-------------------------------------------------------------------------------
% overall head definition
%-------------------------------------------------------------------------------
% fonts
\renewcommand*{\namefont}{\Huge\bfseries\upshape}
\renewcommand*{\titlefont}{\Huge\mdseries\upshape}
\renewcommand*{\addressfont}{\normalsize\mdseries\upshape}
\renewcommand*{\quotefont}{\large\slshape}
% styles
\renewcommand*{\namestyle}[1]{{\namefont\textcolor{color1}{#1}}}
\renewcommand*{\titlestyle}[1]{{\titlefont\textcolor{color2!85}{#1}}}
\renewcommand*{\addressstyle}[1]{{\addressfont\textcolor{color2}{#1}}}
\renewcommand*{\quotestyle}[1]{{\quotefont\textcolor{color1}{#1}}}
% commands
\@initializecommand{\makeheaddetailssymbol}{%
{~~~{\rmfamily\textbullet}~~~}}% the \rmfamily is required to force Latin Modern fonts when using sans serif, as OMS/lmss/m/n is not defined and gets substituted by OMS/cmsy/m/n
% internal command to add an element to the footer
% it collects the elements in a temporary box, and checks when to flush the box
\@initializebox{\makeheaddetailsbox}%
\@initializebox{\makeheaddetailstempbox}%
\@initializelength{\makeheaddetailswidth}%
\@initializelength{\makeheaddetailsboxwidth}%
\@initializeif{\if@firstmakeheaddetailselement}\@firstmakeheaddetailselementtrue%
% adds an element to the makehead, separated by makeheadsymbol
% usage: \addtomakehead[makeheadsymbol]{element}
\newcommand*{\addtomakeheaddetails}[2][\makeheaddetailssymbol]{% TODO: use \@initializecommand, which requires modifying its definition to handle mandatory and optional arguments
\if@firstmakeheaddetailselement%
\savebox{\makeheaddetailstempbox}{\usebox{\makeheaddetailsbox}#2}%
\else%
\savebox{\makeheaddetailstempbox}{\usebox{\makeheaddetailsbox}#1#2}\fi%
\settowidth{\makeheaddetailsboxwidth}{\usebox{\makeheaddetailstempbox}}%
\ifnum\makeheaddetailsboxwidth<\makeheaddetailswidth%
\savebox{\makeheaddetailsbox}{\usebox{\makeheaddetailstempbox}}%
\@firstmakeheaddetailselementfalse%
\else%
\flushmakeheaddetails\\%
\savebox{\makeheaddetailsbox}{#2}%
\savebox{\makeheaddetailstempbox}{#2}%
\settowidth{\makeheaddetailsboxwidth}{\usebox{\makeheaddetailsbox}}%
\@firstmakeheaddetailselementfalse\fi}
% internal command to flush the makehead
\@initializecommand{\flushmakeheaddetails}{%
\strut\usebox{\makeheaddetailsbox}%
\savebox{\makeheaddetailsbox}{}%
\savebox{\makeheaddetailstempbox}{}%
\setlength{\makeheaddetailsboxwidth}{0pt}}
\@initializecommand{\makehead}{%
\setlength{\makeheaddetailswidth}{0.8\textwidth}%
\hfil%
\parbox{\makeheaddetailswidth}{%
\centering%
% name and title
\namestyle{\@firstname~\@lastname}%
\ifthenelse{\equal{\@title}{}}{}{\titlestyle{~|~\@title}}\\% \isundefined doesn't work on \@title, as LaTeX itself defines \@title (before it possibly gets redefined by \title)
% optional detailed information
\if@details{%
\addressfont\color{color2}%
\ifthenelse{\isundefined{\@addressstreet}}{}{\addtomakeheaddetails{\addresssymbol\@addressstreet}%
\ifthenelse{\equal{\@addresscity}{}}{}{\addtomakeheaddetails[~--~]{\@addresscity}}% if \addresstreet is defined, \addresscity and \addresscountry will always be defined but could be empty
\ifthenelse{\equal{\@addresscountry}{}}{}{\addtomakeheaddetails[~--~]{\@addresscountry}}%
\flushmakeheaddetails\@firstmakeheaddetailselementtrue\\\null}%
\collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number
\addtomakeheaddetails{\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}}%
\ifthenelse{\isundefined{\@email}}{}{\addtomakeheaddetails{\emailsymbol\emaillink{\@email}}}%
\ifthenelse{\isundefined{\@homepage}}{}{\addtomakeheaddetails{\homepagesymbol\httplink{\@homepage}}}%
\collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link
\addtomakeheaddetails{\csname\collectionloopkey socialsymbol\endcsname\collectionloopitem}}%
\ifthenelse{\isundefined{\@extrainfo}}{}{\addtomakeheaddetails{\@extrainfo}}%
\flushmakeheaddetails}\fi}\\[2.5em]}% need to force a \par after this to avoid weird spacing bug at the first section if no blank line is left after \makehead
%-------------------------------------------------------------------------------
% resume head definition
%-------------------------------------------------------------------------------
% lengths
\@initializelength{\quotewidth}
\renewcommand*{\recomputecvheadlengths}{%
\setlength{\quotewidth}{0.65\textwidth}}
% commands
\renewcommand*{\makecvhead}{% TODO: use \@initializecommand, which requires modifying its definition to handle \par
% recompute lengths (in case we are switching from letter to resume, or vice versa)
\recomputecvlengths%
\makehead%
% optional quote
\ifthenelse{\isundefined{\@quote}}%
{}%
{{\centering\begin{minipage}{\quotewidth}\centering\quotestyle{\@quote}\end{minipage}\\[2.5em]}}%
\par}% to avoid weird spacing bug at the first section if no blank line is left after \maketitle}
%-------------------------------------------------------------------------------
% letter head definition
%-------------------------------------------------------------------------------
% lengths
%\renewcommand*{\recomputeletterheadlengths}{}
% commands
\renewcommand*{\makeletterhead}{%
% recompute lengths (in case we are switching from letter to resume, or vice versa)
\recomputeletterlengths%
% sender block
\makehead%
\par%
% recipient block
\begin{minipage}[t]{.5\textwidth}
\raggedright%
\addressfont%
{\bfseries\upshape\@recipientname}\\%
\@recipientaddress%
\end{minipage}
% date
\hfill% US style
% \\[1em]% UK style
\@date\\[2em]% US informal style: "January 1, 1900"; UK formal style: "01/01/1900"
% opening
\raggedright%
\@opening\\[1.5em]%
% ensure no extra spacing after \makelettertitle due to a possible blank line
% \ignorespacesafterend% not working
\hspace{0pt}\par\vspace{-\baselineskip}\vspace{-\parskip}}
\endinput
%% end of file `moderncvheadiii.sty'.
答案1
分隔点定义如下:
\@initializecommand{\makeheaddetailssymbol}{%
{~~~{\rmfamily\textbullet}~~~}}% the \rmfamily is required to force Latin Modern fonts when using sans serif, as OMS/lmss/m/n is not defined and gets substituted by OMS/cmsy/m/n
~
命令(分隔点)前后有一个内置距离(带有多个) \textbullet
。要去掉项目符号,但保持距离,请使用补丁
\patchcmd{\makeheaddetailssymbol}
{\textbullet}% to search
{}% replacement
{}{}% success failure
\textbullet
在代码中,where被简单地删除。
要摆脱分隔点和周围的距离,只需使用命令
\renewcommand{\makeheaddetailssymbol}{\quad}
\qquad
对于更大的距离,您可以尝试\quad
。
使用以下 MWE
\documentclass[11pt,a4paper,sans]{moderncv}
% moderncv themes
\moderncvstyle{banking}
\moderncvcolor{blue}
\usepackage[utf8]{inputenc}
\usepackage[scale=0.75]{geometry}
% 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[twitter]{jdoe}
\social[github]{jdoe}
\extrainfo{additional information}
\photo[64pt][0.4pt]{example-image-golden-upright}%
\quote{Some quote}
%\renewcommand{\makeheaddetailssymbol}{\quad} % <======================== \qquad
\patchcmd{\makeheaddetailssymbol} % <===================================
{\textbullet}% to search
{}% replacement
{}{}% success failure <======================================
\begin{document}
\makecvtitle
\section{Education}
\cventry{year--year}{Degree}{Institution--3}{City--4}{\textit{Grade}--5}{Description--6} % arguments 3 to 6 can be left empty
\cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{Description}
\section{Master thesis}
\cvitem{title}{\emph{Title}}
\cvitem{supervisors}{Supervisors}
\cvitem{description}{Short thesis abstract}
\section{Experience}
\subsection{Vocational}
\cventry{year--year}{Job title}{Employer}{City}{}{General description
no longer than 1--2 lines.\newline{}%
Detailed achievements:%
\begin{itemize}%
\item Achievement 1;
\item Achievement 2, with sub-achievements:
\begin{itemize}%
\item Sub-achievement (a);
\item Sub-achievement (b), with sub-sub-achievements (don't do this!);
\begin{itemize}
\item Sub-sub-achievement i;
\item Sub-sub-achievement ii;
\item Sub-sub-achievement iii;
\end{itemize}
\item Sub-achievement (c);
\end{itemize}
\item Achievement 3.
\end{itemize}}
\cventry{year--year}{Job title}{Employer}{City}{}{Description
line 1\newline{}Description line 2}
\subsection{Miscellaneous}
\cventry{year--year}{Job title}{Employer}{City}{}{Description}
\section{Languages}
\cvitemwithcomment{Language 1}{Skill level}{Comment}
\cvitemwithcomment{\textbf{Language} 2}{\textbf{Skill} level}{Comment}
\cvitemwithcomment{Language 3}{Skill level}{Comment}
\section{Computer skills}
\cvdoubleitem{category 1}{XXX, YYY, ZZZ}{category 4}{XXX, YYY, ZZZ}
\cvdoubleitem{category 2}{XXX, YYY, ZZZ}{category 5}{XXX, YYY, ZZZ}
\cvdoubleitem{category 3}{XXX, YYY, ZZZ}{category 6}{XXX, YYY, ZZZ}
\section{Interests}
\cvitem{hobby 1}{Description}
\cvitem{hobby 2}{Description}
\cvitem{hobby 3}{Description}
\section{Extra 1}
\cvlistitem{Item 1}
\cvlistitem{Item 2}
\cvlistitem{Item 3. This item is particularly long and therefore
normally spans over several lines. Did you notice the indentation
when the line wraps?}
\section{Extra 2}
\cvlistdoubleitem{Item 1}{Item 4}
\cvlistdoubleitem{Item 2}{Item 5}
\cvlistdoubleitem{Item 3}{Item 6. Like item 3 in the single column list before, this item is particularly long to wrap over several lines.}
\section{References}
\begin{cvcolumns}
\cvcolumn{Category 1}{\begin{itemize}\item Person 1\item Person 2\item Person 3\end{itemize}}
\cvcolumn{Category 2}{Amongst others:\begin{itemize}\item Person 1, and\item Person 2\end{itemize}(more upon request)}
\cvcolumn[0.5]{All the rest \& some more}{\textit{That} person, and \textbf{those} also (all available upon request).}
\end{cvcolumns}
\end{document}
您将获得最终的 pdf:
答案2
为了摆脱分隔各个联系人详细信息的实心圆圈而不进行任何更改moderncvheadiii.sty
,您可以添加
\makeatletter
\@initializecommand{\makeheaddetailssymbol}{\quad}
\makeatother
到你的文档的序言中。
如果您希望条目之间有更大的空白,也可以将其替换\quad
为\qqad
。有关更多间距选项,您还可以在此处查看:有哪些命令可以控制水平间距?