General ⇒ fixing the horizontal space of section headings
fixing the horizontal space of section headings
1. Section
1.1 Subsection
1.1.1 Subsubsection
1.1.1.1 Subsubsubsection
I want to fix the "indent" of all the "section" headings so they all line up.
what I want to do is something like this:
\makebox[8mm][l]{\thesection.\thesubsection.} ...
So all the section headings would start exactly 8mm from the left margin or whatever.
I tired the titlesec package, but the sep option lets me set the distance between the numbers and the title, but that space is kind of dynamic unless i use a monospaced font, which I don't want to do.
any ideas?
thanks
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
fixing the horizontal space of section headings
Code: Select all
\documentclass[english]{article}
\usepackage{babel}
\usepackage{blindtext}
\makeatletter
\def\@seccntformat#1{\hb@xt@ 36pt{\hfil\csname the#1\endcsname}\quad}
% \def\@seccntformat#1{\llap{\csname the#1\endcsname\quad}}
\makeatother
\begin{document}
\tableofcontents
\blinddocument
\end{document}
Re: fixing the horizontal space of section headings
what does that bit of code do?
fixing the horizontal space of section headings
Code: Select all
\makebox[36pt][r]{...}
- Stefan Kottwitz
- Site Admin
- Posts: 10358
- Joined: Mon Mar 10, 2008 9:44 pm
fixing the horizontal space of section headings
Re: fixing the horizontal space of section headings
as an addition to the above I would like to align the numbering in the margin to the left. Is it possible?
Thanks in advance!
/MIcke
Re: fixing the horizontal space of section headings
Re: fixing the horizontal space of section headings
____1__Text
__1.1__Text
1.1.1__Text
But I want it to look like this:
1______Text
1.1____Text
1.1.1__Text
fixing the horizontal space of section headings
Code: Select all
\def\@seccntformat#1{\rlap{\hskip-36pt\csname the#1\endcsname}}
Re: fixing the horizontal space of section headings

Thanks!