Hi guys,
I just stumbled upon this forum. It seems a great resource for learning latex and I am in dire need of some custom templating for *chapters* and *section*. I am not absolutely new to latex but have never worked in tweaking styles or the like.
I have uploaded the images of the format I would like to have here:
TITLE:
SECTION:
In the chapters, I do not need the picture in the background (parabolas). I just need *chapter 1* with the blue rectangle surrounding it, followed by the name.
Could you please suggest me how to go about?
thank you very much,
best, arun.
Document Classes ⇒ custom chapter and section
NEW: TikZ book now 40% off at Amazon.com for a short time.

custom chapter and section
Hi,
I would suggest you to use the titlesec package; the following code is an example that could give you some ideas to get the format for sections:
For chapter titles you could additionally use the PGF/TikZ package. Following the link below you will find an example thet could help you to get started:
Fancy chapter headings with TikZ - TeXblog.
I would suggest you to use the titlesec package; the following code is an example that could give you some ideas to get the format for sections:
Code: Select all
Code, edit and compile here:
\documentclass{book}\usepackage[x11names]{xcolor}\usepackage[explicit]{titlesec}\titleformat{\section}[block]{\normalfont\sffamily}{\colorbox{blue!70}{\parbox[c][15pt][c]{30pt}{%\hfil\color{white}\Large\thesection\hfil}}}{0pt}{\parbox{\linewidth}{%\hspace*{1em}\color{DeepSkyBlue2}\large\sffamily#1\\[-8pt]\color{DeepSkyBlue2}\titlerule}}\titlespacing*{\section}{0pt}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex}\begin{document}\chapter{Test chapter}\section{Test section}\end{document}
For chapter titles you could additionally use the PGF/TikZ package. Following the link below you will find an example thet could help you to get started:
Fancy chapter headings with TikZ - TeXblog.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
custom chapter and section
Hi gmedina,
Thank you very much. It works like a charm. I have just one question. How can I increase the thickness of the line?
In addition, I tried out the code for *chapter*, its about 70-80% as I intend to be...
I have attached the output as a .jpg file here.
I was not able to figure out is how to change the font of the numbers below *chapter* even bigger.. Its already \Huge. Also, I would like the first letter to be bigger caps than the others (in word, this option is Small caps). I don't want to just increase the size of I to make the others look smaller.. I wonder if an option is there in latex to accomplish this?
Other than that, I think this looks good. Except, I wonder if the \parbox will disrupt the alignment with Chapter if the name of the chapter is too long...
I would appreciate if you have any suggestions in this regard, or any other suggestions.
Also, I noted that your code for \section changes the font and also draws a line for *Abstract* and *Acknowledgements* section of my thesis.
I would like to know how I could remove them (in case I don't want these options there) and also if/how to add similarly to reflect in Header, footer, table of contents etc...
I hope your code could be easily replaced for subsection too. If so, I don't have a problem there.
Thank you very much for your help. I would appreciate if you could give some pointers to my questions.
very best,
Arun.
Thank you very much. It works like a charm. I have just one question. How can I increase the thickness of the line?
In addition, I tried out the code for *chapter*, its about 70-80% as I intend to be...
Code: Select all
Code, edit and compile here:
\titleformat{\chapter}[block]{\begin{picture}(330,200)} {%\put(0,230){%\makebox(0,0)[lb]{%\colorbox[named]{Cerulean}{%\begin{tabular}{c}%\multirow{3}{*}{}%\textit{\textcolor{white}{Chapter}}\\%\\%\Huge \textcolor{white}{\thechapter}%\end{tabular}}}}\textcolor[named]{Cerulean}{\uppercase{%\put(75,250){%\parbox[t]{300pt}{%\LARGE\filright #1}}}}}{0pt}{}[\end{picture}]
I was not able to figure out is how to change the font of the numbers below *chapter* even bigger.. Its already \Huge. Also, I would like the first letter to be bigger caps than the others (in word, this option is Small caps). I don't want to just increase the size of I to make the others look smaller.. I wonder if an option is there in latex to accomplish this?
Other than that, I think this looks good. Except, I wonder if the \parbox will disrupt the alignment with Chapter if the name of the chapter is too long...
I would appreciate if you have any suggestions in this regard, or any other suggestions.
Also, I noted that your code for \section changes the font and also draws a line for *Abstract* and *Acknowledgements* section of my thesis.
I would like to know how I could remove them (in case I don't want these options there) and also if/how to add similarly to reflect in Header, footer, table of contents etc...
I hope your code could be easily replaced for subsection too. If so, I don't have a problem there.
Thank you very much for your help. I would appreciate if you could give some pointers to my questions.
very best,
Arun.
- Attachments
-
- Chapter - Latex code
- chp1.jpg (17.91 KiB) Viewed 11039 times
custom chapter and section
Hi, Arun
Using \scshape you can change the font shape to small capitals:
You can use \titleformat and \titlespacing* as many times as you wish inside the body of your document to change the format. Have a look at the following example, that switches between the fancy and the standard format (as defined for the book document class) for sections:pozdrav wrote:...Also, I noted that your code for \section changes the font and also draws a line for *Abstract* and *Acknowledgements* section of my thesis.
I would like to know how I could remove them (in case I don't want these options there)...
Code: Select all
Code, edit and compile here:
\documentclass{book}\usepackage[x11names]{xcolor}\usepackage[explicit]{titlesec}\titleformat{\section}[block]{\normalfont\sffamily}{\colorbox{blue!70}{\parbox[c][15pt][c]{30pt}{%\hfil\color{white}\Large\thesection\hfil}}}{0pt}{\parbox{\linewidth}{%\hspace*{1em}\color{DeepSkyBlue2}\large\sffamily#1\\[-8pt]\color{DeepSkyBlue2}\titlerule}}\titlespacing*{\section}{0pt}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex}\begin{document}\chapter{Test chapter}\section{Test section with a fancy title}\titleformat{\section}{\normalfont\Large\bfseries}{\thesection\ #1}{1em}{}\titlespacing*{\section}{0pt}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex}\section{Test section with a normal title}\titleformat{\section}[block]{\normalfont\sffamily}{\colorbox{blue!70}{\parbox[c][15pt][c]{30pt}{%\hfil\color{white}\Large\thesection\hfil}}}{0pt}{\parbox{\linewidth}{%\hspace*{1em}\color{DeepSkyBlue2}\large\sffamily#1\\[-8pt]\color{DeepSkyBlue2}\titlerule}}\titlespacing*{\section}{0pt}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex}\section{Another test section with a fancy title}\titleformat{\section}{\normalfont\Large\bfseries}{\thesection\ #1}{1em}{}\titlespacing*{\section}
Using the \fontsize command you can increase the font size:pozdrav wrote:...I was not able to figure out is how to change the font of the numbers below *chapter* even bigger.. Its already \Huge...
Code: Select all
Code, edit and compile here:
\documentclass{book}\usepackage{fix-cm}\begin{document}text text {\fontsize{40}{48}\selectfont text text} text text\end{document}
Code: Select all
Code, edit and compile here:
\documentclass{book}\begin{document}text text {\scshape Text text} text text\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Re: custom chapter and section
Thank you very much!
I guess I have fixed everything I have in mind now. In case I run into any other problems, I will post again
I was able to fix the linewidth under section by just using \titlerule[1pt]
best, Arun.
I guess I have fixed everything I have in mind now. In case I run into any other problems, I will post again

I was able to fix the linewidth under section by just using \titlerule[1pt]
best, Arun.