0

I'm trying to make a bunch of lines for an exercise list using the blank command from the xsim package. However, when I use the geometry package to change the size of the page, I get the following result:

enter image description here

As you can see, the last line is not equal in size with the others. The code that generated this result is below:

\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{xsim}
\usepackage{geometry}
\geometry{a4paper}
\usepackage{layout}


\begin{document}
    \blank[width=10\linewidth]{}%
\end{document}

If I remove the geometry package the problem goes away. Please, help me understand why this is happening and, if possible, how to fix it.

1
  • This seems to be a usuable setting: \xsimsetup{blank/line-increment = 0.001\linewidth} (of course after setting the page geometry)
    – cgnieder
    Jun 22, 2018 at 9:24

1 Answer 1

1

blank creates a lot of small line segments with a total length of 10*\linewidth.

When you load geometry the textwidth/linewidth is not an integer value of pt. And so when the line segments are broken into lines the first 9 lines are a bit overfull and the last one too short. Here a similar example:

\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[pass,showframe]{geometry}
\usepackage{xsim}

\textwidth=10.09pt
\begin{document}
    \blank[width=10\linewidth]{}%
\end{document}

which gives

Overfull \hbox (0.91pt too wide) in paragraph at lines 29--29
[]$[]$$[]$$[]$$[]$$[]$$[]$$[]$$[]$$[]$$[]$$[]$
 []

enter image description here

You can work around the problem by resetting the textwidth to e.g. \textwidth=430pt. You can also try \raggedright, but this could lead to a very short eleventh line.

But I would simply draw the lines e.g. with \rule:

\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{geometry}
\geometry{a4paper}

\usepackage{pgffor}
\begin{document}
\foreach\x in {1,2,...,10}
{\noindent\rule{\textwidth}{0.4pt}\ifnum\x<10\\\else\par\fi}
\end{document}

You must log in to answer this question.

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