将模板的边距更改为正常的 DIN-A4 标准

将模板的边距更改为正常的 DIN-A4 标准

最近我找到了一个封面模板。代码写得不好。不幸的是,它离极简还差得很远,但我想向你展示整个设计。我现在的“问题”是:我想要 DIN-A4 纸张的正常边距,但模板的边距较小,甚至在纸张的某些边没有边距。我希望问题的解决方案包含在“调整页边距”部分中,但我不知道如何适当地更改它。也许你可以帮助我。(页面的格式应该保持不变,我只希望每边都有正常的边距。)

\documentclass[a4paper,11pt]{scrartcl}
% -------------------------------------------------
% character encoding
% -------------------------------------------------
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage[latin1,ansinew]{inputenc}
\RequirePackage{lmodern}
\usepackage{marvosym}
\usepackage{graphicx}
\usepackage{color}
\usepackage{framed}
\pagestyle{empty}
% -------------------------------------------------
% adjust the page margins
% -------------------------------------------------
\usepackage[scale=1]{geometry}
\setlength{\parindent}{0pt}
\addtolength{\parskip}{0pt}
\setlength{\footskip}{0pt}
\setlength{\headheight}{15pt}
\setlength{\topskip}{0pt}
% -------------------------------------------------
% positioning of text elements
% -------------------------------------------------
\usepackage[absolute]{textpos}
\setlength{\TPHorizModule}{1cm}
\setlength{\TPVertModule}{\TPHorizModule}
%
% -------------------------------------------------
% personal data
% -------------------------------------------------
\def\firstname{Max}
\def\familyname{Mustermann}
\def\FileAuthor{\firstname \familyname}
\def\FileSubject{Cover}
%
% -------------------------------------------------
% Font
% -------------------------------------------------
\renewcommand{\ttdefault}{pcr}
%
% -------------------------------------------------
% from moderncvstylecasual.sty:
% -------------------------------------------------
\definecolor{blau}{rgb}{0.20,0.40,0.65}
\definecolor{hellblau}{rgb}{0.25,0.50,0.75}
\definecolor{dunkelgrau}{rgb}{0.35,0.35,0.35}
\definecolor{hellgrau}{rgb}{0.45,0.45,0.45}
\definecolor{schwarz}{rgb}{0,0,0}
\newcommand*{\firstnamefont}{\fontsize{25}{27}\sffamily\mdseries\upshape}
\newcommand*{\familynamefont}{\firstnamefont}
\newcommand*{\titel}{\fontsize{25}{27}\mdseries\upshape}
\newcommand*{\inhalt}{\fontsize{15}{17}\mdseries\upshape}
%
\begin{document}
\sffamily
%
% -------------------------------------------------
% title
% -------------------------------------------------
\begin{textblock}{10}(1,2)
\color{dunkelgrau}{
\bfseries \begin{Large}\titel{Long Title ABCD}\end{Large}}
\end{textblock}
%
% -------------------------------------------------
% table of contents
% -------------------------------------------------
%\renewcommand{\labelitemi}{}

\begin{textblock}{10}(12.9,21)
\color{blau}{\inhalt{
\begin{itemize}\setlength{\itemsep}{-1pt}
    \item Item A
    \vspace{0.1cm}
    \item Very Long Item B
    \vspace{0.1cm}      
    \item Item C
    \vspace{0.1cm}      
    \item Item D
    \vspace{0.1cm}      
    \item Long Item E
    \vspace{0.1cm}      
    \item Very Long Item F
    \vspace{0.1cm}      
    \item Long Item G
    \vspace{0.1cm}      
    \item Long Item H
\end{itemize}
}}
\end{textblock}
%
% -------------------------------------------------
% vertical line
% -------------------------------------------------
\begin{textblock}{1}(13.5,0)
\color{hellblau}{\vrule width 2pt height 21cm}
\end{textblock}
% -------------------------------------------------
% picture
% -------------------------------------------------
\begin{textblock}{3}(1,4)
\color{schwarz}{\fbox{\includegraphics[width=11cm]{picture}}}
\end{textblock}
%
% -------------------------------------------------
% address
% -------------------------------------------------
\begin{textblock}{9.7}(1,16.2)
\color{hellblau}{\begin{flushleft}
    \vspace{-3.5cm}
    {\bfseries \begin{large}\firstnamefont{\color{hellgrau}{\firstname}}~\familynamefont{\color{dunkelgrau}{\familyname}}\end{large}}\\[.35ex]
    \huge\itshape%
    Musterstraße 1\\
    12345 Musterstadt\\[.35ex]
    \Mobilefone~{ABCD}\\
    \Letter~{[email protected]}
\end{flushleft}}
\end{textblock}
\end{document}

答案1

按照 MWE 的scrartclclass 和a4paper 选项在终端上生成输出,如下所示。

\documentclass[paper=a4]{scrartcl}
\usepackage{blindtext}

\usepackage[showframe=true,verbose]{geometry}

\begin{document}
\blindtext
\end{document}
  • \纸张宽度=597.50793pt
  • \纸张高度=845.04694pt
  • \文本宽度=418.​​25372pt
  • \textheight=591.53027pt
  • \oddsidemargin=17.35712pt
  • \evensidemargin=17.35712pt
  • \顶部边距=-8.26335pt
  • \headheight=17.0pt
  • \headsep=20.40001pt
  • \topskip=11.0pt
  • \footskip=47.6pt
  • \边距宽度=59.7508pt
  • \marginparsep=12.8401pt
  • \列分隔符=10.0pt
  • \skip\footins=10.0pt 加 4.0pt 减 2.0pt
  • \hoffset=0.0pt
  • \v偏移=0.0pt
  • \mag=1000
  • \@twocolumnfalse
  • \@twosidefalse
  • \@mparswitchfalse
  • \@reversemarginfalse

对于边距来说重要的是\oddsidemargin\evensidemargin(在这种情况下相等),和\topmargin,以及\marginparwidth\marginparsep

这是 OP 的 MWE 输出,只是为了更清楚地说明我们正在谈论的内容:

在此处输入图片描述

相关内容