更改 moderncv 文档中的页码样式

更改 moderncv 文档中的页码样式

我正在和一个

\moderncvstyle{casual} 

模板来创建我的简历。该模板包括自动页码,样式如下:1/5、2/5、3/5 ....

我不想要这种风格,我只想要每页都有简单的数字,像这样:1、2、3

但是,没有迹象表明我可以在哪里修改页码样式。

我可以使用以下方法关闭页码

\nopagenumbers{}

但这就是我所能做的。

我努力了

\pagenumbers{plain}

导致错误的原因:

)) (./moderncvcolorblue.sty)
./main.tex:24:Undefined control sequence.
<recently read> \pagenumbers

l.24 \pagenumbers
    {Plain}
uncomment to sup....%
?

我还查看了 moderncvcolorblue.sty 文件,没有发现任何以任何方式指示页码的内容。我搜索的其他 sty 文件也是如此。

请问您对如何修改页码样式有什么想法吗?

非常感谢。

答案1

我不知道为什么,但我没有打印页码(尽管它们应该在那里)。

有关此问题的参考,请参阅MacTeX 2014 上 moderncv 包的页码不显示

我认为您有一些包裹比我的还要旧。

无论如何,为了使数字具有您想要的样式moderncv,请在序言中添加以下几行:

\nopagenumbers
\AtEndPreamble{%
  \AtBeginDocument{%
          \newlength{\pagenumberwidth}%
          \settowidth{\pagenumberwidth}{\color{color2}\addressfont\itshape\thepage}%
          \fancypagestyle{plain}{%
            \fancyfoot[r]{\parbox[b]{\pagenumberwidth}{\color{color2}\pagenumberfont\thepage}}}
          \pagestyle{plain}}}

MWE(模板摘录)

\documentclass[11pt,a4paper,sans]{moderncv}

\usepackage[utf8]{inputenc}

\moderncvstyle{casual}                             % style options are 'casual' (default), 'classic', 'oldstyle' and 'banking'
\moderncvcolor{blue}                               % color options 'blue' (default), 'orange', 'green', 'red', 'purple', 'grey' and 'black'


% 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[twitter]{jdoe}                             % optional, remove / comment the line if not wanted
\social[github]{jdoe}                              % optional, remove / comment the line if not wanted
\extrainfo{additional information}                 % optional, remove / comment the line if not wanted

\nopagenumbers
\AtEndPreamble{%
  \AtBeginDocument{%
          \newlength{\pagenumberwidth}%
          \settowidth{\pagenumberwidth}{\color{color2}\addressfont\itshape\thepage}%
          \fancypagestyle{plain}{%
            \fancyfoot[r]{\parbox[b]{\pagenumberwidth}{\color{color2}\pagenumberfont\thepage}}}
          \pagestyle{plain}}}


\begin{document}

\makecvtitle

\section{Education}
\cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{Description}  % 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{Language 2}{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\cite{book1}}
\cvlistdoubleitem{Item 3}{Item 6. Like item 3 in the single column list before, this item is particularly long to wrap over several lines.}

\end{document} 

输出:

在此处输入图片描述

答案2

在标准休闲模板中没有页码。无论如何,您可以通过输入

\fancyfoot[r]{\thepage}

紧接着\begin{document}。这将在右下角打印页码。

示例输出

\documentclass[11pt,a4paper,sans]{moderncv} 

\moderncvstyle{casual}  

\usepackage[utf8]{inputenc} 
\usepackage[scale=0.75]{geometry}

\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-a}               
\quote{Some quote}                                 

\usepackage{lipsum}

\begin{document}
\fancyfoot[r]{\thepage}
\makecvtitle

\section{Education}
\cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{Description}  
\cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{Description}

\lipsum[1-20]
\end{document}

相关内容