如何在自定义课程模板中调整文本

如何在自定义课程模板中调整文本

我从 Overleaf 商店下载了以下模板https://www.overleaf.com/latex/templates/a-customised-curve-cv/mvmbhkwsnmwv(定制曲线)。

我修改了模板的第一部分:“关于我”中的“工作经历”,我想调整此部分中的文字。

具体来说,我要证明的部分结构如下:

\begin{rubric}{About Me}
 Some long text
\end{rubric}

这是与 settings.sty 相关的文件:

%%%%%%%%%%%%%%%
% This CV example/template is based on my own
% CV which I (lamely attempted) to clean up, so that
% it's less of an eyesore and easier for others to use.
%
% LianTze Lim ([email protected])
% 23 Oct, 2022
%

\RequirePackage{silence}
\WarningsOff[longtable]
\WarningsOff[array]

\usepackage{ifxetex,ifluatex}
\newif\ifxetexorluatex
\ifxetex
  \xetexorluatextrue
\else
  \ifluatex
    \xetexorluatextrue
  \else
    \xetexorluatexfalse
  \fi
\fi

\RequirePackage{graphicx}
\RequirePackage[hyphens]{url}
\RequirePackage{babel}
\raggedright

\RequirePackage[fixed]{fontawesome5}

\newcommand{\smallcaps}[1]{\textsc{\lowercase{#1}}}

\RequirePackage[a4paper,nohead,nofoot,hmargin=2.25cm,vmargin=2cm]{geometry}
\RequirePackage{relsize}
\RequirePackage[dvipsnames,svgnames]{xcolor}
\RequirePackage{tikz}
\usetikzlibrary{shapes,shadows}

\RequirePackage{comment}
\definecolor{SwishLineColour}{HTML}{88AC0B}
\definecolor{MarkerColour}{HTML}{B6073F}

% If you're not a researcher nor an academic, you probably don't need biblatex; delete this line.
\RequirePackage{biblatex}
\RequirePackage{csquotes}

\RequirePackage{tikz}
\newcommand*\circled[1]{\tikz[baseline=(char.base)]{
   \node[shape=circle,text=white,fill=MarkerColour!80!black,font=\sffamily\scriptsize\bfseries,inner sep=1pt,text height=1.35ex,minimum width=1.5em,text centered] (char) {#1};}}
   
\newcounter{bibitem}
\AtBeginBibliography{\setcounter{bibitem}{1}}
\iffieldformatundef{labelnumberwidth}{%
  % if author-year style
  \AtEveryBibitem{\makebox[2.5em][l]{\circled{\thebibitem}\stepcounter{bibitem}}}%
}{%
  % if numeric style
  \DeclareFieldFormat{labelnumberwidth}{\makebox[2.5em][l]{\circled{\thebibitem}}}%
  \setlength{\biblabelsep}{0pt}%
  \AtEveryBibitem{\stepcounter{bibitem}}%
}
\AtEveryBibitem{\iffieldundef{doi}{}{\clearfield{url}}}

% \renewcommand{\bibfont}{\small}
\setlength{\bibitemsep}{1.5ex}
\setlength{\bibhang}{2.5em}
\RequirePackage{xpatch}
\xpretofieldformat{doi}
  {\textcolor{MarkerColour!80!black}{\scriptsize\faLink}}
  {}{}
\xpretofieldformat{url}
  {\textcolor{MarkerColour!80!black}{\scriptsize\faLink}}
  {}{}

\headerscale{1}
%\setlength{\headerspace}{6pt}
\rubricfont{\Large\bfseries\sffamily}
\setlength{\rubricspace}{2pt}
%\setlength{\rubricafterspace}{-9pt}
\setlength{\rubricafterspace}{-3pt}
\setlength{\subrubricspace}{3pt}
\setlength{\subrubricbeforespace}{4pt}
\def\@@rubrichead#1{%
  \begin{tikzpicture}[baseline]%\
  \shade[left color=SwishLineColour!60!white,left, color=white] rectangle (\@almosttextwidth,2.5pt);
  \node[font={\@rubricfont},inner sep=0pt,text ragged,anchor=south west,text depth=.5ex,text height=1.5ex] at (1pt,2pt) {#1};
  \end{tikzpicture}%
  \vspace\rubricspace%
}

\subrubricfont{\large\bfseries\sffamily}
\subrubricalignment{l}

\newcommand{\makefield}[2]{\makebox[1.5em]{\color{MarkerColour!80!black}#1} #2\hspace{2em}}

\keyalignment{l}
\rubricalignment{l}
\renewcommand{\arraystretch}{1.25}
\urlstyle{tt}

\newcommand{\prefixmarker}[1]{\def\@prefixmarker{#1}}
\def\@prefixmarker{\relscale{.9}\faBookmark}

\prefix{%
  \hspace*{-1ex}
  \color{MarkerColour!80!black}\@prefixmarker%
  \hspace*{1ex}%
}

\newcommand{\makerubrichead}[1]{\vskip\baselineskip\@@rubrichead{#1}}

\defbibheading{subbibliography}{\vskip\subrubricbeforespace{\@subrubricfont\hspace{3pt}#1}\par}

\defbibfilter{booksandchapters}{%
( type=book or type=incollection )
}

\RequirePackage{pgffor}
\newcommand{\mynames}[1]{\def\my@namelist{#1}}
\newtoggle{boldname}
\renewcommand*{\mkbibnamefamily}[1]{%
  \global\togglefalse{boldname}%
  \foreach \my@fname / \my@gname in \my@namelist {%
    \ifboolexpr{ test {\ifdefstrequal{\namepartfamily}{\my@fname}}
                 and
                 test {\ifdefstrequal{\namepartgiven}{\my@gname}}}
      {\global\toggletrue{boldname}}{}%
  }%
  \iftoggle{boldname}{\textbf{#1}}{#1}%
}

\renewcommand*{\mkbibnamegiven}[1]{%
  \global\togglefalse{boldname}%
  \foreach \my@fname / \my@gname in \my@namelist{%
    \ifboolexpr{ test {\ifdefstrequal{\namepartfamily}{\my@fname}}
                 and
                 test {\ifdefstrequal{\namepartgiven}{\my@gname}}}
      {\global\toggletrue{boldname}\breakforeach}{}%
  }%
  \iftoggle{boldname}{\textbf{#1}}{#1}%
}


\RequirePackage[colorlinks=true,allcolors=black,breaklinks=true]{hyperref}
\usepackage{ragged2e}
\usepackage{settings} % last <<<<<<<<<<<<<<

我尝试了不同的解决方案,但都没有成功。特别是,我还将行“\keyalignment{r}”修改为“\keyalignment{l}”,但此修改的唯一效果是对齐方式从右变为左。

如何修复它?

答案1

文档第 9 页纯文本条目状态:

\文本 {<内容>}

有时,您可能觉得需要在标题中间插入纯文本,而不需要花哨的键/前缀格式设置。从 1.16 版开始,CurVe 提供了一个 \text 宏来实现这一点。纯文本占据整个页面宽度。如果您希望进一步将其与周围的条目区分开来,可以使用 \par 在文本之前和/或之后添加垂直空间。

似乎你应该将独立文本包含在内\text{...},即

\begin{rubric}{About Me}
\text{About you ...}
\end{rubric}

这应该会产生您所期望的效果。

附注:此类的工作方式是创建一个额外的文件,例如,aboutme.tex该文件应包含上述代码。然后添加以下行

\makerubric{aboutme}

在主文件中。

相关内容