Page LayoutLyx chapterheading positioning

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
Torben
Posts: 2
Joined: Tue Apr 19, 2011 10:18 am

Lyx chapterheading positioning

Post by Torben »

Hi everyone,
I hope you can help me. When I convert my Lyx-document to pdf the chapterheadings are always too far from the top (for my purpose).
Is there a way I can change that?
Thanks for your help.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

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

meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Lyx chapterheading positioning

Post by meho_r »

Unfortunately, there is no way to do this using a GUI approach. However, you can customize sectioning units easily with a little bit of code, using titlesec package. For example, you can put into the preamble (Document > Settings > LaTeX Preamble) something like this:

Code: Select all

\usepackage{titlesec}

\titleformat{\chapter}[block]%
        {\filright\bfseries\Huge}% formatting (fonts etc.)
        {\huge Chapter~\thechapter}% defining the number before the title
        {0pt}% space between the number and the title
        {\\[12pt]}% text/command between the number and the title
        []% text/command after the title
             
\titlespacing*{\chapter}% sectioning unit (chapter, section etc.)
        {0pt}% left indentation
        {1cm}% space before the title
        {16pt}% space after the title
        [2cm]% right margin
Torben
Posts: 2
Joined: Tue Apr 19, 2011 10:18 am

Re: Lyx chapterheading positioning

Post by Torben »

Tanks a lot, that did it.
Post Reply