UCL / ucl-latex-thesis-templates

UCL LaTeX thesis templates.
Other
162 stars 108 forks source link

Helvetica/Arial #12

Open da5nsy opened 5 years ago

da5nsy commented 5 years ago

Hi! (The template is awesome, thank you so much.)

The guidelines recommend using Arial or Helvetica. Afraid I'm relatively new to LaTeX and so I'm not sure how to properly implement this.

I tried adding \usepackage{helvet} to MainPackages.tex to no avail.

ikirker commented 5 years ago

That particular guideline is not a good guideline: using a sans-serif typeface for body text of a long document is stylistically highly questionable. I think it used to recommend Times New Roman; I wonder if the branding people in OVPR got to it. (In any case, I used a typeface called Utopia for mine.)

Cf. Serif vs. Sans for Text in Print

Having said that, you can use Helvetica if you want: add the snippet below anywhere in MainPackages.tex, and re-run your preferred LaTeX command or make if you're using that.

The extra step you have to do is set the sans-serif family as the default: just loading the helvet package makes Helvetica the current sans-serif family, but LaTeX is still using the loaded serif family (Times New Roman in our case, set in the times package loaded in ucl_thesis.cls) for all text.

% Loads a scaled version of the Helvetica font
\usepackage{helvet}
% Sets the sans-serif family as the default family
\renewcommand{\familydefault}{\sfdefault}

If you really want to use Arial specifically, you'll have to be using LuaLaTeX or XeLaTeX for your build command, because these provide support for native system fonts instead of LaTeX's own format. Then, instead of the snippet above, add the one below to MainPackages.tex. If you have a native version of the Helvetica typeface installed on your own machine (most common on macOS) you can also replace Arial with Helvetica here to use Helvetica, instead of using the snippet above (you may get a better quality version that way -- I haven't done the comparison).

\usepackage{fontspec}
\setmainfont{Arial}
da5nsy commented 5 years ago

Thank you for such an informative answer. I will certainly think twice about whether to follow this guidelines.

The only thing which the above snippet doesn't seem to change is the page headers. Any suggestions?

ikirker commented 5 years ago

Ah, looks like the class file switches explicitly to the serif (a.k.a. 'Roman') family in headers, here in the file ucl_thesis.cls (lines 194 & 195):

    \def \@oddhead{\normalfont \rmfamily \slshape \hfill \rightmark \hfill \thepage}%
    \def \@evenhead{\normalfont \rmfamily \slshape \thepage \hfill \leftmark \hfill}%

Change this to:

    \def \@oddhead{\normalfont \sffamily \slshape \hfill \rightmark \hfill \thepage}%
    \def \@evenhead{\normalfont \sffamily \slshape \thepage \hfill \leftmark \hfill}%

Oh, and, whatever you end up using, if you keep the Colophon section in the appendices, remember to update it.

da5nsy commented 5 years ago

It appears as though excluding the specific call to a family, e.g.

\def \@oddhead{\normalfont \slshape \hfill \rightmark \hfill \thepage}%
\def \@evenhead{\normalfont \slshape \thepage \hfill \leftmark \hfill}%

... means that this works for either serif/sans serif. Would it lose anything if the template was updated such?

Oh, and, whatever you end up using, if you keep the Colophon section in the appendices, remember to update it.

Good point. Also, there should definitely be a link to the template in the default colophon.

ikirker commented 5 years ago

I thought about just removing it, but I wasn't 100% sure whether it would cause odd results. You wouldn't want to end up with monospaced page numbers because a code sample has been split over multiple pages.

da5nsy commented 5 years ago

I bow to your superior judgement and shall leave it be! :)

da5nsy commented 5 years ago

Just noticed - the only error I get when I compile is: Package nag Warning: Package times is obsolete. Use the mathptmx, helvet (option scaled=.9), courier packages instead.

To my untrained eye, nothing seems to break, and the error goes away, when line 159 of ucl_thesis.cls (\RequirePackage{times}) is commented out.

ikirker commented 5 years ago

The nag package doesn't break anything, it just checks for old things and some classes of mistake, I think.

It should be fine, but I'll take a look when I get a chance and update the fonts. (And maybe contact someone over the Arial/Helvetica guideline...)

da5nsy commented 5 years ago

The nag package is working perfectly as intended - it is alerting me to the fact that the times package is obsolete.

(I'm rather enamored by nag, great idea)

PPPI commented 4 years ago

As someone using this lovely template currently, and opting to use Helvetica, I reached the solution somewhat similarly to here. Except I replaced the times import from the cls file with helvet. Specifically, same edit of lines 194 and 195 as above. While on line 159, I changed the times import to:

\RequirePackage{helvet}

This has the added benefit of removing the nag warning :)

Hope this helps others in the future.

paddyroddy commented 3 years ago

for reference, these changes now change to Helvetica

image
ikirker commented 3 years ago

If I get around to it, I'll see if I can make it a quickly-settable option for the class.