From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Beck Subject: org-latex-classes with functions, incomplete doc Date: Sun, 10 Feb 2013 17:09:53 +0100 Message-ID: <87txpkrvzi.fsf@sophokles.streitblatt.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:60243) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U4ZTs-0002aS-B0 for emacs-orgmode@gnu.org; Sun, 10 Feb 2013 11:10:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U4ZTl-0007On-EA for emacs-orgmode@gnu.org; Sun, 10 Feb 2013 11:10:13 -0500 Received: from mo6-p00-ob.rzone.de ([2a01:238:20a:202:5300::1]:63749) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U4ZTl-0007E3-5E for emacs-orgmode@gnu.org; Sun, 10 Feb 2013 11:10:09 -0500 Received: from flo-laptop ([89.204.137.177]) by smtp.strato.de (josoe mo43) (RZmta 31.14 DYNA|AUTH) with (DHE-RSA-AES128-SHA encrypted) ESMTPA id Q023cbp1AF5luP for ; Sun, 10 Feb 2013 17:09:59 +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.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi, the docstring for `org-latex-classes' says: "Instead of a list of sectioning commands, you can also specify a function name. That function will be called with two parameters, the (reduced) level of the headline, and a predicate non-nil when the headline should be numbered. It must return a format string in which the section title will be added." This is wrong. The way this function is called in `org-latex-headline' requires it to return a string with TWO format specifiers, e.g. "\section{%%s}%%s\n", the second where the CONTENT of the section is being added. Maybe `org-latex-headline' should add "%%s\n" itself =E2=80=93= as it does for other cases? Also, I'm using this to add an optional argument to my sections. Can I expect this to work? (i.e. being called in a context where the variables `info' and `headline' are defined?) #+BEGIN_SRC emacs-lisp (defun fb/latex-sections (level numbered) (let* ((level (1- level)) (sec-name (nth level fb/latex-section-names)) (sec (when sec-name (format "\\%s%s%s{%%s}\n%%s" sec-name (if numbered "" "*") ;; "" (or (when (plist-get info :toc-title) (let ((toc-title (org-element-property :toc= -title headline))) (when toc-title (format "[%s]" toc-title)= ))) "") )))) sec)) #+END_SRC Org-mode version 7.9.3e (7.9.3e-961-g521d47 @ /home/flo/.emacs.d/org-mode/l= isp/) --=20 Florian Beck