I am writing software documentation using Org-mode, but I also want to export the result as a Texinfo file. The process works well, however, Texinfo transforms level 4 headings into numbered lists instead of subsubsections, etc. The documentation indicates to use #+OPTIONS: num:6
exporting as subsubheadings, etc. instead of numbered lists for any header of level 6 or lower. Has anybody run into this issue and know how to deal with it? It is not a huge problem, but my INFO files would be easier to navigator with the proper layout.

- 265
- 1
- 8
-
1Isn't the option H:6 rather than num:6? – JeanPierre Nov 17 '19 at 16:01
-
Humm, I will try your suggestion. That is not what the org manual says, but I will try anything. Will report back. – Pablo A Perez-Fernandez Nov 17 '19 at 18:17
-
I can confirm that your H:6 suggestion worked. However, the file has some compilation problems when compiling the texinfo file to info. But, the heading export issue is solved using your recommendation. Thanks much. – Pablo A Perez-Fernandez Nov 17 '19 at 18:27
-
This is what I read in the manual: https://orgmode.org/manual/Export-Settings.html – JeanPierre Nov 17 '19 at 20:18
1 Answers
Looking at the org manual section "Export settings", we can see that num
sets the headlines that will be numbered: headline levels above this number will be unumbered.
‘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.
What you want to change is the number of headline levels to use for export, and that is option H
:
‘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.
So you should use the following setting:
#+OPTIONS: H:6
Note that the effect of this line is to set the value of variable org-export-headline-levels
for this one buffer. There are other ways to set this parameter:
Export options can be set: globally with variables; for an individual file by making variables buffer-local with in-buffer settings, by setting individual keywords, or by specifying them in a compact form with the ‘#+OPTIONS’ keyword;

- 7,323
- 1
- 18
- 37
-
Gents, thanks all for helping. I was obviously suffering from a bad case of not reading properly. The manual is pretty clear. I did want to add a little more info about this problem I encountered. You can set the H: option to whatever number you want. However, @subsubsection is the lowest section command available in TexInfo. So, if your Org file has headings level 5 or below and your H: option has something like H:5, the TexInfo will not compile. – Pablo A Perez-Fernandez Nov 21 '19 at 07:56
-
@PabloAPerez-Fernandez You mean when you run makeinfo on it? Indeed, that might be considered a bug, as the texinfo is found incorrect. In this case you may want to change your question to asking about the H:6 not working, it would surely be much more usefull for future readers (I would update my answer then). – JeanPierre Nov 21 '19 at 10:46
-
yes, that is what I meant. When one runs `MakeInfo buffer` on the texi file, you get the behavior I described. However, I am not sure it should be considered a bug. The manual does say that the `H:n` option forces the headers to be exported as such instead of enumerated lists up to the `n`-th level. But, there is NO way for TexInfo to create such a deep section for headers `n>4` – Pablo A Perez-Fernandez Nov 22 '19 at 11:21