From: Bastien Guerry <bzg@altern.org>
To: emacs-orgmode@gnu.org
Subject: [Accepted] Allow mixed export of numbered and unnumbered sections in LaTeX
Date: Wed, 23 Mar 2011 15:04:33 +0100 (CET) [thread overview]
Message-ID: <20110323140433.D3C1C715E@myhost.localdomain> (raw)
In-Reply-To: m3aagn2pi7.fsf_-_@e4300lm.epcc.ed.ac.uk
Patch 710 (http://patchwork.newartisans.com/patch/710/) is now "Accepted".
Maintainer comment: none
This relates to the following submission:
http://mid.gmane.org/%3Cm3aagn2pi7.fsf_-_%40e4300lm.epcc.ed.ac.uk%3E
Here is the original message containing the patch:
> Content-Type: text/plain; charset="utf-8"
> MIME-Version: 1.0
> Content-Transfer-Encoding: 7bit
> Subject: [O] Allow mixed export of numbered and unnumbered sections in LaTeX
> Date: Tue, 22 Mar 2011 19:26:14 -0000
> From: Lawrence Mitchell <wence@gmx.li>
> X-Patchwork-Id: 710
> Message-Id: <m3aagn2pi7.fsf_-_@e4300lm.epcc.ed.ac.uk>
> To: emacs-orgmode@gnu.org
>
> * lisp/org-latex.el (org-export-latex-subcontent): Deal specially with
> the case that NUM is an integer.
>
> We would sometimes like to have numbered \sections in LaTeX export but
> unnumbered \subsections and so forth. That is, use the starred
> equivalents for all sectioning commands below a certain level.
> Previously, the num: option specification could only specify whether
> sections should be numbered or unnumbered at all levels. We now treat
> an integer value specially, if num:N is supplied then the highest N
> levels are numbered, and lower levels are exported without numbering.
>
> ---
> lisp/org-latex.el | 7 ++++++-
> 1 files changed, 6 insertions(+), 1 deletions(-)
>
> [...]
> Wouldn't it be nice if #+OPTIONS: num:2 exported
> \section{foo}
> \subsection{bar}
> \subsubsection*{baz}
>
> It turns out the patch is relatively straightforward. I haven't
> included a doc update, but could do so if required.
>
> diff --git a/lisp/org-latex.el b/lisp/org-latex.el
> index fbdeb5e..7a3c629 100644
> --- a/lisp/org-latex.el
> +++ b/lisp/org-latex.el
> @@ -1151,7 +1151,9 @@ and its content."
>
> (defun org-export-latex-subcontent (subcontent num)
> "Export each cell of SUBCONTENT to LaTeX.
> -If NUM, export sections as numerical sections."
> +If NUM is non-nil export numbered sections, otherwise use unnumbered
> +sections. If NUM is an integer, export the highest NUM levels as
> +numbered sections and lower levels as unnumbered sections."
> (let* ((heading (cdr (assoc 'heading subcontent)))
> (level (- (cdr (assoc 'level subcontent))
> org-export-latex-add-level))
> @@ -1187,6 +1189,9 @@ If NUM, export sections as numerical sections."
> ;; Normal conversion
> ((<= level depth)
> (let* ((sec (nth (1- level) sectioning))
> + (num (if (integerp num)
> + (>= num level)
> + num))
> start end)
> (if (consp (cdr sec))
> (setq start (nth (if num 0 2) sec)
>
next prev parent reply other threads:[~2011-03-23 14:04 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-22 12:10 unnumbered subsections in latex export Suvayu Ali
2011-03-22 12:20 ` Sébastien Vauban
2011-03-22 12:31 ` Suvayu Ali
2011-03-22 12:56 ` Sébastien Vauban
2011-03-22 14:26 ` [PATCH] Allow mixed export of numbered and unnumbered sections in LaTeX Lawrence Mitchell
2011-03-22 22:52 ` Suvayu Ali
2011-03-23 14:04 ` Bastien Guerry [this message]
2011-03-23 14:17 ` Bastien
2011-03-22 14:35 ` Re: unnumbered subsections in latex export Nick Dokos
2011-03-22 23:08 ` Suvayu Ali
2011-03-22 23:21 ` Nick Dokos
2011-03-23 9:38 ` [PATCH] Allow mixed export of numbered and unnumbered sections in HTML Lawrence Mitchell
2011-03-23 14:05 ` [Accepted] " Bastien Guerry
2011-03-23 14:57 ` Nick Dokos
2011-03-23 15:50 ` Suvayu Ali
2011-03-23 14:18 ` Re: unnumbered subsections in latex export Bastien
2011-03-23 15:02 ` Nick Dokos
2011-03-23 16:25 ` Lawrence Mitchell
2011-03-23 16:42 ` Nick Dokos
2011-03-23 18:17 ` Jambunathan K
2011-03-23 19:00 ` Nick Dokos
2011-03-23 19:18 ` Jambunathan K
2011-03-23 16:29 ` Thomas S. Dye
2011-03-23 17:42 ` Jambunathan K
2011-03-24 7:59 ` Bastien
2011-03-24 18:27 ` Achim Gratz
2011-03-24 19:25 ` Nick Dokos
2011-03-25 1:06 ` Suvayu Ali
2011-04-04 14:39 ` Sébastien Vauban
2011-04-04 17:04 ` Nick Dokos
2011-04-04 20:32 ` Aankhen
2011-04-05 10:16 ` Sébastien Vauban
2011-04-05 19:07 ` Aankhen
2011-04-05 19:27 ` Eric S Fraga
2011-04-05 21:25 ` New features for the exporters? Sébastien Vauban
2011-04-05 21:45 ` Re: unnumbered subsections in latex export Aankhen
2011-04-06 18:49 ` Matt Lundin
2011-04-06 20:19 ` Sébastien Vauban
2011-03-27 11:16 ` Jambunathan K
2011-03-27 11:40 ` Bastien
2011-03-31 21:58 ` Nicolas
2011-04-01 4:34 ` Jambunathan K
2011-04-01 4:41 ` Jambunathan K
2011-04-01 6:29 ` Nick Dokos
2011-04-01 15:41 ` Eric S Fraga
2011-04-04 14:00 ` Matt Lundin
2011-04-04 14:12 ` Jambunathan K
2011-04-04 16:36 ` Matt Lundin
2011-04-04 17:09 ` Nick Dokos
2011-04-01 7:39 ` Jambunathan K
2011-04-01 18:25 ` Achim Gratz
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=20110323140433.D3C1C715E@myhost.localdomain \
--to=bzg@altern.org \
--cc=emacs-orgmode@gnu.org \
/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).