减少顶部和底部边距并增加行的长度

减少顶部和底部边距并增加行的长度

我想在以下代码中减少左侧、尺寸、顶部和右侧边距。我还想增加每个部分后的水平线长度。我该怎么做?

\documentclass[a4paper,10pt]{article}

%\usepackage[top=1in, bottom=1in, left=1in, right=1in]{geometry}

%A Few Useful Packages
\usepackage{marvosym}
\usepackage{fontspec}                   %for loading fonts
\usepackage{xunicode,xltxtra,url,parskip}   %other packages for formatting
\RequirePackage{color,graphicx}
\usepackage[usenames,dvipsnames]{xcolor}
%\usepackage[big]{layaureo}                 %better formatting of the A4 page
% an alternative to Layaureo can be 
\usepackage{fullpage}
\addtolength{\voffset}{-1.3cm}

\usepackage{supertabular}               %for Grades
\usepackage{titlesec}                   %custom \section

%Setup hyperref package, and colours for links
\usepackage{hyperref}
\definecolor{linkcolour}{rgb}{0,0.2,0.6}
\hypersetup{colorlinks,breaklinks,urlcolor=linkcolour, linkcolor=linkcolour}

%FONTS
\defaultfontfeatures{Mapping=tex-text}
%\setmainfont[SmallCapsFont = Fontin SmallCaps]{Fontin}
%%% modified for Karol Kozioł for ShareLaTeX use
\setmainfont[
SmallCapsFont = Fontin-SmallCaps.otf,
BoldFont = Fontin-Bold.otf,
ItalicFont = Fontin-Italic.otf
]
{Fontin.otf}
%%%

\titleformat{\section}{\Large\scshape\raggedright}{}{0em}{}[\titlerule]
\titlespacing{\section}{0pt}{3pt}{3pt}
%Tweak a bit the top margin
%\addtolength{\voffset}{-1.3cm}

%Italian hyphenation for the word: ''corporations''
\hyphenation{im-pre-se}

\usepackage[absolute]{textpos}

\textblockorigin{2mm}{0.65\paperheight}
\setlength{\parindent}{0pt}

%--------------------BEGIN DOCUMENT----------------------
\begin{document}

%WATERMARK TEST [**not part of a CV**]---------------
%\font\wm=''Baskerville:color=787878'' at 8pt
%\font\wmweb=''Baskerville:color=FF1493'' at 8pt
%{\wm 
%   \begin{textblock}{1}(0,0)
%       \rotatebox{-90}{\parbox{500mm}{
%           Typeset by Alessandro Plasmati with \XeTeX\  \today\ for 
%           {\wmweb \href{http://www.aleplasmati.comuv.com}{aleplasmati.comuv.com}}
%       }
%   }
%   \end{textblock}
%}

\pagestyle{empty} % non-numbered pages

\font\fb=''[cmr10]'' %for use with \LaTeX command

%--------------------TITLE-------------
\par{\centering
        {\Huge \textsc{xxxx}  \textsc{xxxxx}
    }\bigskip\par}

%--------------------SECTIONS-----------------------------------
%Section: Personal Data
\section{Personal Data}

\begin{tabular}{rl}
    \textsc{Place and Date of Birth:} 
xxxxxxxxxxxxx
\end{tabular}

%Section: Education
\section{Education}
\begin{tabular}{rl} 
xxxxxxxxxxxxx
\end{tabular}


\end{document}

答案1

使用相同模板时遇到同样的问题/疑问(请参阅https://www.sharelatex.com/templates/cv-or-resume/professional-cv

将此行注释掉,以避免 layaureo 包和 geometry 包之间发生冲突:

%\usepackage[big]{layaureo}                 %better formatting of the A4 page

并添加这一行:

\usepackage[margin=0.5in]{geometry}

此时你会发现\linerule此 \titleformat 语句中创建的水平线会增加线的长度以延伸到新的边距:

\titleformat{\section}[display]
{\Large\scshape\raggedright}{}{0pt}{}[\titlerule] 

相关内容