emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Akater <nuclearspace@gmail.com>
To: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Cc: emacs-orgmode@gnu.org
Subject: Re: Trivial bug in ox-latex
Date: Thu, 01 Feb 2018 14:50:22 +0000	[thread overview]
Message-ID: <874ln0ahn5.fsf@gmail.com> (raw)
In-Reply-To: <87o9l9ye01.fsf@nicolasgoaziou.fr>

[-- Attachment #1: Type: text/plain, Size: 1369 bytes --]

Nicolas Goaziou <mail@nicolasgoaziou.fr> 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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 800 bytes --]

  reply	other threads:[~2018-02-01 14:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-31 20:01 Trivial bug in ox-latex Akater
2018-01-31 20:22 ` Nicolas Goaziou
2018-02-01 14:50   ` Akater [this message]
2018-02-03 13:57     ` Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874ln0ahn5.fsf@gmail.com \
    --to=nuclearspace@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=mail@nicolasgoaziou.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).