如何*精確地*在乳膠中垂直居中引用?

如何*精確地*在乳膠中垂直居中引用?

我想我應該在 LaTeX 中快速垂直居中一些文字來結束這個晚上。但是,當然,這不是 LaTeX 的工作原理:/。

我已經採取了簡單的方法。

這是我的 MWE:

\documentclass{article}
\begin{document}
\thispagestyle{empty}
\setlength{\parindent}{0cm} % this kills the indentation
\Huge
\vspace*{\fill}
Arbeiten von zu Hause erlaubt es mir, Job und Familie problemlos zu vereinbaren.
Arbeiten von zu Hause erlaubt es mir, Job und Familie problemlos zu vereinbaren.
\vspace*{\fill}
\end{document}

這確實不是產生精確垂直居中的文本,我不知道為什麼。

在此輸入影像描述

我可能錯過了一些明顯的東西。


更新1: 我試過修復@GuM 評論,但似乎沒有幫助。

\documentclass{article}
\begin{document}
\thispagestyle{empty}
\setlength{\parindent}{0cm} % this kills the indentation
\Huge
\vspace*{-1\topskip plus 1fill}
Arbeiten von zu Hause erlaubt es mir, Job und Familie problemlos zu vereinbaren.
Arbeiten von zu Hause erlaubt es mir, Job und Familie problemlos zu vereinbaren.
\par
\vspace*{\fill}
\end{document}

在此輸入影像描述

答案1

除了\vspace*{-1\topskip plus 1fill}GuM的建議之外,我將排版內容放在\vbox.請注意,內容居中,假設底部\vbox基線文本的底行。

\documentclass{article}
\usepackage[pass,showframe]{geometry}
\begin{document}
\thispagestyle{empty}
\setlength{\parindent}{0cm} % this kills the indentation
\Huge
\vspace*{-1\topskip plus 1fill}
\vbox{
Arbeiten von zu Hause erlaubt es mir, Job und Familie problemlos zu vereinbaren.
Arbeiten von zu Hause erlaubt es mir, Job und Familie problemlos zu vereinbaren.}
\vspace*{\fill}
\end{document}

在此輸入影像描述

為了使居中以考慮文本底行的下降部分,我使用 aminipage而不是 a \vbox,並將 a 括minipage在內部\fbox

\documentclass{article}
\usepackage[pass,showframe]{geometry}
\begin{document}
\thispagestyle{empty}
\setlength{\parindent}{0cm} % this kills the indentation
\Huge
\vspace*{-1\topskip plus 1fill}
\fboxrule=0pt\relax
\fboxsep=-\fboxrule\relax
\fbox{\begin{minipage}{\textwidth}
Arbeiten von zu Hause erlaubt es mir, Job und Familie problemlos zu vereinbaren.
Arbeiten von zu Hause erlaubt es mir, Job und Familie problemlos zu vereinbaren.
\end{minipage}}
\vspace*{\fill}
\end{document}

在此輸入影像描述

相關內容