我对 Latex 还不太熟悉,而且对 tikz 软件包也不太熟悉。我正在制作一个自动简历生成器,它可以打印一个人的技能以及进度条。这个技能树实际上是一个成长环境,取决于一个人想在简历上列出多少技能。
我面临的问题是,当技能树到达页面底部时,tikzpicture 环境不会自动插入分页符。因此,技能树不会自动继续下一页。
相反,页面底部以下的所有 tikzpicture 都会消失。我怎样才能让这个不断增长的技能树进入下一页?
我的 MWE:
类文件:
\ProvidesClass{CV_Tool}
\LoadClass{article}
\NeedsTeXFormat{LaTeX2e}
%----------------------------------------------------------------------------------------
% REQUIRED PACKAGES
%----------------------------------------------------------------------------------------
\RequirePackage[sfdefault]{ClearSans}
\RequirePackage[T1]{fontenc}
\RequirePackage{tikz}
\RequirePackage{xcolor}
\RequirePackage[absolute,overlay]{textpos}
\RequirePackage{ragged2e}
\RequirePackage{etoolbox}
\RequirePackage{ifmtarg}
\RequirePackage{ifthen}
\RequirePackage{pgffor}
\RequirePackage{marvosym}
\RequirePackage{parskip}
\RequirePackage{color}
\RequirePackage{graphicx}
%----------------------------------------------------------------------------------------
% COLOURS
%----------------------------------------------------------------------------------------
\definecolor{white}{RGB}{255,255,255}
\definecolor{sidecolor}{HTML}{E7E7E7}
\definecolor{main}{HTML}{0E5484}
\definecolor{barshade}{HTML}{B9B9B9}
%----------------------------------------------------------------------------------------
% MISC CONFIGURATIONS
%----------------------------------------------------------------------------------------
\newlength{\TotalSectionLength} % Define a new length to hold the remaining line width after the section title is printed
\newlength{\SectionTitleLength} % Define a new length to hold the width of the section title
\newcommand{\profilesection}[1]{%
\setlength\TotalSectionLength{\linewidth} % Set the total line width
\settowidth{\SectionTitleLength}{\huge #1 } % Calculate the width of the section title
\addtolength\TotalSectionLength{-\SectionTitleLength} % Subtract the section title width from the total width
\addtolength\TotalSectionLength{-2.22221pt} % Modifier to remove overfull box warning
\vspace{8pt} % Whitespace before the section title
{\color{black!80} \huge #1 \rule[0.15\baselineskip]{\TotalSectionLength}{1pt}} % Print the title and auto-width rule
}
%----------------------------------------------------------------------------------------
% SKILL PROGRESS BARS
%----------------------------------------------------------------------------------------
% Command for printing skill progress bars
\newcommand\skills[1]{
\renewcommand{\skills}{
\begin{tikzpicture}[scale=1]
\foreach [count=\i] \x/\y in {#1}{
\draw[fill=barshade,barshade] (0,\i) rectangle (6,\i+0.4);
\draw[fill=white,main](0,\i) rectangle (\y,\i+0.4);
\large
\node [above right] at (-0.15,\i+0.3) {\x};
}
\end{tikzpicture}
}
}
% Command for printing skills text
\newcommand\skillstext[1]{
\renewcommand{\skillstext}{
\begin{flushleft}[scale=1]
\foreach [count=\i] \x/\y in {#1}{
\x$ \star $\y
}
\end{flushleft}
}
}
%----------------------------------------------------------------------------------------
% SIDEBAR LAYOUT
%----------------------------------------------------------------------------------------
\newcommand{\makeprofile}{
\begin{textblock}{6}(0.5, 0.2)
\profilesection{Skills}
\skills
\skillstext
\scriptsize
%------------------------------------------------
\end{textblock}
}
.tex 文件:
\documentclass[a4paper]{CV_Tool}
\begin{document}
%----------------------------------------------------------------------------------------
% SKILLS
%----------------------------------------------------------------------------------------
\skills{
{Coaching/3}, %{<Skill>/{<value between 0 and 6>
{consulting/3}, %{<Skill>/{<value between 0 and 6>
{aerodynamics/3}, %{<Skill>/{<value between 0 and 6>
{python/3}, %{<Skill>/{<value between 0 and 6>
{matlab/3}, %{<Skill>/{<value between 0 and 6>
{flow/3}, %{<Skill>/{<value between 0 and 6>
{stress/3}, %{<Skill>/{<value between 0 and 6>
{engineering/3}, %{<Skill>/{<value between 0 and 6>
{Business Strategy/4}, %{<Skill>/{<value between 0 and 6>
{Outsourcing/4}, %{<Skill>/{<value between 0 and 6>
{Change Management/4.5}, %{<Skill>/{<value between 0 and 6>
{Management Consulting/5}, %{<Skill>/{<value between 0 and 6>
{Interim Management/5.5}, %{<Skill>/{<value between 0 and 6>
{Operations Management/5.5}, %{<Skill>/{<value between 0 and 6>
{Business Strategy/4}, %{<Skill>/{<value between 0 and 6>
{Outsourcing/4}, %{<Skill>/{<value between 0 and 6>
{Change Management/4.5}, %{<Skill>/{<value between 0 and 6>
{Management Consulting/5}, %{<Skill>/{<value between 0 and 6>
{Outsourcing/4}, %{<Skill>/{<value between 0 and 6>
{Change Management/4.5}, %{<Skill>/{<value between 0 and 6>
{Management Consulting/5}, %{<Skill>/{<value between 0 and 6>
{Interim Management/5.5}, %{<Skill>/{<value between 0 and 6>
{Operations Management/5.5}, %{<Skill>/{<value between 0 and 6>
{Business Strategy/4}, %{<Skill>/{<value between 0 and 6>
{Outsourcing/4}, %{<Skill>/{<value between 0 and 6>
{Change Management/4.5}, %{<Skill>/{<value between 0 and 6>
{Management Consulting/5}, %{<Skill>/{<value between 0 and 6>
{Interim Management/5.5}, %{<Skill>/{<value between 0 and 6>
{Operations Management/5.5}, %{<Skill>/{<value between 0 and 6>
{ICT/5.5}} %{<Skill>/{<value between 0 and 6>
\makeprofile % Print the sidebar
\end{document}
谢谢!如果需要进一步说明,请通知我。
答案1
这是一个部分解决方案。它定义了一个新skills
命令,将每个技能绘制为不同的tikzpicture
行,并在页面末尾中断。它不使用原始的 .cls。
\documentclass{article}
\usepackage{tikz}
\definecolor{white}{RGB}{255,255,255}
\definecolor{sidecolor}{HTML}{E7E7E7}
\definecolor{main}{HTML}{0E5484}
\definecolor{barshade}{HTML}{B9B9B9}
\newcommand{\skills}[1]{
\foreach \i/\j in {#1}{%
\noindent
\begin{tikzpicture}
\draw[fill=barshade,barshade] (0,0) rectangle ++(6,.4);
\draw[fill=white,main] (0,0) rectangle ++(\j,.4);
\node[font=\large, above right] at (-.15,.3){\i};
\end{tikzpicture}\\}}
\begin{document}
\skills{
{Coaching/3}, %{<Skill>/{<value between 0 and 6>
{consulting/3}, %{<Skill>/{<value between 0 and 6>
{aerodynamics/3}, %{<Skill>/{<value between 0 and 6>
{python/3}, %{<Skill>/{<value between 0 and 6>
{matlab/3}, %{<Skill>/{<value between 0 and 6>
{flow/3}, %{<Skill>/{<value between 0 and 6>
{stress/3}, %{<Skill>/{<value between 0 and 6>
{engineering/3}, %{<Skill>/{<value between 0 and 6>
{Business Strategy/4}, %{<Skill>/{<value between 0 and 6>
{Outsourcing/4}, %{<Skill>/{<value between 0 and 6>
{Change Management/4.5}, %{<Skill>/{<value between 0 and 6>
{Management Consulting/5}, %{<Skill>/{<value between 0 and 6>
{Interim Management/5.5}, %{<Skill>/{<value between 0 and 6>
{Operations Management/5.5}, %{<Skill>/{<value between 0 and 6>
{Business Strategy/4}, %{<Skill>/{<value between 0 and 6>
{Outsourcing/4}, %{<Skill>/{<value between 0 and 6>
{Change Management/4.5}, %{<Skill>/{<value between 0 and 6>
{Management Consulting/5}, %{<Skill>/{<value between 0 and 6>
{Outsourcing/4}, %{<Skill>/{<value between 0 and 6>
{Change Management/4.5}, %{<Skill>/{<value between 0 and 6>
{Management Consulting/5}, %{<Skill>/{<value between 0 and 6>
{Interim Management/5.5}, %{<Skill>/{<value between 0 and 6>
{Operations Management/5.5}, %{<Skill>/{<value between 0 and 6>
{Business Strategy/4}, %{<Skill>/{<value between 0 and 6>
{Outsourcing/4}, %{<Skill>/{<value between 0 and 6>
{Change Management/4.5}, %{<Skill>/{<value between 0 and 6>
{Management Consulting/5}, %{<Skill>/{<value between 0 and 6>
{Interim Management/5.5}, %{<Skill>/{<value between 0 and 6>
{Operations Management/5.5}, %{<Skill>/{<value between 0 and 6>
{ICT/5.5}} %{<Skill>/{<value between 0 and 6>
\end{document}