I have a DATE_TREE logbook within an org-file that I would like to export to Latex, keeping the years at a level of a chapter:

* Logbook
** 2016
*** 2016-10 October     :ignore:
**** 2016-10-13 Thursday
***** Some logged thing

I have set up the ignore tab so that the desired LaTeX export would be

\section{2016-10-13 Thursday}
\subsection{Some logged thing}

However, the default behavior of org-mode export is to have the first level of export be a section, so I get \section{2016}.

Is there a way to change this export behavior only for this Logbook tree, and not for the entire buffer?


You need to use a latex_class that allows chapters, e.g. the book class, which is included in org-latex-classes by default. However, the default behavior is to use a part as the top level structure, instead of a chapter.

If you don't want parts, you can create a new element in org-latex-classes like so:

(add-to-list 'org-latex-classes
              ("\\chapter{%s}" . "\\chapter*{%s}")
              ("\\section{%s}" . "\\section*{%s}")
              ("\\subsection{%s}" . "\\subsection*{%s}")
              ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
              ("\\paragraph{%s}" . "\\paragraph*{%s}")
              ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))

Then you can simply add #+latex_class: book-noparts to the Org file. To apply this only to a subtree, you can instead set the export_latex_class property by going to the Logbook headline and pressing C-c C-x p (org-set-property).

  • Exactly what I was looking for. Thanks! – chasely Jun 6 '17 at 2:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.