emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <carsten.dominik@gmail.com>
To: Nicolas Goaziou <n.goaziou@gmail.com>
Cc: Emacs help <emacs-orgmode@gnu.org>,
	nicholas.dokos@hp.com, Marius Hofert <marius.hofert@math.ethz.ch>
Subject: Re: How to get numbered lists (1), (2), … ?
Date: Fri, 14 Oct 2011 14:14:23 +0200	[thread overview]
Message-ID: <367FB6B9-C653-47C0-BBD9-02A665402353@gmail.com> (raw)
In-Reply-To: <87zkh3lsgy.fsf@gmail.com>


On 14.10.2011, at 13:31, Nicolas Goaziou wrote:

> Hello,
> 
> Nick Dokos <nicholas.dokos@hp.com> writes:
> 
>> Marius Hofert <marius.hofert@math.ethz.ch> wrote:
>> 
>> 
>>> What do you mean by "better solution"? As far as I can tell, your
>>> approach is precisely what Suvayu pointed to.
>> 
>> No: what Suvayu pointed to can be done with the standard latex exporter,
>> so it would not require changes to org-list-generic-to-latex. Just add
>> something like this at the top of your org file:
>> 
>> #+LATEX: \renewcommand{\theenumi}{(\arabic{enumi})}
>> 
>> It's better in that it is simpler. There are drawbacks however: the
>> above produces lists like this:
>> 
>> (1). foo
>> (2). bar
>> 
>> with a period after the closing paren.
>> 
>>> Using your approach, of course much more is possible, please look at
>>> the create "enumitem" package with all its customizations.
>>> 
>> 
>> That is true: which one is "better" depends on one's requirements (both
>> the desired output and how much pain one is willing to suffer in order
>> to get there).
>> 
>>> But this approach is a no-go for me (at least at the moment) mainly
>>> due to the following reasons (please let me know if I'm wrong, I'm a
>>> total newbie to org-mode):
>> 
>>> 1) I have about 40 lists in one file. Having to put in special LaTeX
>>> commands is not an option (maybe on only has to type it in once, but
>>> then it can easily get overseen, e.g., when you move lists around and
>>> the one containing the LaTeX commands is not the first one in the
>>> document anymore)
>> 
>> That's no problem: the LATEX_HEADER line goes in once at the top
>> of the org file. You can move lists around at will.
>> 
>>> 2) org-mode is basically a "better" text-mode. I don't want to have
>>> LaTeX code in there if I print it as a .txt file.
>>> 
>>> Is there a solution without having to put #+LATEX_HEADER:
>>> \usepackage{enumerate} before each list? Can this be set anywhere in
>>> the preferences?
>>> 
>> 
>> You can customize the latex preamble that org adds to latex files to do
>> that. The disadvantage is that you get the modified preamble always.
>> See the org-export-latex-packages-alist variable for one way to do that.
>> 
>>> But I assume that I still have to put in lists in org-mode like this:
>>> 1.,2.,... or 1),2),... and can't put them in like this (1),(2),...?
>> 
>> Correct: that would require changes to org-list.el I think - but Nicolas
>> will have to say the final word on this. All the solutions so far work
>> by modifying the latex output only, not the way you enter the list into
>> the org file.
> 
> - On the Org part:
> 
>  I have nothing against (1) as item bullets, as it doesn't interfere
>  with any existing Org syntax.

That is not the only criterion.  Adding new syntax elements make more
ASCII sequences special.  The Org markup is a heuristic set of
special elements, and there is merrit in keeping it small.  We already
have more bullets and in particular numbered types - and so far
I have not seen a compelling reason to add more.

- Carsten

> I just think it shouldn't be available
>  by default (much like alphabetical ordered lists).
> 
>  The implementation isn't hard /per se/ (at least less changes are
>  required than implementing, for example, roman numbered lists), but
>  I also think there should be some cleanup with regards to item
>  bullets. So far, there is `org-plain-list-ordered-item-terminator' and
>  `org-alphabetical-lists' to tweak them. We should avoid adding a third
>  one.
> 
>  What about letting go those two variables and create
>  `org-list-bullet-types', which would be a list of strings like:
> 
>           '("-" "+" "*" "1." "1)" "(1)" "a." "a)" "A)" "A.")
> 
>  It would be hard-coded but every bullet type could be opt-in or
>  opt-out via customize. The default value should be as short as
>  possible like '("-" "+" "*" "1." "a.").
> 
>  I can work it out in a few days if we agree.
> 
> - On the LaTeX part:
> 
>  Most of the time, it's better to let LaTeX choose its bullets than
>  enforcing code produced to mimic Org buffer. In other words, a "(1)"
>  bullet should only mean "enumerate item" instead of "enumerate item
>  like (1)".
> 
>  Though, in the past months, I have been working on a overhaul of the
>  whole export system (as a part of a bigger project). If I ever finish
>  it, and if it ever hits Org core, the LaTeX back-end should make it
>  easier to use "inparaenum" and "paraitem" packages directly from Org
>  syntax (via #+attr_latex header).
> 
>  For now, I think solutions offered in this thread are sufficient, if
>  not practical.
> 
> 
> Regards,
> 
> -- 
> Nicolas Goaziou
> 

  parent reply	other threads:[~2011-10-14 12:14 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-13 19:10 How to get numbered lists (1), (2), … ? Nick Dokos
2011-10-13 20:00 ` Marius Hofert
2011-10-13 20:28   ` Nick Dokos
2011-10-14 11:31     ` Nicolas Goaziou
2011-10-14 12:05       ` Jambunathan K
2011-10-14 12:24         ` suvayu ali
2011-10-14 12:37         ` Marius Hofert
2011-10-14 12:14       ` Carsten Dominik [this message]
2011-10-15 14:14         ` Eric S Fraga
2011-10-15 14:21           ` Marius Hofert
2011-10-15 15:35           ` Bernt Hansen
2011-10-15 15:56           ` Carsten Dominik
2011-10-16 15:16             ` Eric S Fraga
2011-10-13 20:02 ` Alan E. Davis
2011-10-13 20:44   ` Nick Dokos
  -- strict thread matches above, loose matches on Subject: below --
2011-10-13  9:11 Marius Hofert
2011-10-13  9:37 ` suvayu ali
2011-10-13 15:26   ` Marius Hofert
2011-10-13 18:31     ` suvayu ali

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=367FB6B9-C653-47C0-BBD9-02A665402353@gmail.com \
    --to=carsten.dominik@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=marius.hofert@math.ethz.ch \
    --cc=n.goaziou@gmail.com \
    --cc=nicholas.dokos@hp.com \
    /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).