From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lukas Juhrich Subject: Bug: Latex-Export does not respect custom latex section hierarchy [9.1.9 (release_9.1.9-65-g5e4542 @ /usr/share/emacs/26.3/lisp/org/)] Date: Sat, 28 Mar 2020 17:12:16 +0100 Message-ID: <85bc603a-cdca-c001-85a7-f7c5ac3a1950@agdsn.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="QKHQrsqHnQNdJncKImCxKjnVXyZfbzGls" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:44450) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jIE4f-000853-8D for emacs-orgmode@gnu.org; Sat, 28 Mar 2020 12:12:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jIE4c-0002Vo-Lr for emacs-orgmode@gnu.org; Sat, 28 Mar 2020 12:12:40 -0400 Received: from mx0.agdsn.tu-dresden.de ([141.76.119.135]:46940) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jIE4c-0002TK-A1 for emacs-orgmode@gnu.org; Sat, 28 Mar 2020 12:12:38 -0400 Received: from imap0.agdsn.network (imap-ng.agdsn.network [10.10.119.157]) by mx0.agdsn.tu-dresden.de (Postfix) with ESMTPS id 5E9831E1C1 for ; Sat, 28 Mar 2020 17:12:28 +0100 (CET) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --QKHQrsqHnQNdJncKImCxKjnVXyZfbzGls Content-Type: multipart/mixed; boundary="c1Fc6ALxXzDlEZCECILwTTfzS3LWjMOVn" --c1Fc6ALxXzDlEZCECILwTTfzS3LWjMOVn Content-Type: text/plain; charset=utf-8 Content-Language: en-US-large Content-Transfer-Encoding: quoted-printable Following the manual[1], I wanted to extend `org-latex-classes` to support `paragraph` as a fourth level instead of enumerating. However, everything after the third entry in an `org-latex-classes` entry is ignored. [1] https://orgmode.org/worg/org-tutorials/org-latex-export.html#org09a8a= c4 The MWE looks as follows (don't forget to C-c on the emacs-lisp block): ```org #+name: setup #+begin_src emacs-lisp :results silent :exports none (unless (find "per-file-class" org-latex-classes :key 'car :test 'equal)) (add-to-list 'org-latex-classes '("per-file-class" "\\documentclass{scrartcl} [NO-DEFAULT-PACKAGES] [EXTRA]" ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}") ("\\paragraph{%s}" . "\\paragraph*{%s}") ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))) #+end_src #+LATEX_CLASS: per-file-class * Test ** sub *** subsub **** Paragraph a This is a test! ``` Expected behavior =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D When exporting a latex buffer (or file or compiled pdf), `Paragraph a` should be exported as `\paragraph{Paragraph a}`. Observed behavior =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D It is exported as an `\item` in an enumerated list: ```latex % Created 2020-03-28 Sa 17:06 % Intended LaTeX compiler: pdflatex \documentclass{scrartcl} \date{\today} \title{} \hypersetup{ pdfauthor=3D{}, pdftitle=3D{}, pdfkeywords=3D{}, pdfsubject=3D{}, pdfcreator=3D{Emacs 26.3 (Org mode 9.1.9)}, pdflang=3D{English}} \begin{document} \tableofcontents \section{Test} \label{sec:org95b2e92} \subsection{sub} \label{sec:org59c5bb4} \subsubsection{subsub} \label{sec:org3d1fda1} \begin{enumerate} \item Paragraph a \label{sec:org6fb5426} This is a test! \end{enumerate} \end{document} ``` Rest =3D=3D=3D=3D Emacs : GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.= 10) of 2019-08-29 Package: Org mode version 9.1.9 (release_9.1.9-65-g5e4542 @ /usr/share/emacs/26.3/lisp/org/) current state: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (setq org-src-mode-hook '(org-src-babel-configure-edit-buffer org-src-mode-configure-edit-buffer) org-after-todo-state-change-hook '(org-clock-out-if-current) org-metadown-hook '(org-babel-pop-to-session-maybe) org-clock-out-hook '(org-clock-remove-empty-clock-drawer) org-html-format-inlinetask-function 'org-html-format-inlinetask-default-function org-latex-default-packages-alist '(("AUTO" "inputenc" t) ("T1" "fontenc" t) ("" "fixltx2e" nil) ("" "graphicx" t) ("" "grffile" t) ("" "longtable" nil) ("" "wrapfig" nil) ("" "rotating" nil) ("normalem" "ulem" t) ("" "amsmath" t) ("" "textcomp" t) ("" "amssymb" t) ("" "capt-of" nil) ("" "hyperref" nil) ("" "commath" nil)) org-odt-format-headline-function 'org-odt-format-headline-default-functi= on org-agenda-files '("~/org/official.org" "~/org/ag/sipa.org" "~/org/ag/ag.org" "~/org/misc.org" "~/org/phy.org" "~/org/agenda-enabled/") org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-defaul= t org-modules '(org-habit org-w3m org-bbdb org-bibtex org-docview org-gnus org-info org-irc org-mhe org-rmail) org-shiftup-final-hook '(windmove-up) org-mode-hook '(org-clock-load (lambda nil (if (member (quote ("scrartcl" "\\documentclass{scrartcl}" ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}") ("\\paragraph{%s}" . "\\paragraph*{%s}") ("\\subparagraph{%s}" . "\\subparagraph*{%s}")) ) org-latex-classes) org-latex-classes (setq org-latex-classes (cons (quote ("scrartcl" "\\documentclass{scrartcl}" ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}") ("\\paragraph{%s}" . "\\paragraph*{%s}") ("\\subparagraph{%s}" . "\\subparagraph*{%s}")) ) org-latex-classes) ) ) ) org-bullets-mode er/add-org-mode-expansions #[0 "\300\301\302\303\304$\207" [add-hook change-major-mode-hook org-show-block-all append local] 5] #[0 "\300\301\302\303\304$\207" [add-hook change-major-mode-hook org-babel-show-result-all append local] 5] org-babel-result-hide-spec org-babel-hide-all-hashes) org-clock-persist 'history org-odt-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)= "] org-archive-hook '(org-attach-archive-delete-maybe) org-confirm-elisp-link-function 'yes-or-no-p org-startup-with-inline-images t org-agenda-before-write-hook '(org-agenda-add-entry-text) org-metaup-hook '(org-babel-load-in-session-maybe) org-startup-with-latex-preview t org-bibtex-headline-format-function #[257 "\300\236A\207" [:title] 3 "\n\n(fn ENTRY)"] org-latex-format-drawer-function #[514 "\207" [] 3 "\n\n(fn _ CONTENTS)"= ] org-shiftdown-final-hook '(windmove-down) org-babel-pre-tangle-hook '(save-buffer) org-tab-first-hook '(org-babel-hide-result-toggle-maybe org-babel-header-arg-expand) org-babel-load-languages '((python . t) (shell . t) (emacs-lisp . t)) org-shiftright-final-hook '(windmove-right) org-log-done 'time org-ascii-format-drawer-function #[771 "\207" [] 4 "\n\n(fn NAME CONTENTS WIDTH)"] org-src-preserve-indentation t org-occur-hook '(org-first-headline-recenter) outline-minor-mode-hook '(mediawiki-outline-magic-keys) org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers org-cycle-show-empty-lines org-optimize-window-after-visibility-change) org-todo-keywords '((sequence "TODO(t)" "IN PROGRESS(p)" "|" "DONE(d!)") (sequence "|" "CANCELED(c@)")) org-speed-command-hook '(org-speed-command-activate org-babel-speed-command-activate) org-preview-latex-process-alist '((dvipng :programs ("latex" "dvipng") :description "dvi > png" :message "you need to install the programs: latex and dvipng." :image-input-type "dvi" :image-output-type "png" :image-size-adjust (1.2 . 1.2) :latex-compiler ("latex -interaction nonstopmode -output-directory %o %f") :image-converter ("dvipng -fg %F -bg %B -D %D -T tight -o %O %f")) (dvisvgm :programs ("latex" "dvisvgm") :description "dvi > svg" :message "you need to install the programs: latex and dvisvgm." :use-xcolor t :image-input-type "dvi" :image-output-type "svg" :image-size-adjust (1.7 . 1.5) :latex-compiler ("latex -interaction nonstopmode -output-directory %o %f") :image-converter ("dvisvgm %f -n -b min -c %S -o %O")) (imagemagick :programs ("latex" "convert") :description "pdf > png" :message "you need to install the programs: latex and imagemagick." :use-xcolor t :image-input-type "pdf" :image-output-type "png" :image-size-adjust (1.0 . 1.0) :latex-compiler ("pdflatex -interaction nonstopmode -output-directory %o %f") :image-converter ("convert -density %D -trim -antialias %f -quality 100 %O")) ) org-odt-format-inlinetask-function 'org-odt-format-inlinetask-default-function org-shiftleft-final-hook '(windmove-left) org-babel-tangle-lang-exts '(("python" . "py") ("emacs-lisp" . "el") ("elisp" . "el")) org-confirm-shell-link-function 'yes-or-no-p org-link-parameters '(("id" :follow org-id-open) ("rmail" :follow org-rmail-open :store org-rmail-store-link) ("mhe" :follow org-mhe-open :store org-mhe-store-link) ("irc" :follow org-irc-visit :store org-irc-store-link) ("info" :follow org-info-open :export org-info-export :store org-info-store-link) ("gnus" :follow org-gnus-open :store org-gnus-store-link) ("docview" :follow org-docview-open :export org-docview-export :store org-docview-store-link) ("bibtex" :follow org-bibtex-open :store org-bibtex-store-link) ("bbdb" :follow org-bbdb-open :export org-bbdb-export :complete org-bbdb-complete-link :store org-bbdb-store-link) ("w3m" :store org-w3m-store-link) ("file+sys") ("file+emacs") ("doi" :follow org--open-doi-link) ("elisp" :follow org--open-elisp-link) ("file" :complete org-file-complete-link) ("ftp" :follow (lambda (path) (browse-url (concat "ftp:" path)))) ("help" :follow org--open-help-link) ("http" :follow (lambda (path) (browse-url (concat "http:" path)))) ("https" :follow (lambda (path) (browse-url (concat "https:" path)))) ("mailto" :follow (lambda (path) (browse-url (concat "mailto:" path)))) ("news" :follow (lambda (path) (browse-url (concat "news:" path)))) ("shell" :follow org--open-shell-link)) org-latex-format-headline-function 'org-latex-format-headline-default-function org-tag-faces '(("exam" :foreground "red" :weight bold :underline f)) org-latex-format-inlinetask-function 'org-latex-format-inlinetask-default-function org-html-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS= )"] org-latex-classes '(("per-file-class" "\\documentclass{scrartcl}\n [NO-DEFAULT-PACKAGES]\n [EXTRA]" ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}") ("\\paragraph{%s}" . "\\paragraph*{%s}") ("\\subparagraph{%s}" . "\\subparagraph*{%s}")) ("scrartcl" "\\documentclass{scrartcl}" ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}") ("\\paragraph{%s}" . "\\paragraph*{%s}") ("\\subparagraph{%s}" . "\\subparagraph*{%s}")) ("article" "\\documentclass{article}" ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}") ("\\paragraph{%s}" . "\\paragraph*{%s}") ("\\subparagraph{%s}" . "\\subparagraph*{%s}")) ) org-html-format-headline-function 'org-html-format-headline-default-function org-agenda-custom-commands '(("n" "Agenda and all TODOs" ((agenda "" nil) (alltodo "" nil)) nil)) org-use-speed-commands t org-default-notes-file "~/org/notes.org" ) --c1Fc6ALxXzDlEZCECILwTTfzS3LWjMOVn-- --QKHQrsqHnQNdJncKImCxKjnVXyZfbzGls Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEE3QCqs6yuxXQYa75s0E/gpNcYVd4FAl5/d2AACgkQ0E/gpNcY Vd6uYQ/+KC0CQ+ApJdAgLQkQDAaJl0+hvUviylf2YODONIAUbwmK130ZoJOPtfe3 s1jLIT1YkjtXg1no5HlJJVBouZ94Zs4hZT5MjqTRR1zQ/Ur+SbRb0RPfDBsrwHT6 Kus/LdmphW1I3u+iwsjslLzKoIfgtehMsUjCsJ0UkRAS/qY2fjKKGiiqC4zs4wIu 7SlXpaAMhVWn7Q0LJ00MmEGKMH3+WTdCDdMOcxOiPZqEyHf2km9jINg1UExEdqyK T6OBiCjDcfB7tJnbbp2ecMKaWPsYFY4sbwunkbpRKr59ix9xZ9C7PRChfyLVqDA1 RuwG3/9mxjKhPtSdR2p7oMBjklfZX1cwSl4dJ1z2xPSiAU00P0mf0yrsPhrWOUy3 pgm0vk6qpPKVFWtpa3CCUf54fVhxT3d/pCvCoykmuaP5nrXh9iwjQZYKI6cQXfdQ 2CAJuxkn4u8faLqOyky3Z7q/T2ztyVFaHAt5hhCqbVMwudqS2E7j4dz6FY5d30ph Sl6tMqhgjaML5G+J/SbFf506jwrJ/riXS8r6uVjYD0Vf6fgsDyysm068JmsMFQTi W2kGggf/BSgpWItQyJUXwJawuYGfB+xXlneszvZKApuJL2QVBIMmc5NK7F27eAWI nBMzpQHEuClH6jGT6o0ODkobfiiCAnmsd6FgJDqvEHh7eQSw8To= =9UaT -----END PGP SIGNATURE----- --QKHQrsqHnQNdJncKImCxKjnVXyZfbzGls--