1

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
:PROPERTIES:
:DATE_TREE:
:END:
** 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

\chapter{2016}
\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?

1 Answer 1

4

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
           '("book-noparts"
              "\\documentclass{book}"
              ("\\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).

1
  • Exactly what I was looking for. Thanks!
    – chasely
    Jun 6, 2017 at 2:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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