定义包含一年的分数的时间线会出错

定义包含一年的分数的时间线会出错

按照给出的例子这里,我自己实现了它,以便将其用于我的简历。但是,当我使用一年的分数作为职业结束时,我确实遇到了问题。这意味着,每当我使用

\tllabelcventry{2012.667}{2014.667} %
{09/2012--11/2014} %
{Position}{Company}{Location}{} %
{Job Description}

它不起作用,但当用替换结尾时2014.6672014进程正常退出。否则它会失败并出现错误

`!' 缺少为 \ifnum 插入的 =。

% !TeX spellcheck = en_GB

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

% moderncv themes
\moderncvstyle{classic} 
\moderncvcolor{grey}
%timeline implementation
\usepackage[firstyear=2005,lastyear=2016]{moderntimeline}
\makeatletter
\tikzset{
    tl@startyear/.append style={
        xshift=(0.5-\tl@startfraction)*\hintscolumnwidth,
        anchor=base
    }
}
\makeatother

\usepackage{lmodern}
%\renewcommand{\rmdefault}{lmss}
% character encoding
\usepackage[english,ngerman]{babel}
\usepackage[latin1]{inputenc}  
             % replace by the encoding you are using
\usepackage{multicol}
% adjust the page margins
\usepackage[scale=0.8]{geometry}
\usepackage{graphicx}
\setlength{\hintscolumnwidth}{3cm}                      % if you want to change the width of the column with the dates

\firstname{firstname}

\familyname{lastname}
\title{Curriculum Vitae}    

\begin{document}

\makecvtitle

\tllabelcventry{2012.667}{2014} %
{09/2012--11/2014} %
{Position}{Company}{Location}{} %
{Job Description}

\end{document}

答案1

moderntimeline请检查当前( )的文档texdoc moderntimeline。自您链接的问题提出之日起,该软件包已发生更改...在第 3 页的文档中,您将找到:

您还可以指定月份(仅用于调整条形长度:它们不会显示在标签中),用斜线与年份分隔

结论:不要使用year.decimal,只能使用year/month

以下代码可以编译:

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

% moderncv themes
\moderncvstyle{classic} 
\moderncvcolor{grey}

%timeline implementation
\usepackage[firstyear=2005,lastyear=2016]{moderntimeline}
\makeatletter
\tikzset{
    tl@startyear/.append style={
        xshift=(0.5-\tl@startfraction)*\hintscolumnwidth,
        anchor=base
    }
}
\makeatother

\usepackage{lmodern}
%\renewcommand{\rmdefault}{lmss}
% character encoding
\usepackage[english,ngerman]{babel}
\usepackage[latin1]{inputenc}  
             % replace by the encoding you are using
\usepackage{multicol}
% adjust the page margins
\usepackage[scale=0.8]{geometry}
\usepackage{graphicx}
\setlength{\hintscolumnwidth}{3cm}                      % if you want to change the width of the column with the dates

\firstname{firstname}

\familyname{lastname}
\title{Curriculum Vitae}    


\begin{document}

\makecvtitle

\tllabelcventry{2012.667}{2014} %
{09/2012--11/2014} %
{Position}{Company}{Location}{} %
{Job Description}

\tllabelcventry{2012/9}{2014/11} % <====================================
{09/2012--11/2014} %
{Position}{Company}{Location}{} %
{Job Description}

%\tllabelcventry{2012.667}{2014.667} % <================== wrong syntax!
%{09/2012--11/2014} %
%{Position}{Company}{Location}{} %
%{Job Description}

\end{document}

结果如下:

mwe 的结果

相关内容