Интервал между разделами документа Latex

#latex #document #pdflatex

#Латекс #документ #pdflatex

Вопрос:

Я работаю над своим резюме, и я наткнулся на хороший шаблон, я начал обновлять документ своими данными, но у меня проблема, описания моих заданий длиннее, чем исходный текст шаблона, поэтому мне нужно уменьшить пространство между разделами и уменьшить пространство между заголовком иостальная часть документа, чтобы все хорошо поместилось на одной странице.

Я загрузил шаблон в overleaf: https://www.overleaf.com/read/hktjxsfzpcfp

Чтобы быть более конкретным:

  1. Я хочу уменьшить пробел между заголовком (именем разработчика) и остальной частью документа.
  2. Уменьшите расстояние между разделом bubbles и разделом MyExperience.
  3. Уменьшите расстояние между MyExperience и MyEducation.

Любая помощь будет оценена, спасибо!


ОБНОВЛЕНИЕ: добавление кода здесь для упрощения доступа:

main.tex:

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

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

begin{document}

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

begin{minipage}[t]{0.45textwidth} % 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}{{HUGEtextcolor{white}{textbf{MakeUppercase{Alyx}}}}} % First name
    
    colorbox{black}{{HUGEtextcolor{white}{textbf{MakeUppercase{Vance}}}}} % Last name
    
    vspace{6pt}
    
    {huge Web App Architect} % Career or current job title
end{minipage}
begin{minipage}[t]{0.275textwidth} % 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.275textwidth} % 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.4textwidth} % 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.5textwidth} % 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}slashseptexttt{Vue.js}slashseptexttt{Electron}}
    entry
        {2015 -- 2018\footnotesize{part time}}
        {Full stack developer}
        {Famous Eshop Inc.}
        {loremlorem\ texttt{PHP}slashseptexttt{JS}slashseptexttt{MariaDB}slashseptexttt{Linux}}
    entry
        {2013 -- 2014\footnotesize{part time}}
        {Junior PHP Developer}
        {example.com}
        {loremlorem\ texttt{PHP}slashseptexttt{Laravel}}
end{entrylist}

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

cvsect{Education}

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

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

begin{minipage}[t]{0.3textwidth}
    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.3textwidth}
    vspace{-baselineskip} % Required for vertically aligning minipages
    
    cvsect{Hobbies}
    
    I love... lorem
end{minipage}
hfill
begin{minipage}[t]{0.3textwidth}
    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
ProcessOptionsrelax % 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}{largecsname fa#1endcsname}}}}% 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}
        letpercpgfmathresult
        
        pgfmathparse{#1}
        letbarsizepgfmathresult
        
        pgfmathparse{barsize*##2/100}
        letbaronepgfmathresult
        
        pgfmathparse{(barwidth*thebarcount) (barsep*thebarcount)}
        letbarxpgfmathresult
        
        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}{1p0}
        }
    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.175textwidth}{% 17.5% of the text width of the page
        #1 % Leftmost entry date(s) text
    }%
    amp;parbox[t]{0.825textwidth}{% 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}}
  

Ответ №1:

Поскольку у вас есть исходный код для developercv.cls , вы можете вносить в него изменения. Как @samcarter_is_at_topanswers.xyz прокомментировал ниже, сначала переименуйте developercv.cls , например, developercvron.cls чтобы вы могли легко вернуться к старой версии и чтобы люди, задающие вопросы об оригинале developercv.cls , не были введены в заблуждение ответами, относящимися к вашим изменениям.

Я хочу уменьшить пробел между заголовком (именем разработчика) и остальной частью документа.

Вы имеете в виду пробел между «Архитектором веб-приложений» и «Кто я?»?

В строке 43 main.tex у вас есть:

 vspace{0.5cm}
  

Эфир измените это на меньшее число или полностью удалите строку.

Уменьшите расстояние между разделом bubbles и разделом MyExperience.

Уменьшите расстояние между MyExperience и MyEducation.

В строке 173 из developercv.cls , у вас есть

 vspace{baselineskip} % Whitespace before the section title
  

Прокомментируйте эту строку или измените vspace параметр.

Обратите внимание, что этот пробел вставляется перед каждым cvsect , поэтому изменятся не только эти заголовки, но и все они в документе. Если вам нужно больше места в других местах, вам может потребоваться добавить vspace{...} вручную перед другими cvsect вызовами main.tex . Однако я бы, вероятно, избежал этого, чтобы документ выглядел согласованным.

Комментарии:

1. Since you have the source for developercv.cls, you can make changes in it. Пожалуйста, пожалуйста, пожалуйста, предложите хотя бы другое имя для измененного файла. Это действительно кошмар, когда несколько разных версий одного и того же имени файла перемещаются, а затем пользователь переходит на сайты вопросов и ответов, и никто не будет знать, какую версию они используют. Есть веские причины, по которым это основной принцип в публичной лицензии latex project (lppl не применяется developercv.cls, но тем не менее …)

2. @samcarter_is_at_topanswers.xyz Да, хороший момент. Я не нашел developercv.cls в своем дистрибутиве Texlive, поэтому я предположил, что у OP в любом случае есть локальная копия.

3. С пакетами от ctan / texlive риск использования людьми случайно измененных версий, найденных где-то в Интернете, обычно ниже. Но поскольку этого класса нет в texlive, еще более важно не распространять измененные версии. Например, если я сталкиваюсь с вопросом, использующим файлы, которых нет в texlive, Google обычно находит какую-то случайную версию, которая использовалась в проекте github или подобном — это может быть или не быть той же версией, что и OP, что значительно усложняет отладку.