修改 friggeri-cv 中 tikz-kaviat 图的缩进

修改 friggeri-cv 中 tikz-kaviat 图的缩进

我正在尝试使用 friggeri CV 模板,并使用 tikz-kaviat 在 CV 的最左侧添加 kaviat 图。问题是对齐效果一点也不好,而且我无法使用 更改它/noidentation。结果如下:

结果

代码如下:

  \section{Programming}
  \begin{tikzpicture}[scale=.5]
    \tkzKiviatDiagram[lattice=5]{C,Matlab,Python,Bash,Lisp,LaTex,HTML/CSS}
    \end{tikzpicture}
如何改变它以便图表更加位于文档的左侧?

非常感谢您的耐心和帮助。

答案1

您可以使用各种方法来tikzpicture向左移动。通常,您还可以指定移位(或 xshift/yshift),tikzpicture但这似乎在该文档类和图片位置中效果不佳(至少对我来说)。

在所有情况下,我给出的尺寸都是任意的(因为我在 Overleaf 中尝试过它们,并且认为它们在默认模板中看起来不错)。看来您修改了字体和其他内容...因此这些值可能需要调整!

最简单的版本可能是放在\hspace*{-1.2cm}紧前面\begin{tikzpicture}[scale=0.5](即\hspace*{-1.2cm}\begin{tikzpicture}[scale=0.5]%)。或者,如果你想将它们放在不同的行上:

\hspace*{-1.2cm}%
\begin{tikzpicture}[scale=0.5]%

另一个选择是将\makebox其包裹起来:

\makebox[3.6cm][c]{...tikz here...}

还可以考虑尝试各种\tkzKiviatDiagram选项gap,,,,,,并且可以稍微减少。latticespacesteplabel spacetikzpicture scale

最后,考虑重新排列网格上的语言。Matlab、Python 和 HTML/CSS(尤其是后者)是最后一个最长的字符串……它们将在右侧进一步重叠。相反,尝试将它们放在左侧位置,并在最右侧位置使用较短的字符串(例如 C、Bash、Lisp)。例如,\tkzKiviatDiagram[lattice=5]{Lisp,C,LaTex,Python,Matlab,HTML/CSS,Bash}%

工作示例:

尽管包含起来相当冗长,但类文件和模板将来可能不再可用。因此,我已从文件中删除了尽可能多的空间cls并从.tex文件中删除了内容,以便展示我上述建议的“实际效果”。

cv-style.cls

% -- Encoding UTF-8 without BOM
\ProvidesClass{cv-style}[2015/02/27 CV class]
\NeedsTeXFormat{LaTeX2e}
%
\DeclareOption{espanol}{\def\@cv@espanol{}}
\DeclareOption{print}{\def\@cv@print{}}
\DeclareOption*{%
  \PassOptionsToClass{\CurrentOption}{article}%
}
\ProcessOptions\relax
\LoadClass{article}
%---------------------------------------------------------------------------------
% Colors %
%---------------------------------------------------------------------------------
\RequirePackage{xcolor}
\definecolor{white}{RGB}{255,255,255}
\definecolor{darkgray}{HTML}{333333}
\definecolor{gray}{HTML}{4D4D4D}
\definecolor{lightgray}{HTML}{999999}
\definecolor{blue}{HTML}{66D9EE}
\definecolor{red}{HTML}{FA2772}
\definecolor{orange}{HTML}{FE9720}
\definecolor{green}{HTML}{A7E22E}
\definecolor{purple}{HTML}{9358FE}
\definecolor{aquamarine}{HTML}{36AF90}
\definecolor{date}{HTML}{A4A4A4}
%
\ifdefined\@cv@print
  \colorlet{blue}{gray}
  \colorlet{red}{gray}
  \colorlet{orange}{gray}
  \colorlet{green}{gray}
  \colorlet{purple}{gray}
  \colorlet{aquamarine}{gray}
  \colorlet{fillheader}{white}
  \colorlet{header}{gray}
\else
  \colorlet{fillheader}{gray}
  \colorlet{header}{white}
\fi
\colorlet{textcolor}{gray}
\colorlet{headercolor}{gray}
%
%---------------------------------------------------------------------------------
% Fonts %
%---------------------------------------------------------------------------------
\RequirePackage[quiet]{fontspec}
\RequirePackage[math-style=TeX,vargreek-shape=unicode]{unicode-math}
%
\newfontfamily\bodyfont{Roboto-Regular}[Path=fonts/]
\newfontfamily\bodyfontit{Roboto-LightItalic}[Path=fonts/]
\newfontfamily\thinfont{Roboto-Thin}[Path=fonts/]
\newfontfamily\headingfont{RobotoCondensed-Bold}[Path=fonts/]
%
\defaultfontfeatures{Mapping=tex-text}
\setmainfont[Mapping=tex-text, Color=textcolor, Path = fonts/]{Roboto-Light}
%
\newcommand{\italica}[1]{%
    {\color{gray}\bodyfontit #1}%
}
%
%---------------------------------------------------------------------------------
% Header %
%---------------------------------------------------------------------------------
\RequirePackage{tikz}
%
\newcommand{\header}[2]{%
  \begin{tikzpicture}[remember picture,overlay]
    \node [rectangle, fill=fillheader, anchor=north, minimum width=\paperwidth, minimum height=2cm] (box) at (current page.north){};
    \node [anchor=center] (name) at (box) {%
      \fontsize{40pt}{65pt}\color{header}%
      {\thinfont #1}{\bodyfont  #2}
    };
  \end{tikzpicture}
  \vspace{1cm}
  \vspace{-2\parskip}
}
%
%---------------------------------------------------------------------------------
%   Last updated command %
%---------------------------------------------------------------------------------
\RequirePackage[absolute,overlay]{textpos}
\RequirePackage{polyglossia}
%
\newcommand{\sethyphenation}[3][]{%
  \sbox0{\begin{otherlanguage}[#1]{#2}
    \hyphenation{#3}\end{otherlanguage}}}
%
\ifdefined\@cv@espanol
  \setdefaultlanguage{spanish}
  \def\lastupdatedtext{Última Actualización el}
\else
  \setdefaultlanguage[variant=british]{english}
  \def\lastupdatedtext{Last Updated on}
\fi
%
\setlength{\TPHorizModule}{0.01\paperwidth}
\setlength{\TPVertModule}{0.01\paperwidth}
%
\newcommand{\lastupdated}{ 
  \begin{textblock}{10}(11.3, 0.05)
    \raggedleft
    \fontsize{8pt}{10pt}\color{date}\thinfont 
    \lastupdatedtext{} \today
  \end{textblock}}
%---------------------------------------------------------------------------------
% Structure %
%---------------------------------------------------------------------------------
\RequirePackage{parskip}
%
\newcounter{colorCounter}
\def\@sectioncolor#1#2#3{%
  {%
    \color{%
      \ifcase\value{colorCounter}%
        blue\or%
        red\or%
        orange\or%
        green\or%
        purple\or%
        aquamarine\else%
        headercolor\fi%
    } #1#2#3%
  }%
  \stepcounter{colorCounter}%
}
%
\renewcommand{\section}[1]{
  {\par\vspace{\parskip}
  {%
    \LARGE\headingfont\color{headercolor}%
    \@sectioncolor #1%
  }
  \par\vspace{\parskip}}
}
%
\renewcommand{\subsection}[2]{
  \par\vspace{.5\parskip}%
  \Large\headingfont\color{headercolor} #2%
  \par\vspace{.25\parskip}%
}
%
\newcommand{\jobtitle}[1]{%
    {\color{gray}\bodyfontit #1}%
}
%
\pagestyle{empty}
%----------------------------------------------------------------------------------------
% List environment %
%---------------------------------------------------------------------------------
\setlength{\tabcolsep}{0pt}
\newenvironment{entrylist}{%
  \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}ll}
}{%
  \end{tabular*}
}
\renewcommand{\bfseries}{\headingfont\color{headercolor}}
\newcommand{\entry}[4]{%
  #1&\parbox[t]{12.8cm}{%
    \textbf{#2}%
    \hfill%
    {\footnotesize\addfontfeature{Color=lightgray} #3}\\%
    #4\vspace{\parsep}%
  }\\}
%---------------------------------------------------------------------------------
% Side block %
%---------------------------------------------------------------------------------
\setlength{\TPHorizModule}{1cm}
\setlength{\TPVertModule}{1cm}
\newenvironment{aside}{%
  \let\oldsection\section
  \renewcommand{\section}[1]{
    \par\vspace{\baselineskip}{\Large\headingfont\color{headercolor} ##1}
  }
  \begin{textblock}{3.6}(1, 1.87)
  \begin{flushright}
  \obeycr
}{%
  \restorecr
  \end{flushright}
  \end{textblock}
  \let\section\oldsection
}
%---------------------------------------------------------------------------------
% Other tweaks %
%---------------------------------------------------------------------------------
\RequirePackage[left=5.6cm,top=1cm,right=1cm,bottom=1cm,nohead,nofoot]{geometry}
\RequirePackage{hyperref}
\hypersetup{
    pdftitle=CV/Resume \textbar{} Alejandro Pérez Londoño,
    pdfauthor=Alejandro Pérez Londoño,
    pdfsubject=CV/Resume%
    }

主文本

% -- Encoding UTF-8 without BOM
% -- XeLaTeX => PDF (BIBER)
\documentclass[]{cv-style}
%
\sethyphenation[variant=british]{english}{}%
%
\usepackage{tkz-kiviat}
\usetikzlibrary{arrows}
%
\begin{document}
%
\header{John}{Smith}
\lastupdated
%
\begin{aside}
%
\section{contact}
123 Broadway
City, State 050022
Country
~
+0 (000) 111 1111
+0 (000) 111 1112
~
[email protected]
%
\section{languages}
English mother tongue
Spanish fluency
%
\section{programming}
\hspace*{-1.2cm}%
\begin{tikzpicture}[scale=0.5]%
    \tkzKiviatDiagram[lattice=5,]{Lisp,C,LaTex,Python,Matlab,HTML/CSS,Bash}%
\end{tikzpicture}
~
{\color{red} $\varheartsuit$} R
VBA, SQL, Python
\LaTeX{}
%
\end{aside}
%
\section{skills}
\vspace{-0.2cm}
Skill 1, skill 2, skill 3, skill 4, skill 5.
%
\section{experience}
\begin{entrylist}
\entry
  {2014--Now}
  {COMPANY 3}
  {City, Country}
  {\jobtitle{Job Title}\\
  Job description. Job description. Job description. Job description. Job description. Job description. Job description. Job description. Job description. Job description. Job description.}
\entry
  {2011--2014}
  {COMPANY 2}
  {City, Country}
  {\jobtitle{Job Title}\\
  Job description. Job description. Job description. Job description. Job description. Job description. Job description. Job description. Job description. Job description.\\
  Detailed achievements:
  \begin{itemize}
    \item Achievement 1. Achievement 1. Achievement 1. 
    \item Achievement 2. Achievement 2. Achievement 2. Achievement 2. Achievement 2. Achievement 2.
    \item Achievement 3. Achievement 3. Achievement 3. Achievement 3.  
  \end{itemize}}
\entry
  {2008--2011}
  {COMPANY 1}
  {City, Country}
  {\jobtitle{Job Title}\\
  Job description. Job description. Job description. Job description. Job description. Job description. Job description. Job description. Job description. Job description.\\
  Detailed achievements:
  \begin{itemize}
    \item Achievement 1. Achievement 1. Achievement 1. Achievement 1. Achievement 1. Achievement 1. Achievement 1. Achievement 1. 
  \end{itemize}}
\end{entrylist}
\end{document}

\tkzKiviatDiagram 位置变化 v1

另一个版本大致相同:

\makebox[3.6cm][c]{%
\begin{tikzpicture}[scale=0.5]
    \tkzKiviatDiagram[lattice=5]{Lisp,C,LaTex,Python,Matlab,HTML/CSS,Bash}
\end{tikzpicture}}

另外,我遇​​到了几个相同的错误(LaTeX Error: Something's wrong--perhaps a missing \item.)——在 Overleaf 中仍然可以编译。我发现\begin{aside}...\end{aside}(左侧边栏)使用了\obeycr...\restorecr。因此,您需要在%的每一行末尾使用tikzpicture,换句话说:

\hspace*{-1.2cm}%
\begin{tikzpicture}[scale=0.5]%
    \tkzKiviatDiagram[lattice=5,]{Lisp,C,LaTex,Python,Matlab,HTML/CSS,Bash}%
\end{tikzpicture}

不是

\hspace*{-1.2cm}%
\begin{tikzpicture}[scale=0.5]
    \tkzKiviatDiagram[lattice=5,]{Lisp,C,LaTex,Python,Matlab,HTML/CSS,Bash}
\end{tikzpicture}

相关内容