1

I want to place in the end of the chapter a short horizontally centered line, aligned vertically in the proportions of 2:3.

Everything works except of the horizontal alignment.

MWE:

\documentclass{book}

\usepackage{blindtext}

\usepackage[showframe]{geometry}

\begin{document}

\blindtext

\clearpage

\blindtext\blindtext\blindtext\blindtext

\vspace{\stretch{2}}

\begingroup\centering

\hrule width .25\textwidth height .5pt

\endgroup

\vspace*{\stretch{3}}

\clearpage

\blindtext\blindtext\blindtext

\blindtext\blindtext\blindtext

\blindtext\blindtext\blindtext

\end{document}

enter image description here

2
  • 2
    Consider replacing the TeX macro \hrule by LaTeX \rule{width}{height}. See e.g. here.
    – campa
    Oct 9, 2015 at 12:53
  • @campa, yes, I tried but now vertical stretching doesn't work correctly with \rule. Oct 9, 2015 at 13:12

1 Answer 1

3

a \rule is set at the bottom of a text line, so it is lower than you might think. thus, you need to raise it so that it is vertically centered on that (otherwise invisible) line.

this formulation of the \rule command (ending with \par to ensure that it is just one line) comes close. the [1ex] is the amount the rule is to be raised.

\rule[1ex]{.25\textwidth}{.5pt}\par

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .