Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
LaTeX Beginner's Guide

You're reading from   LaTeX Beginner's Guide When there‚Äôs a scientific or technical paper to write, the versatility of LaTeX is very attractive. But where can you learn about the software? The answer is this superb beginner‚Äôs guide, packed with examples and explanations.

Arrow left icon
Product type Paperback
Published in Mar 2011
Publisher Packt
ISBN-13 9781847199867
Length 336 pages
Edition 1st Edition
Tools
Arrow right icon
Toc

Table of Contents (21) Chapters Close

LaTeX
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Getting Started with LaTeX FREE CHAPTER 2. Formatting Words, Lines, and Paragraphs 3. Designing Pages 4. Creating Lists 5. Creating Tables and Inserting Pictures 6. Cross-Referencing 7. Listing Content and References 8. Typing Math Formulas 9. Using Fonts 10. Developing Large Documents 11. Enhancing Your Documents Further 12. Troubleshooting 13. Using Online Resources Pop Quiz Answers Index

Time for action – designing chapter and section headings


We return to our example that we used in this chapter. Our goal is to create centered headings. The font size should be smaller, further we reduce the space above and below. Finally, we switch to a sans serif font which is a good choice for bold headings:

  1. Open the file preamble.tex which we already used in this chapter. Insert this line to load the titlesec package:

    \usepackage{titlesec}
  2. Add this command to specify layout and font of the chapter headings:

    \titleformat{\chapter}[display]
      {\normalfont\sffamily\Large\bfseries\centering}
      {\chaptertitlename\ \thechapter}{0pt}{\Huge}
  3. Now define the section heading by calling \titleformat again:

    \titleformat{\section}
      {\normalfont\sffamily\large\bfseries\centering}
      {\thesection}{1em}{}
  4. Add this line to adjust the chapter headings spacing:

    \titlespacing*{\chapter}{0pt}{30pt}{20pt}
  5. Save preamble.tex and Typeset the main document equation.tex. Let’s see how the headings have changed:

What just...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image