Hello all,
I thank the community for providing usefull support for this great template.
I have one problem:
Some of my chapter titles are rather long. As a consequence they are cut off after 5 to 7 words.
Now my question:
Is it possible to extend the chapter title over several rows and to adopt the size of the orange box accordingly?
Best regards
snoocad
Theses, Books, Title pages ⇒ more space for chapter title
Re: more spcae for chapter title
Hey snoocad,
You can deal with this problem in a few different ways. The first is to decrease the font size of all chapter titles, but this is probably not the best since then you need to adjust the size of the rounded box they are in. The alternative is to use 2 titles for the longer chapters - one shorter one that appears in the chapter header at the beginning of the chapter and a longer one that appears in the table of contents and in the header of each page in that chapter.
An example of this is: \chapter[Text Chapter: A Careful Inspection]{Text Chapter}
The chapter header will now display "1 - Text Chapter" for this chapter but the table of contents and the headers on each page will display the longer version "Text Chapter: A Careful Inspection".
Cheers,
Vel
You can deal with this problem in a few different ways. The first is to decrease the font size of all chapter titles, but this is probably not the best since then you need to adjust the size of the rounded box they are in. The alternative is to use 2 titles for the longer chapters - one shorter one that appears in the chapter header at the beginning of the chapter and a longer one that appears in the table of contents and in the header of each page in that chapter.
An example of this is: \chapter[Text Chapter: A Careful Inspection]{Text Chapter}
The chapter header will now display "1 - Text Chapter" for this chapter but the table of contents and the headers on each page will display the longer version "Text Chapter: A Careful Inspection".
Cheers,
Vel
Founder and administrator of LaTeXTemplates.com and LaTeXTypesetting.com
-
- Posts: 4
- Joined: Thu Sep 29, 2016 5:03 pm
Re: more space for chapter title
Hey!
is it possible to have 2 lines for the chapter title at the beginning of each chapter? This would help me a lot!
Thanks,
Sebastian
is it possible to have 2 lines for the chapter title at the beginning of each chapter? This would help me a lot!
Thanks,
Sebastian
more space for chapter title
The template has inefficient and restricting definitions of
Adding this to the preamble and using
gives
More lines are also possible:
BTW: this code in the template
is against quite a few best practices in LaTeX: paragraph spacing by ending a paragraph with
There may be further places for improvement but I haven't checked 
Regards
\@makechapterhead
(numbered chapters) and \@makeschapterhead
(unnumbered chapters). Here are improved versions which allow multiline chapter titles:Code: Select all
\makeatletter
\tikzset{
chaptertitle/.style={
line width = 2pt ,
rounded corners = 15pt ,
draw = ocre ,
fill = white ,
fill opacity = 0.5 ,
inner sep = 15pt ,
text = black,
node font = \huge\sffamily\bfseries ,
text width = \paperwidth-\Gm@lmargin-20pt ,
align = left
}
}
\renewcommand\@makechapterhead[1]{%
{%
\parindent \z@ \raggedright \normalfont
\ifnum \c@secnumdepth >\m@ne
\begin{tikzpicture}[remember picture,overlay]
\node at (current page.north west)
{
\begin{tikzpicture}[remember picture,overlay]
\node[anchor=north west,inner sep=0pt] at (0,0)
{\ifusechapterimage\includegraphics[width=\paperwidth]{\thechapterimage}\fi};
\node[anchor=south west,chaptertitle] at (\Gm@lmargin,-9cm)
{\if@mainmatter\thechapter. \fi#1\strut};
\end{tikzpicture}
};
\end{tikzpicture}
\fi
\par\vspace*{270\p@}
}%
}
\renewcommand\@makeschapterhead[1]{%
\begin{tikzpicture}[remember picture,overlay]
\node at (current page.north west)
{
\begin{tikzpicture}[remember picture,overlay]
\node[anchor=north west,inner sep=0pt] at (0,0)
{\ifusechapterimage\includegraphics[width=\paperwidth]{\thechapterimage}\fi};
\node[anchor=south west,chaptertitle] at (\Gm@lmargin,-9cm)
{#1\strut};
\end{tikzpicture}
};
\end{tikzpicture}
\par\vspace*{270\p@}
}
\makeatother
Code: Select all
\chapterimage{chapter_head_2.pdf}
\chapter{Text Chapter so long that it spans two lines. Indeed so long that it
spans two lines.}
More lines are also possible:
BTW: this code in the template
Code: Select all
\newpage
~\vfill
\thispagestyle{empty}
\noindent Copyright \copyright\ 2013 John Smith\\ % Copyright notice
\noindent \textsc{Published by Publisher}\\ % Publisher
\noindent \textsc{book-website.com}\\ % URL
\noindent Licensed under the Creative Commons Attribution-NonCommercial 3.0
Unported License (the ``License''). You may not use this file except in
compliance with the License. You may obtain a copy of the License at
\url{http://creativecommons.org/licenses/by-nc/3.0}. Unless required by
applicable law or agreed to in writing, software distributed under the License
is distributed on an \textsc{``as is'' basis, without warranties or conditions
of any kind}, either express or implied. See the License for the specific
language governing permissions and limitations under the
License.\\
\noindent \textit{First printing, March 2013}
\\
– one should never do that. One of the consequences is a number of underfull hboxes; multiple \noindent
s is also not very nice; ~\vfill
is just wrong. Better:Code: Select all
\newpage
\thispagestyle{empty}
\vspace*{\fill}
\begingroup
\setlength\parskip{\baselineskip}
\setlength\parindent{0pt}
Copyright \copyright\ 2013 John Smith
\textsc{Published by Publisher}
\textsc{book-website.com}
Licensed under the Creative Commons Attribution-NonCommercial 3.0 Unported
License (the ``License''). You may not use this file except in compliance
with the License. You may obtain a copy of the License at
\url{http://creativecommons.org/licenses/by-nc/3.0}. Unless required by
applicable law or agreed to in writing, software distributed under the
License is distributed on an \textsc{``as is'' basis, without warranties or
conditions of any kind}, either express or implied. See the License for
the specific language governing permissions and limitations under the
License.
\textit{First printing, March 2013}
\endgroup

Regards
site moderator & package author
-
- Posts: 4
- Joined: Thu Sep 29, 2016 5:03 pm
more space for chapter title
Thank you very much! This helped a lot.
One more question: with the new code the text also has a opacity of 0.5. How to get the text back at 1.0? If I change the value than the white background is also set to 1.0 and is not transparent anymore.
Thanks!
Edit: I found it by myself, just add text opacity = 1.0 to the definition and it works!
One more question: with the new code the text also has a opacity of 0.5. How to get the text back at 1.0? If I change the value than the white background is also set to 1.0 and is not transparent anymore.
Thanks!
Edit: I found it by myself, just add text opacity = 1.0 to the definition and it works!
more space for chapter title
Add
text opacity = 1
to the style definition..site moderator & package author