-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changed handling of page layout over to geometry package #22
base: main
Are you sure you want to change the base?
Conversation
…nstitutional nomenclature: Changed the implementation of the declaration to allow it to be edited within the document (and included an example from the University guidance documentin the example report); defined environments for lay summary, acknowledgements; added option for a sans-serif font (Computer Modern Bright); added option to declare a short version of the title for headers if the fancyhdr option is used.
…impler and more transparent. This also makes it safe to call geometry alongside edmaths for customisation; previously, it would cause latex to ignore the specifications in the stylefile.
Update re: breaking changes Generating my old thesis (298 pages containing various types of complex multiline math expressions which split over page breaks as well as some figures and tables) with both versions of |
% Debug only: In the next line, \XXXfactor contains the number of lines on a text-only page. | ||
% \newlength{\XXXunit}\setlength{\XXXunit}{1pt}\newlength{\XXXfactor}\setlength{\XXXfactor}{1pt + ((672pt - \topskip) / \baselineskip) * \XXXunit} | ||
\newlength{\scratchlength}\setlength{\scratchlength}{\topskip + ((672pt - \topskip) / \baselineskip) * \baselineskip + \baselineskip} | ||
\setlength{\textheight}{\scratchlength} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the current version, the text height adjusts based on the line spacing, set by stretchfactor
. Is this preserved with the update to using geometry or no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is handled by \geometry{heightrounded = true}
(which is likely to be more robust to other changes than the manual calculation).
Summary of changes
Changed handling of page layout over to
geometry
package, making it simpler and more transparent. This also makes it safe to callgeometry
alongsideedmaths
for customisation; previously, doing so would cause LaTeX to ignore the page layout specifications inedmaths
.Comparison of output
The total inner and outer margins remain set at 40mm and 25mm respectively (as specified by UoE printing services), but the inner is now specified as a 25mm page margin + a 15mm binding offset (thanks to @PatrickKinnear for suggesting this). These and other page layout specifications are now much more transparent. If desired,
geometry
can be used to set the binding offset to 0 for electronic versions or to customise the margins, binding offset and other page layout settings more generally; see below.Previously, the text height was determined using the
calc
package and set manually. Thegeometry
optionheightrounded = true
(which is generally recommended anyway) essentially serves the same purpose: where what would be the final line of text on the page does not exactly fill the body text box (which can lead to anunderfull vbox
warning), the box is allowed to stretch into the bottom margin just enough to fit another line of text.Results obtained from
edmaths
before and after this update can be compared usingshowframe
andlayout
(though unfortunatelylayout
does not clearly display the dimensions we're interested in):Old version:
New version:
Note that the output is almost identical, except that space for marginal notes was previously implicitly allowed but fell off the page; it is now removed completely by default (the outer margin is too narrow anyway).
Compatibility with
geometry
packageAlthough not previously noted as an issue on GitHub, the old version was incompatible with
geometry
. Although it would not throw an error, LaTeX would completely ignore the page specifications ofedmaths
ifgeometry
was called after it, setting options not specified in the call togeometry
's default. Compare the "old version" output above to the following, which is the result of using the old version ofedmaths
and callinggeometry
. The outer margin is wider than the inner and there is no binding offset.The update fixes this bug; now, if
geometry
is called afteredmaths
, theedmaths
specifications remain default.Customisation
As per the discussion at Pull Request #20 , the page layout specified by
edmaths
does not follow typical conventions for margin sizes and is sub-optimal for viewing on a screen. Other than making the binding offset explicit, this update does not make any changes to the default page layouts to address these issues, prioritising backward-compatibility and compliance with the specifications of the thesis printing service mentioned above.That said, this update makes it possible to easily customise any of the page layout specifications using
geometry
from within the thesis.tex
file. Since the package is called inedmaths
, we can simply insertgeometry{<options>}
into the preamble. For example, if we want to get rid of the binding space (for on-screen viewing, for example), we can do(we might also want to change to
oneside
atdocumentclass
for this), or if we want to keep the binding offset but make the outer margins larger than the inner and allow for marginal notes,Final notes
geometry
package.calc
package.geometry
package.edmaths
are expected to be minimal as per the screenshots above, but behaviour of figures, math expressions etc. around page breaks should be checked.Type of changes