我想删除顶部 2 个小页面和底部 2 个小页面之间的垂直间距。谢谢您的帮助!问候,chico (法国)
\documentclass[a4paper, 12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[bottom=0cm,top=0cm,left=0cm,right=0cm]{geometry}
\usepackage{graphicx}
\usepackage{xcolor}
\setlength{\parindent}{0cm}
\setlength{\fboxsep}{4mm}
\setlength{\fboxrule}{1mm}
\usepackage{lipsum}
\begin{document}
\tiny
\fcolorbox{red}{white}{%
\begin{minipage}[b][\dimexpr 0.5\textheight-2\fboxsep-2\fboxrule\relax][t]{\dimexpr 0.75\textwidth-2\fboxsep-2\fboxrule\relax}
\lipsum[1]
\end{minipage}}%
\fcolorbox{red}{white}{%
\begin{minipage}[b][\dimexpr 0.5\textheight-2\fboxsep-2\fboxrule\relax][t]{\dimexpr 0.25\textwidth-2\fboxsep-2\fboxrule\relax}
\lipsum[1]
\end{minipage}%
}
\fcolorbox{blue}{white}{%
\begin{minipage}[t][\dimexpr 0.5\textheight-2\fboxsep-2\fboxrule\relax][t]{\dimexpr 0.4\textwidth-2\fboxsep-2\fboxrule\relax}
\lipsum[1]
\end{minipage}}%
\fcolorbox{blue}{white}{%
\begin{minipage}[t][\dimexpr 0.5\textheight-2\fboxsep-2\fboxrule\relax][t]{\dimexpr 0.6\textwidth-2\fboxsep-2\fboxrule\relax}
\lipsum[1]
\end{minipage}%
}
\end{document}
答案1
您可以通过以下几种方式进行操作:
\documentclass[a4paper, 12pt]{article}
\usepackage[bottom=0cm,top=0cm,left=0cm,right=0cm]{geometry}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{lipsum}
\setlength{\parindent}{0cm}
\setlength{\fboxsep}{4mm}
\setlength{\fboxrule}{1mm}
\newcommand{\boxheight}[1]{%
\dimexpr#1\textheight-2\fboxsep-2\fboxrule\relax
}
\newcommand{\boxwidth}[1]{%
\dimexpr#1\textwidth-2\fboxsep-2\fboxrule\relax
}
\begin{document}
\fcolorbox{red}{white}{%
\begin{minipage}[b][\boxheight{0.5}][t]{\boxwidth{0.75}}
\lipsum[1]
\end{minipage}}%
\fcolorbox{red}{white}{%
\begin{minipage}[b][\boxheight{0.5}][t]{\boxwidth{0.25}}
\lipsum[1][1-3]
\end{minipage}%
}\hrule height0pt
\fcolorbox{blue}{white}{%
\begin{minipage}[t][\boxheight{0.5}][t]{\boxwidth{0.4}}
\lipsum[1][1-3]
\end{minipage}}%
\fcolorbox{blue}{white}{%
\begin{minipage}[t][\boxheight{0.5}]{\boxwidth{0.6}}
\lipsum[1]
\end{minipage}%
}
\end{document}
我通过更方便的宏缩短了框尺寸规格。诀窍是\hrule
将结束段落,但不会在段落前后添加粘连。
您也可以将\hrule height 0pt with
\par\nointerlineskip to avoid TeX adding
\lineskip` 替换为 \par\nointerlineskip` 粘连。输出将是相同的。
特写: