emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Trivial bug in ox-latex


From: Akater
Subject: Re: [O] Trivial bug in ox-latex
Date: Thu, 01 Feb 2018 14:50:22 +0000

Nicolas Goaziou <address@hidden> writes:

>> When depth is -1, wholenump form evaluates to nil, and setcounter
>> command is not exported at all.
>
> I don't think it's a bug. Org doesn't pretend to support every LaTeX
> feature. Setting `org-export-with-toc', which is where DEPTH comes from,
> to -1 doesn't make much sense in an Org context, does it?

I can't answer this as I do not deal with org-export-with-toc
directly. I was setting tocdepth via
org-export-filter-options-functions, specialized explicitly to latex
backend:

#+begin_src emacs-lisp
(defun my-consistent-toc (plist backend)
  (cond     
    ((equal backend 'latex) 
     (plist-put plist :with-toc -1))
     ;; other backend-specific settings
  )
  plist)
(add-to-list 'org-export-filter-options-functions 'my-consistent-toc)
#+end_src

I was able to achieve the desired outcome with
#+LATEX_HEADER: \setcounter{tocdepth}{-1}

If this is not considered a bug, fine then. However, this is confusing
behaviour at best, and given the rich functionality of filter-options
and friends, I don't see why it should silently fail here.

Lots of possible settings don't make sense. In my most humble opinion,
this sort of ad hoc type-checking—preventing valid document to be
produced without any notice—doesn't feel like it fits a dynamic Lisp, or
Org-mode.

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]