LyX ⇒ Help Needed with Chapter & Section Title Formatting
-
- Posts: 3
- Joined: Fri Jun 10, 2011 11:48 am
Help Needed with Chapter & Section Title Formatting
"Major Sections" (i.e. Chapter titles, Bibliography and front matter such as Acknowledgements) should be in capital letters, size 16, not bold and centered, e.g.
CHAPTER 1
CHAPTER TITLE
Section titles should have the first letter of the word capitalized (ok, I've got that) and be in size 12 font and bold. There should not be additional spacing above the title (as is default in Lyx)
Subsection titles should have the first letter of the world capitalized (again, got that) and be in size 12 font and in italics.
The front matter (e.g. Acknowledgements, etc.) must appear in the ToC (the front matter is numerated in roman numerals (have the numeration sorted).
My questions are two: How do I format the chapter, section and subsection titles properly with respect to font, style (e.g. bold), capitalization (chapter only) and proper spacing (chapter title)?
Secondly, how do I create non-numbered 'chapters' in the front matter that will appear in the ToC and have the chapters in the main text start at 1?
Sorry to both with this but I have been trying to get this sorted out the last week and I am afraid I have surpassed my knowledge of Lyx/Latex. Any help is appreciated to help me graduate!
M.
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
- Stefan Kottwitz
- Site Admin
- Posts: 10335
- Joined: Mon Mar 10, 2008 9:44 pm
Help Needed with Chapter & Section Title Formatting
you can use the titlesec package to customize the headings.
Here I give you an example to start with. Just use the settings in the document preamble and modify as desired.
Code: Select all
\usepackage{titlesec}
\titleformat{\chapter}[display]
{\normalfont\fontsize{16pt}{18pt}\selectfont\mdseries}
{\MakeUppercase{\chaptertitlename}\ \thechapter}{20pt}{\MakeUppercase}
\titleformat{\section}
{\normalfont\fontsize{12pt}{14pt}\selectfont\bfseries}{\thesection}{1em}{}
\titleformat{\subsection}
{\normalfont\fontsize{12pt}{14pt}\selectfont\itshape}{\thesubsection}{1em}{}
\titlespacing*{\section} {0pt}{0pt}{2.3ex plus .2ex}
\titlespacing*{\subsection}{0pt}{0pt}{1.5ex plus .2ex}
Stefan
-
- Posts: 3
- Joined: Fri Jun 10, 2011 11:48 am
Help Needed with Chapter & Section Title Formatting
Thank you for your response. That was very helpful! I just have to add spacing prior to the section titles--but judging from the documentation link you sent, I think I can figure that out.
There is vertical space before the chapter titles: I am still a bit fuzzy with the titlesec code, how can I alter the chapter titles to remove this vertical space (my library apparently doesn't like this) so that the chapter number (e.g. CHAPTER 1) begins at the space line (vertically) that normal text does elsewhere.
Still getting to understand latex, but it is extremely useful.
M.
[edit: I figured the following question out. Sorry to have bothered with this] I have only one question: When I add chapters prior to the ToC (the 'front matter' such as 'Acknowledgements'), they do not show up in the ToC. How do I get them to show up in the ToC?
Thank you again for help--I needed it!
M.
Stefan_K wrote:Hi,
you can use the titlesec package to customize the headings.
Here I give you an example to start with. Just use the settings in the document preamble and modify as desired.
The titlesec documentation explains the commands.Code: Select all
\usepackage{titlesec} \titleformat{\chapter}[display] {\normalfont\fontsize{16pt}{18pt}\selectfont\mdseries} {\MakeUppercase{\chaptertitlename}\ \thechapter}{20pt}{\MakeUppercase} \titleformat{\section} {\normalfont\fontsize{12pt}{14pt}\selectfont\bfseries}{\thesection}{1em}{} \titleformat{\subsection} {\normalfont\fontsize{12pt}{14pt}\selectfont\itshape}{\thesubsection}{1em}{} \titlespacing*{\section} {0pt}{0pt}{2.3ex plus .2ex} \titlespacing*{\subsection}{0pt}{0pt}{1.5ex plus .2ex}
Stefan
Help Needed with Chapter & Section Title Formatting
http://avizit.blogspot.com/2005/11/addi ... latex.html
Help Needed with Chapter & Section Title Formatting
Hello Stefan,Stefan_K wrote:Hi,
you can use the titlesec package to customize the headings.
Here I give you an example to start with. Just use the settings in the document preamble and modify as desired.
The titlesec documentation explains the commands.Code: Select all
\usepackage{titlesec} \titleformat{\chapter}[display] {\normalfont\fontsize{16pt}{18pt}\selectfont\mdseries} {\MakeUppercase{\chaptertitlename}\ \thechapter}{20pt}{\MakeUppercase} \titleformat{\section} {\normalfont\fontsize{12pt}{14pt}\selectfont\bfseries}{\thesection}{1em}{} \titleformat{\subsection} {\normalfont\fontsize{12pt}{14pt}\selectfont\itshape}{\thesubsection}{1em}{} \titlespacing*{\section} {0pt}{0pt}{2.3ex plus .2ex} \titlespacing*{\subsection}{0pt}{0pt}{1.5ex plus .2ex}
Thanks for the code above. I got the same problem and your code very useful, but now I got a new problem after implementing your code which is my title is not centered anymore. It has become left justified after I put your code in my Latex Preamble.
I have the following code before I put your code to capitalize my title:
Code: Select all
\addtokomafont{chapterentry}{\centering}
\addtokomafont{chapter}{\centering}
Zwitdh