LyX ⇒ Remove "Chapter" from Chapter Headings
-
- Posts: 42
- Joined: Fri Jul 22, 2011 12:26 am
Remove "Chapter" from Chapter Headings
I am writing a lab report, so I select "Report" in the document class provided by LyX. The problem is that I want to remove the name "Chapter" on each chapter.
For example, on the attachment below, the form I want is "1. Introduction", rather than "Chapter 1 Introduction". How can erase "Chapter" please?
On thing I want to emphasize is that I don't want to use environment Chapter*, because it is unnumbered, and is not shown on the table of content, maybe not on the head of each page as well.
Thank you!
- Attachments
-
- chapter.png (23.1 KiB) Viewed 19522 times
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
-
- Posts: 42
- Joined: Fri Jul 22, 2011 12:26 am
Remove "Chapter" from Chapter Headings
Code: Select all
\renewcommand{\chaptername}{}
\renewcommand{\thechapter}{\Roman{chapter}}
Now I have another problem. How can I move the chapter number "I" and name "Introduction" on the same line, instead of two lines, please?
- Attachments
-
- chapter.png (9.39 KiB) Viewed 19519 times
- Stefan Kottwitz
- Site Admin
- Posts: 10329
- Joined: Mon Mar 10, 2008 9:44 pm
Remove "Chapter" from Chapter Headings
This line makes the chapter name empty, but the layout of the chapter heading is still reserved.EigenGoofy wrote:Code: Select all
\renewcommand{\chaptername}{}
You could
- change the document class from report to scrreprt, i.e. the KOMA-Script report class, which has such chapter headings by default. This would be my choice, since KOMA-Script classes offer much more features.
- You could use the titlesec package for customizing the headings. The
titlesec manual contains example heading settings of the standard classes in the appendix, this is a nice start for understanding and redefining.
- You could redefine internal report class macros.
That's because you are using the babel package, which defines such names depending on the document language. You could use a babel command for this, in the preamble, such asEigenGoofy wrote: Note these two command should NOT put in the preamble in LyX, otherwise, it does not work properly. It must be put below the table of content in ERT, for example.
Code: Select all
\addto{\captionsenglish}{\renewcommand{\chaptername}{Newname}}
-
- Posts: 42
- Joined: Fri Jul 22, 2011 12:26 am
Re: Remove "Chapter" from Chapter Headings
The KOMA-Script report class does not help that much, since it changes somewhere else which I don't like.
I'll try to use titlesec package.
Thank you very much, Stefan_K! Your book is wonderful - despite of the fact that I want you put more detailed instruction and more examples on those advanced chapter, such as chapter 7, 9, 10, etc.
- Stefan Kottwitz
- Site Admin
- Posts: 10329
- Joined: Mon Mar 10, 2008 9:44 pm
Re: Remove "Chapter" from Chapter Headings
Yes, the KOMA-Script classes have some different defaults, but they can easily be changed. In the long run, one can benefit from the many more features those classes offer.
Stefan