LaTeX forum ⇒ Theses, Books, Title pagesChapter 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

Postby templateuser » Sun Mar 08, 2015 3:12 am

Hello all,

I have tried to play with the line

  1. \draw[anchor=west] (1.5cm,-5.5cm)
  2. node [rounded corners=20pt,fill=ocre!10!white,text opacity=1,draw=ocre,draw opacity=1,
  3. line width=1.5pt,fill opacity=.85,inner sep=12pt]
  4. {\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:

User avatar
Stefan Kottwitz
Site Admin
Posts: 8541
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Thu Mar 12, 2015 3:28 pm

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
Site admin

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

Postby Kotsos81 » Sun Sep 13, 2015 3:55 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

Postby Kotsos81 » Mon Sep 14, 2015 8:53 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!

User avatar
Stefan Kottwitz
Site Admin
Posts: 8541
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Mon Sep 14, 2015 9:09 pm

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
Site admin


Return to “Theses, Books, Title pages”

Who is online

Users browsing this forum: No registered users and 1 guest