## LaTeX forum ⇒ Theses, Books, Title pages ⇒ Chapter title too long for the box Topic is solved

Classicthesis, Bachelor and Master thesis, PhD, Doctoral degree
templateuser
Posts: 679
Joined: Tue Mar 03, 2015 4:01 pm

### Chapter title too long for the box

Hello all,

I have tried to play with the line

`\draw[anchor=west] (1.5cm,-5.5cm)   node [rounded corners=20pt,fill=ocre!10!white,text opacity=1,draw=ocre,draw opacity=1,         line width=1.5pt,fill opacity=.85,inner sep=12pt]     {\LARGE\sffamily\bfseries\textcolor{black}{Chapter \thechapter. #1\strut\makebox[22cm]{}}};`

Unfortunately I don't get it to work: when the chapter title is too long, I would like the line to break (like the normal behavior of chapter). Is there a way to get this behavior?

thank you.

Best

egiem

Tags:

Stefan Kottwitz
Posts: 8704
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:
Hi egiem,

sure, TikZ just needs to know the width of the box for automatically breaking the line. You can use the `text width` key in the `node` options, such as

`node [text width=22cm, ...] {long text}`

or, as you already like to use a box (I see `\makebox`) you simply use a `\parbox` command in the `node` content text.

Stefan

Kotsos81
Posts: 2
Joined: Sun Sep 13, 2015 3:51 pm
Hello Stefan_K,

due to the fact that I am a new user of LaTeX, could you please post a working example with the required modifications you suggest? I don't know how to do what you said in your previous reply.

Thank you.

Kostas

Kotsos81
Posts: 2
Joined: Sun Sep 13, 2015 3:51 pm
Stefan,

I achieved what I wanted using the text width option, as you suggested! The only difference is that I had not to use the long text argument. (When I did, there was an error outputted - but nevermind, it works without that!) A million thanks!

Stefan Kottwitz
Posts: 8704
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:
Hi Kostas,

great that it works for you too! Thank you for the feedback.

And welcome to the forum! Maybe see you again here.

Stefan