ahnkle
ahnkle

Reputation: 477

How do I extend the level at which section numbering stops

I have a emacs org-mode document I want to export to latex. I want to level 4 levels of sections that are numbered. What do I need to do to make this work?

I am using cygwin emacs 24.5.1/org mode 8.3.3

What I am getting is that the section SubSubSubSection 1 is both being numbered, and also appears to be being treated as a list item.

This is my example org file

#+TITLE: Example Title
#+DATE: Time-stamp: <16:28:21 Friday 12 February 2016 dJeremy>
#+AUTHOR: An Author
#+EMAIL: [email protected]

#+OPTIONS: H:6 num:6

* Last Section

** SubSection 1

*** SubSubSection 1

    Deep in the sections.

*** SubSubSection 2

**** SubSubSubSection 1

     Nested deeply here.

     Really!

*** SubSubSection 3

** SubSection 2

   The end of the subs.

And this is what I get in PDF (processed using windows MikTex). This is typed by hand, but you get the idea. Table of contents is omitted.

1  Last Section

1.1  SubSection 1

1.1.1  SubSubSection 1

Deep in the sections.

1.1.2  SubSubSection 2

1.1.2.1  SubSubSubSection 1  Nested deeply here.
   Really!

1.1.3  SubSubSection 3

1.2  SubSection 2

The end of the subs.

[Update]

I am expecting 1.1.2.1 to look like this:

1.1.2.1  SubSubSubSection 1

Nested deeply here

Really!

[Update 2] I looked at the tex file that org mode creates, and it looks ok (no strange formatting like in the pdf). So the problem lies with lualatex and how I'm using it.

See the complete tex file in pastebin here.

Upvotes: 0

Views: 2653

Answers (2)

shae128
shae128

Reputation: 11

According to the official documentation https://orgmode.org/manual/Export-settings.html

you could use H: and num: options to achieve your goal

H: Set the number of headline levels for export (org-export-headline-levels). Below that level, headlines are treated differently. In most back-ends, they become list items.

num: Toggle section-numbers (org-export-with-section-numbers). When set to number ‘n’, Org numbers only those headlines at level ‘n’ or above. Setting UNNUMBERED property to non-nil disables numbering of a heading. Since subheadings inherit from this property, it affects their numbering, too.

Upvotes: 0

John Kitchin
John Kitchin

Reputation: 2433

As suggested by Dan, the TeX site suggests this solution in your org-file:

#+latex_header: \usepackage{titlesec}
#+latex_header: \setcounter{secnumdepth}{4}
#+latex_header: \titleformat{\paragraph}
#+latex_header: {\normalfont\normalsize\bfseries}{\theparagraph}{1em}{}
#+latex_header: \titlespacing*{\paragraph}
#+latex_header: {0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}

Upvotes: 2

Related Questions