3

I want to use a title page package, ku-forside, made for my university, which can be found here.

The site is in danish, so i will translate the instructions (briefly) to english: Hit "Zip-fil med ku-forside pakken" to download the package as a .zip file, which needs to be extracted to TEXMF\tex\latex (i use MikTeX i.e. MikTeX\tex\latex). Update the FNDB.

Now, my title is too long for one line, which needs to break into multiple lines. The package disrupts the automatic line breaks that \maketitle produce beautifully, and it will not allow me to manually break with \\. For good measures, the package transforms \title to the danish \titel, \author to the danish \forfatter etc..

Maybe you might know what is causing the issue just by looking at the ku-forside.sty (partly shortened to only include the options i use, i.e. "titelside") before reproducing the issue with my MWE (further below):

% KU-forside pakke. Forsider til opgaver skrevet på Københavns Universitet
% Skrevet af Christian Aastrup. Designet af forsiderne følger det på http://www.ku.dk/designmanual
%
\ProvidesPackage{ku-forside}[2007/07/07 v1.0 Frontpages with University of Cph. logos]
%
%Definerer Standard SPROG/AFDELING/FARVE
\def\SPROG{da}\def\FARVE{farve}\def\AFDELING{nat}\def\FORSIDE{titelside}
%
% Laver SPROG-mulighederne til 'if's
\newif\if@en \newif\if@da
%
% Laver AFDELINGS-mulighederne til 'if's
\newif\if@ku   \newif\if@farma \newif\if@hum
\newif\if@jur  \newif\if@life  \newif\if@nat
\newif\if@samf \newif\if@sund  \newif\if@teo
%
% Laver FARVE-mulighederne til 'if's
\newif\if@farve \newif\if@sh
%
% Laver FORSIDE-mulighederne til 'if's
\newif\if@titelside \newif\if@stor \newif\if@lille
%
\newif\if@babel \DeclareOption{babel}{\@babeltrue}
%
% Erklærer sprogene som 'options' i pakke-kaldet
\DeclareOption{en}{\@entrue} \DeclareOption{da}{\@datrue}
%
% Erklærer afdelingerne som 'options' i pakke-kaldet
\DeclareOption{ku}{\@kutrue}     \DeclareOption{farma}{\@farmatrue} \DeclareOption{hum}{\@humtrue}
\DeclareOption{jur}{\@jurtrue}   \DeclareOption{life}{\@lifetrue}   \DeclareOption{nat}{\@nattrue}
\DeclareOption{samf}{\@samftrue} \DeclareOption{sund}{\@sundtrue}   \DeclareOption{teo}{\@teotrue}
%
% Erklærer farverne som 'options' i pakke-kaldet
\DeclareOption{farve}{\@farvetrue} \DeclareOption{sh}{\@shtrue}
%
% Erklærer forsidemulighederne som 'options' i pakke-kaldet
\DeclareOption{lille}{\@lilletrue} \DeclareOption{stor}{\@stortrue}
\DeclareOption{titelside}{\@titelsidetrue}
%
\ProcessOptions\relax
%
% Definerer hvad der skal ske når sprogene er TRUE
\if@en \def\SPROG{en} \fi \if@da \def\SPROG{da} \fi
%
% Definerer hvad der skal ske når afdelingerne er TRUE
\if@ku   \def\AFDELING{ku}   \fi \if@farma \def\AFDELING{farma} \fi \if@hum \def\AFDELING{hum} \fi
\if@jur  \def\AFDELING{jur}  \fi \if@life  \def\AFDELING{life}  \fi \if@nat \def\AFDELING{nat} \fi
\if@samf \def\AFDELING{samf} \fi \if@sund  \def\AFDELING{sund}  \fi \if@teo \def\AFDELING{teo} \fi
%
% Definerer hvad der skal ske når farverne er TRUE
\if@sh \def\FARVE{sh} \fi \if@farve \def\FARVE{farve} \fi
%
% Definerer hvad der skal ske når de forskellige forsidemuligheder er TRUE
\if@stor \def\FORSIDE{stor} \fi \if@lille \def\FORSIDE{lille} \fi
\if@titelside \def\FORSIDE{titelside} \fi
%
\def\OPGAVE{$\backslash$opgave$\{\ldots\}$}
\def\FORFATTER{$\backslash$forfatter$\{\ldots\}$ el. $\backslash$author$\{\ldots\}$ }
\def\TITEL{$\backslash$titel$\{\ldots\}$ el. $\backslash$title$\{\ldots\}$}
\def\UNDERTITEL{$\backslash$undertitel$\{\ldots\}$}
\def\VEJLEDER{$\backslash$vejleder$\{\ldots\}$}
\def\AFLEVERINGSDATO{$\backslash$dato$\{\ldots\}$ el. $\backslash$date$\{\ldots\}$}
%
\renewcommand{\author}[1]{\def\FORFATTER{#1}}
\renewcommand{\title}[1]{\def\TITEL{#1}}
\renewcommand{\date}[1]{\def\AFLEVERINGSDATO{#1}}
%
\newcommand{\opgave}[1]{\def\OPGAVE{#1}}
\newcommand{\forfatter}[1]{\def\FORFATTER{#1}}
\newcommand{\titel}[1]{\def\TITEL{#1}}
\newcommand{\undertitel}[1]{\def\UNDERTITEL{#1}}
\newcommand{\vejleder}[1]{\def\VEJLEDER{#1}}
\newcommand{\dato}[1]{\def\AFLEVERINGSDATO{#1}}
%
% Pakker nødvendige for at sætte forsiden op %
%
%\RequirePackage[OT2,OT4]{fontenc}
\RequirePackage{eso-pic,graphicx,fix-cm,ae,aecompl,ifthen}         %
%\RequirePackage[usenames]{color}
\RequirePackage{color} %
%% BABEL-option: Undersøger det erklærede sprog og sætter pakken Babel derefter %%
\if@babel
\ifthenelse{\equal{\SPROG}{en}}{\RequirePackage[danish,english]{babel}}{} % Engelsk ordeling, overskrifts- og kapitel struktur   %
\ifthenelse{\equal{\SPROG}{da}}{\RequirePackage[english,danish]{babel}}{} % Dansk ordeling, overskrifts- og kapitel struktur     %
% Bemærk at begge sprog indlæses. Rækkefølgen er vigtig, idet det er det sidste sprog som dokumnetet generelt sættes i.          %
% Det andet sprogs orddeling mm. kan man få fat i ved at skrive \selectlanguage{sprog} i brødteksten                             %
\fi
%
%% FORSIDEN DEFINERES:  %
%
% Mulighed: titelside
\ifthenelse{\equal{\FORSIDE}{titelside}}{
\def\tyk{\fontfamily{phv}\fontseries{bx}\selectfont} %Bold extended                                                              %
\def\tynd{\fontfamily{phv}\fontseries{sb}\selectfont} % Semi-bold                                                                %
\def\maketitle{\thispagestyle{empty}                                                                                             %
\AddToShipoutPicture*{\put(0,0){\includegraphics*[viewport=0 0 700 600]{\AFDELING-\FARVE}}}%                                     %
\AddToShipoutPicture*{\put(0,602){\includegraphics*[viewport=0 600 700 1600]{\AFDELING-\FARVE}}}%                                %
\AddToShipoutPicture*{\put(0,0){\includegraphics*{\AFDELING-\SPROG}}}%                                                           %
\AddToShipoutPicture*{\put(50,583.5){\fontsize{20 pt}{22 pt} \tyk \OPGAVE  }} %                                                  %
\AddToShipoutPicture*{\put(50,555.3){\fontsize{14 pt}{16 pt} \tynd \FORFATTER  }} %                                              %
\AddToShipoutPicture*{\put(50,499){\fontsize{22 pt}{24 pt} \tynd \TITEL  }} %                                                    %
\AddToShipoutPicture*{\put(50,480.5){\fontsize{14 pt}{16 pt} \tynd \UNDERTITEL  }} %                                             %
\AddToShipoutPicture*{\put(50,92){\fontsize{11 pt}{12 pt} \tynd \VEJLEDER  }} %                                                  %
\AddToShipoutPicture*{\put(50,66.7){\fontsize{11 pt}{12 pt} \tynd \AFLEVERINGSDATO   }} %                                        %
\phantom{Usynlig, men nødvendig}                                                                                                 %
\newpage \noindent}}{}                                                                                                              

Here is a MWE for my problem:

\documentclass[12pt,letterpaper,usenames]{article}
\usepackage[paperheight=297mm,paperwidth=212mm,margin=2.54cm]{geometry}
\usepackage[round,numbers]{natbib}
\usepackage[babel, titelside, nat,farve, en]{ku-forside}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%               Titel                    %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\titel{A title that is too long for\\ one line: It\newline needs to break, please break} %
\undertitel{} %
\opgave{Bachelor Thesis} % Findes kun under 'titelside'
\forfatter{Mememememememe}%
\dato{\today}%
\vejleder{Supervisor Name} %  Findes kun under 'titelside'

\begin{document}
\maketitle
\end{document} 
2
  • You could use a \Longstack[]{} of the stackengine package to stack things in a title over multiple lines, if I recall properly. – Steven B. Segletes Jun 1 '16 at 19:34
  • There are lots (!) of issues, that can be solved with parbox. So keep it in mind. – MaestroGlanz Jun 1 '16 at 21:27
3

A workaround consists in putting the title in a \parbox. Comment aside, ae and ae-compl shouldn't be used any more. Also I replaced \RequirePackage[usenames]{color} with \RequirePackage{xcolor} (usenames is the default in that case). Also, as cfr pointed out, I suppose the letterpaper format should not be used in Denmark.

\documentclass[12pt]{article}
\usepackage[paperheight=297mm,paperwidth=212mm,margin=2.54cm]{geometry}
\usepackage[round,numbers]{natbib}
\usepackage[babel, titelside, nat, farve, en]{ku-forside}% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Titel %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\titel{\parbox{\linewidth}{A title that is too long for\\ one line: It\\ needs to break, please break}} %
\undertitel{} %
\opgave{Bachelor Thesis} % Findes kun under 'titelside'
\forfatter{Mememememememe}%
\dato{\today}%
\vejleder{Supervisor Name} % Findes kun under 'titelside'

\begin{document}

\maketitle

\end{document} 

enter image description here

12
  • What's the point of letterpaper? – cfr Jun 1 '16 at 21:02
  • @cfr: In Denmark, it seems strange. For exoticism, maybe? – Bernard Jun 1 '16 at 21:08
  • 1
    But look at the next line, which is even stranger. – cfr Jun 1 '16 at 21:10
  • The reason why i chose letterpaper is because it was the first format stated in the AJCN guidelines, which is where my paper might get submitted to. My thesis will be handed in digitally so it should not be an issue. Either way, i might change it to A4 after reading your comments, letterpaper is better for wide tables though. Thank you for adressing the xcolor fix. I don't know what ae and aecompl is for, are they safe to remove? – Nowak Jun 1 '16 at 21:48
  • Yes. They're obsolete extensions, made to solve the problem of hyphenation with accented letters. According to the guide l2tabu, they should be replaced with \usepackage[T1]{fontenc}\usepackage{lmodern} in your preamble. If you decide to change the .sty file, use \Require Package. Also, it's better to add usepackage[utf8]{inputenc}, as all modern systems understand unicode (of course set your TeX editor to use utf8 encoding). – Bernard Jun 1 '16 at 22:03
4

This solves it quite simply, but it is perhaps not the best way. A \parbox as also suggested by Bernard does the trick.

I do get an error with this package, even with only the examples included in the package. I think it might be outdated. It does compile anyway, but it could lead to problems. There's an option-clash for the color-package, which I believe is now added by some of the other packages. I solved this by commenting the line \RequirePackage[usenames]{color} % in ku-forside.sty-file, which should be a safe fix.

I would probably tell whoever is responsible for the template to please update it.

\documentclass[12pt,letterpaper,usenames]{article}
\usepackage[paperheight=297mm,paperwidth=212mm,margin=2.54cm]{geometry}
\usepackage[round,numbers]{natbib}
\usepackage[babel, titelside, nat,farve, en]{ku-forside}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%               Titel                    %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\titel{\parbox{\textwidth}{A title that is too long for one line: It\\ needs to break, please break}} %
\undertitel{} %
\opgave{Bachelor Thesis} % Findes kun under 'titelside'
\forfatter{Mememememememe}%
\dato{\today}%
\vejleder{Supervisor Name} %  Findes kun under 'titelside'

\begin{document}
\maketitle

\end{document} 

enter image description here

5
  • Anyway, if it is the usenames option for xcolor which the clash source, it is deprecated. – Bernard Jun 1 '16 at 20:28
  • @Bernard Is your answer the same? I'm trying to figure out what the differences are between your \parbox solution and this one. – cfr Jun 1 '16 at 21:06
  • 1
    Solutions are the same, bernard and cfr has many other suggestions on the template itself, though. – Runar Jun 1 '16 at 21:12
  • 1
    @cfr: Almost the same. Actually, I think (maybe I'm wrong) this one was modified after I posted mine. Personally, I added the images when I saw the whole .sty file and the graphics files could be downloaded, and I changed a couple of lines. – Bernard Jun 1 '16 at 21:17
  • @Bernard Yes, initially I added the code only, which is the same as now. Right after I added text, and added the image only after I saw your image. – Runar Jun 1 '16 at 22:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.