Hi again,

I updated the texlive to 2023 and can produce a pdf with the following snippets inside the https://github.com/asilata/emacsconf2021/ggm.org:

** Org LaTeX setup
#+latex_class: kaobook
#+latex_class_options: [openany, a5paper]
#+latex_header: \usepackage{amsmath,amssymb,amsthm,geometry,hyperref,paralist,svg,thmtools,tikz,tikz-cd}
#+latex_header: \usepackage{mathtools}
#+latex_header: \usepackage[capitalise,noabbrev]{cleveref}
#+latex_header: \usepackage{environ} \NewEnviron{abmn}{\marginnote{\BODY}}
#+latex_header: \setcounter{tocdepth}{1}
#+latex_header: \newtheorem{theorem}{Theorem}
#+latex_header: \newtheorem{example}[theorem]{Example}
#+latex_header: \newtheorem{exmpl}[theorem]{Example}
#+latex_header: \newtheorem{definition}[theorem]{Definition}
#+latex_header: \newtheorem{proposition}[theorem]{Proposition}
#+latex_header: \newtheorem{lemma}[theorem]{Lemma}
#+latex_header: \newtheorem{exercise}[theorem]{Exercise}
#+latex_header: \usetikzlibrary{arrows,automata,positioning}
** Export settings
Export into the artifacts directory
#+export_file_name: artifacts/ggm

Add ~kaobook~ to ~org-latex-classes~ and update ~org-latex-pdf-process~.
#+name: export-setup
#+begin_src emacs-lisp :results silent :var this-year="2023"
  (add-to-list 'org-latex-classes
               `("kaobook"
                 ,(string-join
                   '("\\documentclass{kaobook}"
                     "\\usepackage{color}"
                     "\\usepackage{amsmath,amssymb}")
                   "\n")
                 ("\\chapter{%s}" . "\\chapter*{%s}")
                 ("\\section{%s}" . "\\section*{%s}")
                 ("\\subsection{%s}" . "\\subsection*{%s}")
                 ("\\paragraph{%s}" . "\\paragraph*{%s}")
                 ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))

However, the pdf did not inherit all the kaobook template features like:
  1. Mini table of contents in the margin at the start of each chapter.
  2. Chapter headings.
  3. Huge chapter number with a vertical line
Any input will be appreciated to render the file that looks like https://github.com/fmarotta/kaobook/blob/master/example_and_documentation.pdf or https://github.com/tudelft3d/terrainbook/releases/latest.

Thank you in advance,
/z

On Mon, Aug 7, 2023 at 1:55 PM Christian Moe <mail@christianmoe.com> wrote:


Hi,

For starters, have you added the kaobook document class to the variable
org-latex-classes? (If yes, ignore the rest of this message, if not, do
so and see what happens.)

This is needed to tell Org how to set the document class and what commands
are used for sections. See the manual 13.10.2 and 13.10.3,
[[info:org#LaTeX specific export settings]] and [[info:org#LaTeX header
and sectioning]], and look up the docstring for org-latex-classes if you
need help.

E.g., in .emacs I have this for Tufte-Latex:

(add-to-list 'org-latex-classes
             '("tufte-handout" "\\documentclass[11pt,a4paper]{tufte-handout}"
               ("\\section{%s}" . "\\section*{%s}")
               ("\\subsection{%s}" . "\\subsection*{%s}")))

(add-to-list 'org-latex-classes
             '("tufte-book" "\\documentclass[11pt,a5paper,nols]{tufte-book}"
               ("\\part{%s}" . "\\part*{%s}")
               ("\\section{%s}" . "\\section*{%s}")
               ("\\subsection{%s}" . "\\subsection*{%s}")
               ("\\paragraph{%s}" . "\\paragraph*{%s}")))

Yours,
Christian


Zenny writes:

> Hi,
>
> References of interest:
> 1. https://github.com/fmarotta/kaobook
> 2. https://github.com/asilata/emacsconf2021
>
> Can anyone guide me how to get a self-contained and portable template that
> executes kaobook tex templates (see 1) to create an org-file that resembles
> with the instance in 2 above?
>
> I tried the best I can by adding the kaobook.cls and kaobook.sty files
> inside `~/texmf/tex/latex/kaobook/` folder and specified 'kaobook' in the
> `#+latex_class: kaobook` but it failed to produce the desired look of pdf
> similar to
> https://github.com/fmarotta/kaobook/blob/master/example_and_documentation.pdf
> withing the same examples directory!
>
> Any input appreciated!
>
> Cheers and have a nice week,
> /z