Latex 文档部分间距

Latex document sections spacing

我正在制作我的简历,我偶然发现了一个不错的模板,我开始用我的详细信息更新文档,但是我有一个问题,我的工作描述比初始模板文本长,所以我需要减少各部分之间的 space 并减少标题和文档其余部分之间的 space,这样所有内容都可以很好地放在一页中。

我已将模板上传到背面: https://www.overleaf.com/read/hktjxsfzpcfp

更具体地说:

  1. 我想减少标题 (developer-name) 和文档其余部分之间的 space。
  2. 减少气泡部分和我的体验部分之间的space。
  3. 减少 MyExperience 和 MyEducation 之间的 space。

任何帮助将不胜感激,谢谢!


更新:在此处添加代码以便于访问:

main.tex:

\documentclass[9pt]{developercv} % Default font size, values from 8-12pt are recommended

%----------------------------------------------------------------------------------------

\begin{document}

%----------------------------------------------------------------------------------------
%   TITLE AND CONTACT INFORMATION
%----------------------------------------------------------------------------------------

\begin{minipage}[t]{0.45\textwidth} % 45% of the page width for name
    \vspace{-\baselineskip} % Required for vertically aligning minipages
    
    % If your name is very short, use just one of the lines below
    % If your name is very long, reduce the font size or make the minipage wider and reduce the others proportionately
    \colorbox{black}{{\HUGE\textcolor{white}{\textbf{\MakeUppercase{Alyx}}}}} % First name
    
    \colorbox{black}{{\HUGE\textcolor{white}{\textbf{\MakeUppercase{Vance}}}}} % Last name
    
    \vspace{6pt}
    
    {\huge Web App Architect} % Career or current job title
\end{minipage}
\begin{minipage}[t]{0.275\textwidth} % 27.5% of the page width for the first row of icons
    \vspace{-\baselineskip} % Required for vertically aligning minipages
    
    % The first parameter is the FontAwesome icon name, the second is the box size and the third is the text
    % Other icons can be found by referring to fontawesome.pdf (supplied with the template) and using the word after \fa in the command for the icon you want
    \icon{MapMarker}{12}{Black Mesa East}\
    \icon{Phone}{12}{+1 123 456 789}\
    \icon{At}{12}{\href{mailto:alyx@vance.me}{alyx@vance.me}}\ 
\end{minipage}
\begin{minipage}[t]{0.275\textwidth} % 27.5% of the page width for the second row of icons
    \vspace{-\baselineskip} % Required for vertically aligning minipages
    
    % The first parameter is the FontAwesome icon name, the second is the box size and the third is the text
    % Other icons can be found by referring to fontawesome.pdf (supplied with the template) and using the word after \fa in the command for the icon you want
    \icon{Globe}{12}{\href{https://alyx.vance.me}{alyx.vance.me}}\
    \icon{Github}{12}{\href{https://github.com/alyxvance}{github.com/alyxvance}}\
    \icon{Twitter}{12}{\href{https://twitter.com/@alyxvance}{@alyxvance}}\
\end{minipage}

\vspace{0.5cm}

%----------------------------------------------------------------------------------------
%   INTRODUCTION, SKILLS AND TECHNOLOGIES
%----------------------------------------------------------------------------------------

\cvsect{Who Am I?}

\begin{minipage}[t]{0.4\textwidth} % 40% of the page width for the introduction text
    \vspace{-\baselineskip} % Required for vertically aligning minipages
    
    \lorem \lorem \lorem \lorem \lorem\ % Dummy text
\end{minipage}
\hfill % Whitespace between
\begin{minipage}[t]{0.5\textwidth} % 50% of the page for the skills bar chart
    \vspace{-\baselineskip} % Required for vertically aligning minipages
    \begin{barchart}{5.5}
        \baritem{JavaScript}{60}
        \baritem{PHP}{100}
        \baritem{SASS/LESS}{70}
        \baritem{Bootstrap}{70}
        \baritem{Git}{40}
        \baritem{LaTeX}{60}
    \end{barchart}
\end{minipage}

\begin{center}
    \bubbles{5/Eclipse, 6/git, 4/Office, 3/Inkscape, 3/Blender}
\end{center}

%----------------------------------------------------------------------------------------
%   EXPERIENCE
%----------------------------------------------------------------------------------------

\cvsect{Experience}

\begin{entrylist}
    \entry
        {2017 -- 3/2018}
        {Front-end developer}
        {Big Corporation Name Inc.}
        {\lorem \lorem \lorem\ \texttt{node.js}\slashsep\texttt{Vue.js}\slashsep\texttt{Electron}}
    \entry
        {2015 -- 2018\\footnotesize{part time}}
        {Full stack developer}
        {Famous Eshop Inc.}
        {\lorem\lorem\ \texttt{PHP}\slashsep\texttt{JS}\slashsep\texttt{MariaDB}\slashsep\texttt{Linux}}
    \entry
        {2013 -- 2014\\footnotesize{part time}}
        {Junior PHP Developer}
        {example.com}
        {\lorem\lorem\ \texttt{PHP}\slashsep\texttt{Laravel}}
\end{entrylist}

%----------------------------------------------------------------------------------------
%   EDUCATION
%----------------------------------------------------------------------------------------

\cvsect{Education}

\begin{entrylist}
    \entry
        {2013 -- 2017}
        {Master's Degree}
        {Another University Name}
        {\lorem\lorem\lorem}
    \entry
        {2014}
        {Postgraduate Diploma}
        {A University Name}
        {\lorem\lorem}
    \entry
        {2007 -- 2013}
        {Bachelor's Degree}
        {A University Name}
        {\lorem\lorem}
\end{entrylist}

%----------------------------------------------------------------------------------------
%   ADDITIONAL INFORMATION
%----------------------------------------------------------------------------------------

\begin{minipage}[t]{0.3\textwidth}
    \vspace{-\baselineskip} % Required for vertically aligning minipages

    \cvsect{Languages}
    
    \textbf{English} - native\
    \textbf{German} - proficient\
    \textbf{Polish} - rudimentary
\end{minipage}
\hfill
\begin{minipage}[t]{0.3\textwidth}
    \vspace{-\baselineskip} % Required for vertically aligning minipages
    
    \cvsect{Hobbies}
    
    I love... \lorem
\end{minipage}
\hfill
\begin{minipage}[t]{0.3\textwidth}
    \vspace{-\baselineskip} % Required for vertically aligning minipages
    
    \cvsect{Non profit}
    
    I help... \lorem
\end{minipage}

%----------------------------------------------------------------------------------------

\end{document}

developer.cls:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Developer CV
% LaTeX Class
% Version 1.0 (28/1/19)
%
% This class originates from:
% http://www.LaTeXTemplates.com
%
% Authors:
% Jan Vorisek (jan@vorisek.me)
% Based on a template by Jan Küster (info@jankuester.com)
% Modified for LaTeX Templates by Vel (vel@LaTeXTemplates.com)
%
% License:
% The MIT License (see included LICENSE file)
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%----------------------------------------------------------------------------------------
%   CLASS CONFIGURATION
%----------------------------------------------------------------------------------------

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{developercv}[2019/01/28 Developer CV class v1.0]

\DeclareOption*{\PassOptionsToClass{\CurrentOption}{extarticle}} % Pass through any options to the base class
\ProcessOptions\relax % Process given options

\LoadClass{extarticle} % Load the base class

%----------------------------------------------------------------------------------------
%   PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
%----------------------------------------------------------------------------------------

\setlength{\parindent}{0mm} % Suppress paragraph indentation

\usepackage[hidelinks]{hyperref} % Required for links but hide the default boxes around links

\newcommand{\lorem}{Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus.} % Dummy text

\pagestyle{empty} % No headers or footers

\usepackage{moresize} % Provides more font size commands (\HUGE and \ssmall)

%----------------------------------------------------------------------------------------
%   PAGE LAYOUT
%----------------------------------------------------------------------------------------

\usepackage{geometry} % Required for adjusting page dimensions and margins

\geometry{
    paper=a4paper, % Paper size, change to letterpaper for US letter size
    top=1.50cm, % Top margin (WAS 1.75cm)
    bottom=1.50cm, % Bottom margin (WAS 1.75cm)
    left=2cm, % Left margin
    right=2cm, % Right margin
    headheight=0.75cm, % Header height
    footskip=1cm, % Space from the bottom margin to the baseline of the footer
    headsep=0.5cm, % Space from the top margin to the baseline of the header
    %showframe, % Uncomment to show how the type block is set on the page
}

%----------------------------------------------------------------------------------------
%   FONTS
%----------------------------------------------------------------------------------------

\usepackage[utf8]{inputenc} % Required for inputting international characters
\usepackage[T1]{fontenc} % Output font encoding for international characters

\usepackage[default]{raleway}
%\usepackage[defaultsans]{droidsans}
%\usepackage{cmbright}
%\usepackage{fetamont}
%\usepackage[default]{gillius}
%\usepackage{roboto}

\renewcommand*\familydefault{\sfdefault} % Force the sans-serif version of any font used

%------------------------------------------------

\usepackage{fontawesome} % Required for FontAwesome icons

% Command to output an icon in a black square box with text to the right
\newcommand{\icon}[3]{% The first parameter is the FontAwesome icon name, the second is the box size and the third is the text
    \vcenteredhbox{\colorbox{black}{\makebox(#2, #2){\textcolor{white}{\large\csname fa#1\endcsname}}}}% Icon and box
    \hspace{0.2cm}% Whitespace
    \vcenteredhbox{\textcolor{black}{#3}}% Text
}

%----------------------------------------------------------------------------------------
%   GRAPHICS DEFINITIONS
%---------------------------------------------------------------------------------------- 

\usepackage{tikz} % Required for creating the plots
\usetikzlibrary{shapes, backgrounds}
\tikzset{x=1cm, y=1cm} % Default tikz units

% Command to vertically centre adjacent content
\newcommand{\vcenteredhbox}[1]{% The only parameter is for the content to centre
    \begingroup%
        \setbox0=\hbox{#1}\parbox{\wd0}{\box0}%
    \endgroup%
}

%----------------------------------------------------------------------------------------
%   CHARTS
%---------------------------------------------------------------------------------------- 

\newcounter{barcount}

% Environment to hold a new bar chart
\newenvironment{barchart}[1]{ % The only parameter is the maximum bar width, in cm
    \newcommand{\barwidth}{0.35}
    \newcommand{\barsep}{0.2}
    
    % Command to add a bar to the bar chart
    \newcommand{\baritem}[2]{ % The first argument is the bar label and the second is the percentage the current bar should take up of the total width
        \pgfmathparse{##2}
        \let\perc\pgfmathresult
        
        \pgfmathparse{#1}
        \let\barsize\pgfmathresult
        
        \pgfmathparse{\barsize*##2/100}
        \let\barone\pgfmathresult
        
        \pgfmathparse{(\barwidth*\thebarcount)+(\barsep*\thebarcount)}
        \let\barx\pgfmathresult
        
        \filldraw[fill=black, draw=none] (0,-\barx) rectangle (\barone,-\barx-\barwidth);
        
        \node [label=180:\colorbox{black}{\textcolor{white}{##1}}] at (0,-\barx-0.175) {};
        \addtocounter{barcount}{1}
    }
    \begin{tikzpicture}
        \setcounter{barcount}{0}
}{
    \end{tikzpicture}
}

%------------------------------------------------

\newcounter{a}
\newcounter{b}
\newcounter{c}

% Command to output a number of automatically-sized bubbles from a string in the format of '<size>/<label>', e.g. \bubbles{5/Eclipse, 6/git, 4/Office, 3/Inkscape, 3/Blender}
\newcommand{\bubbles}[1]{
    % Reset counters
    \setcounter{a}{0}
    \setcounter{c}{150}
    
    \begin{tikzpicture}[scale=3]
        \foreach \p/\t in {#1} {
            \addtocounter{a}{1}
            \bubble{\thea/2}{\theb}{\p/25}{\t}{1\p0}
        }
    \end{tikzpicture}
}

% Command to output a bubble at a specific position with a specific size
\newcommand{\bubble}[5]{
    \filldraw[fill=black, draw=none] (#1,0.5) circle (#3); % Bubble
    \node[label=\textcolor{black}{#4}] at (#1,0.7) {}; % Label
}

%----------------------------------------------------------------------------------------
%   CUSTOM SECTIONS
%----------------------------------------------------------------------------------------

% Command to output section title headings
\newcommand{\cvsect}[1]{% The only parameter is the section text
    \vspace{\baselineskip} % Whitespace before the section title
    \colorbox{black}{\textcolor{white}{\MakeUppercase{\textbf{#1}}}}\% Section title
}

%----------------------------------------------------------------------------------------
%   ENTRY LIST
%----------------------------------------------------------------------------------------

\usepackage{longtable} % Required for tables that span multiple pages
\setlength{\LTpre}{0pt} % Remove default whitespace before longtable
\setlength{\LTpost}{0pt} % Remove default whitespace after longtable

\setlength{\tabcolsep}{0pt} % No spacing between table columns

% Environment to hold a new list of entries
\newenvironment{entrylist}{
    \begin{longtable}[H]{l l}
}{
    \end{longtable}
}

\newcommand{\entry}[4]{% First argument for the leftmost date(s) text, second is for the bold entry heading, third is for the bold right-aligned entry qualifier and the fourth is for the entry description
    \parbox[t]{0.175\textwidth}{% 17.5% of the text width of the page
        #1 % Leftmost entry date(s) text
    }%
    &\parbox[t]{0.825\textwidth}{% 82.5% of the text width of the page
        \textbf{#2}% Entry heading text
        \hfill% Horizontal whitespace
        {\footnotesize \textbf{\textcolor{black}{#3}}}\% Right-aligned entry qualifier text
        #4 % Entry description text
    }\\}

% Command to output a separator slash between lists, e.g. '  /  '
\newcommand{\slashsep}{\hspace{3mm}/\hspace{3mm}}

由于您拥有 developercv.cls 的源代码,您可以对其进行更改。就像下面评论的@samcarter_is_at_topanswers.xyz,首先将developercv.cls重命名为例如developercvron.cls这样你就可以很容易地回到旧版本,这样人们对原来的developercv.cls提出问题不会被针对您的修改的特定答案所误导。

I want to reduce the space between the title (developer-name) and the rest of document.

您是指“Web App Architect”和“我是谁?”之间的 space?

main.tex 的第 43 行中,您有:

\vspace{0.5cm}

Ether 将其更改为较小的数字,或完全删除该行。

Reduce the space between the bubbles section and MyExperience section.

Reduce the space between MyExperience and MyEducation.

developercv.cls 的第 173 行,您有

\vspace{\baselineskip} % Whitespace before the section title

注释该行或更改 \vspace 参数。

请注意,此 space 插入在每个 \cvsect 之前,因此它不仅会更改这些标题,而且会更改文档中的所有标题。如果你想在其他地方使用更多 space,你可能需要在 main.tex 中的其他 \cvsect 调用之前手动添加一个 \vspace{...}。但是,我可能会避免这种情况,以便文档看起来一致。