emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* 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/)]
@ 2020-03-28 16:12 Lukas Juhrich
  2020-03-29 14:02 ` Nicolas Goaziou
  0 siblings, 1 reply; 2+ messages in thread
From: Lukas Juhrich @ 2020-03-28 16:12 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 11756 bytes --]


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#org09a8ac4


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
=================
When exporting a latex buffer (or file or compiled pdf), `Paragraph a`
should be exported as `\paragraph{Paragraph a}`.

Observed behavior
=================
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={},
 pdftitle={},
 pdfkeywords={},
 pdfsubject={},
 pdfcreator={Emacs 26.3 (Org mode 9.1.9)},
 pdflang={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
====

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:
==============
(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-function
 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-default
 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"
 )


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-03-29 14:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-28 16:12 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/)] Lukas Juhrich
2020-03-29 14:02 ` Nicolas Goaziou

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).