我正在使用 CurVe 包处理 LaTeX 文档,以创建显示信息的规则。我希望规则条目键值在指定的位置换行,但是,我很难找到实现此目的的方法。
当前外观如下。我希望 2023 年 6 月 - 2023 年 9 月的文本能够换行并放在不同的行上,因为它占用了页面中太多的水平空间。
设置.sty:
\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}{RGB}{0,0,0}
\definecolor{MarkerColour}{HTML}{B6073F}
\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};}}
\headerscale{1}
%\setlength{\headerspace}{6pt}
\rubricfont{\Large\bfseries\sffamily}
\setlength{\rubricspace}{2pt}
%\setlength{\rubricafterspace}{-9pt}
\subrubricfont{\large\bfseries\sffamily}
\subrubricalignment{l}
\newcommand{\makefield}[2]{\makebox[1.5em]{\color{MarkerColour!80!black}#1} #2\hspace{1em}}
\keyalignment{r}
\rubricalignment{l}
\renewcommand{\arraystretch}{1.25}
\urlstyle{tt}
\newcommand{\prefixmarker}[1]{\def\@prefixmarker{#1}}
\def\@prefixmarker{\relscale{.9}\faBookmark}
\prefix{%
\hspace*{-2.5ex}
\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}
emplyoment.tex:
\begin{rubric}{Employment History}
\entry*[June 2023 - Sept 2023]%
\textbf{Lecturer.} Information Technology Department, School of Engineering, Science and Technology, XYZ College.
%
\entry*[June 2022 - Sept 2022]%
\textbf{Lecturer.} Information Technology Department, School of Engineering, Science and Technology, XYZ College.
%
\end{rubric}
答案1
提示一下,在做一些花哨的事情...或者只是复制它们之前,尝试理解将要使用的文档类总是好的。
关于包装问题的答案就在曲线手册,第 15 页,Q5. 遵循以下建议也是不错的本课程简介。
要重现,只需创建这 4 个文件作为最小示例(MWE
)并进行编译。
- 在主序言中定义你自己的键盘字体
\makeatletter\let\mykeyfont\@keyfont\makeatother
- 因为 rubric 使用长表,因此用以下条目替换条目并观察括号:
\entry*[\multicolumn{1}{@{}>{\mykeyfont}p{5mm}} {2004 - 2008}]...
- 如手册中所述,即描述所使用的技巧
主文件 tut2b.tex:
\documentclass[a4paper]{curve}
\usepackage[nohead,hmargin=15mm,vmargin=15mm]{geometry}
\usepackage{lipsum}
\leftheader{Doja Cat\\\texttt{[email protected]}\\xyz drive\\Somewhere}
\rightheader{1 husband\\2 kids\\8 grammies}
\photo[r]{bild.png}
\title{Assistant Professor}
\subtitle{She a lil rebel}
\titlealignment{r}
\rubricalignment{cl}
% ~~~~~~~~~~~~~~~~~~~~~~~~~~~
\makeatletter\let\mykeyfont\@keyfont\makeatother
% ~~~~~~~~~~~~~~~~~~~~~~~~~~~
\begin{document}
\makeheaders[t]
\maketitle
\makerubric{experience2}
\makerubric{education1}
\end{document}
经验2.tex:
\begin{rubric}{Professional experience}
\subrubric{Research}
\entry*[2004 - \ldots] Meta programming
\subrubric{Lectures}
\entry*[2002 - \ldots] \textbf{Latex: an overview} (3 hours)
\entry*[\multicolumn{1}{@{}>{\mykeyfont}p{5mm}} {2004 - 2008}] \lipsum[4]
\end{rubric}
经验.tex:
\begin{rubric}{Education}
\subrubric{School}
\text{\hspace{3mm} Some text to try.\par}
\entry*[2000 - 2004] Schule des Lebens
\end{rubric}
图片:
结果:
请注意,手动调整对{..}只进行entry
一次,即其他(子)规则可能未对齐。