Re: [O] How to get numbered lists (1), (2), … ?

2011-10-16 Thread Eric S Fraga
Carsten Dominik  writes:

> On 15.10.2011, at 16:14, Eric S Fraga wrote:
>
>> Carsten Dominik  writes:
>> 
>>> On 14.10.2011, at 13:31, Nicolas Goaziou wrote:
>> 
>> [...]
>> 
>>> 
 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 am in the "keep it simple school".  So long as org allows me to
>> distinguish between numbered and unnumbered itemised lists, I am
>> happy.  I actually would prefer less choices than there are currently
>> because I would like to get to my choice more quickly when I do use
>> C-c - to change the type!
>> 
>> To me, org is about information and time management, not about
>> formatting.  YMMV, of course!
>> 
>> To be blunt, I would be happy with "-" and "1." in org, knowing that I
>> can customise upon export if necessary!  I'm not suggesting we go this
>> far, however ;-)
>
> Since backward compatibility is necessary, this counts as a vote for a
> customizable sequence, as proposed by Nicolas, do I see this right?
>
> So maybe this *is* a good idea, but I would be agains adding new list
> types.

I guess I was voting without realising that I was ;-)  I'm happy with
things as they are but definitely would have no problem with a
customisable list, one that I would tend to shorten!

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.90.1
: using Org-mode version 7.7 (release_7.7.381.g05ea)



Re: [O] How to get numbered lists (1), (2), … ?

2011-10-15 Thread Carsten Dominik

On 15.10.2011, at 16:14, Eric S Fraga wrote:

> Carsten Dominik  writes:
> 
>> On 14.10.2011, at 13:31, Nicolas Goaziou wrote:
> 
> [...]
> 
>> 
>>> 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 am in the "keep it simple school".  So long as org allows me to
> distinguish between numbered and unnumbered itemised lists, I am
> happy.  I actually would prefer less choices than there are currently
> because I would like to get to my choice more quickly when I do use
> C-c - to change the type!
> 
> To me, org is about information and time management, not about
> formatting.  YMMV, of course!
> 
> To be blunt, I would be happy with "-" and "1." in org, knowing that I
> can customise upon export if necessary!  I'm not suggesting we go this
> far, however ;-)

Since backward compatibility is necessary, this counts as a vote for a
customizable sequence, as proposed by Nicolas, do I see this right?

So maybe this *is* a good idea, but I would be agains adding new list types.

- Carsten

> 
> -- 
> : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.90.1
> : using Org-mode version 7.7 (release_7.7.381.g05ea)




Re: [O] How to get numbered lists (1), (2), … ?

2011-10-15 Thread Bernt Hansen
Eric S Fraga  writes:

> I am in the "keep it simple school".  So long as org allows me to
> distinguish between numbered and unnumbered itemised lists, I am
> happy.  I actually would prefer less choices than there are currently
> because I would like to get to my choice more quickly when I do use
> C-c - to change the type!

You can switch (a little faster) with S-right and S-left arrows anywhere
on the list item.

HTH,
Bernt



Re: [O] How to get numbered lists (1), (2), … ?

2011-10-15 Thread Marius Hofert
I'm 100% with Eric, just that I would say "-" and "(1)" are enough.

On 2011-10-15, at 16:14 , Eric S Fraga wrote:

> Carsten Dominik  writes:
> 
>> On 14.10.2011, at 13:31, Nicolas Goaziou wrote:
> 
> [...]
> 
>> 
>>> 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 am in the "keep it simple school".  So long as org allows me to
> distinguish between numbered and unnumbered itemised lists, I am
> happy.  I actually would prefer less choices than there are currently
> because I would like to get to my choice more quickly when I do use
> C-c - to change the type!
> 
> To me, org is about information and time management, not about
> formatting.  YMMV, of course!
> 
> To be blunt, I would be happy with "-" and "1." in org, knowing that I
> can customise upon export if necessary!  I'm not suggesting we go this
> far, however ;-)
> 
> -- 
> : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.90.1
> : using Org-mode version 7.7 (release_7.7.381.g05ea)

ETH Zurich
Dr. Marius Hofert
RiskLab, Department of Mathematics
HG E 65.2
Rämistrasse 101
8092 Zurich
Switzerland

Phone +41 44 632 2423
marius.hof...@math.ethz.ch
http://www.math.ethz.ch/~hofertj




Re: [O] How to get numbered lists (1), (2), … ?

2011-10-15 Thread Eric S Fraga
Carsten Dominik  writes:

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

[...]

> 
>>  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 am in the "keep it simple school".  So long as org allows me to
distinguish between numbered and unnumbered itemised lists, I am
happy.  I actually would prefer less choices than there are currently
because I would like to get to my choice more quickly when I do use
C-c - to change the type!

To me, org is about information and time management, not about
formatting.  YMMV, of course!

To be blunt, I would be happy with "-" and "1." in org, knowing that I
can customise upon export if necessary!  I'm not suggesting we go this
far, however ;-)

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.90.1
: using Org-mode version 7.7 (release_7.7.381.g05ea)



Re: [O] How to get numbered lists (1), (2), … ?

2011-10-14 Thread Marius Hofert
Hi all,

I am quite impressed by this discussion, thanks a lot.
I am an org-mode user for just a couple of days, and an emacs user for four 
weeks today. Needless to say, I can't contribute anything useful to this 
discussion. 
The only thing(s) I would like to say is/are:
(1) If it is not too complicated from a technical point of view, I would 
strongly recommend to enable lists like (1), (2), etc.  I gave some reasons in 
one of my earlier e-mails in this thread. There are many more (from a 
typography point of view, but also from a technical point of view [e.g., if you 
have auto-pairing of parentheses enabled, it's just more convenient.]). 
(2) From a LaTeX point of view, I am sure the experts here (and I mean everyone 
in this thread except me) know the LaTeX package "enumitem". It gives the 
greatest flexibility of creating lists I know of and behaves better in many 
circumstances than other enumerate-like environments. So I can only recommend 
using this approach for making lists (in which way this is possible/desirable I 
can't tell since I'm not an org-mode expert).

I will certainly become a heavy org-mode user in the next months/years. Lists 
like (1), (2),... I would definitely use a lot.

Cheers,

Marius


On 2011-10-14, at 14:05 , Jambunathan K wrote:

> 
>>  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.
> 
> What percentage of users (OK, not percentage of users but numbers of
> users) you think will *actually* exercise the opt-in and opt-out
> configuration if provided?
> 
> If the number of hands raised is in single digits, I would assume that
> it is more of a niche feature and let go of it.
> 
> Is it psychologically very taxing to see 1. instead of a (1) in an Org
> buffer. Could it be so taxing that a user's productivity will be
> impacted by it?
> 
> Or 
> 
> Is it that more varieties of bullets is needed for creating "rich"
> deeply nested lists so that each level of the list can take on a
> different bullet for better differentiation.
> -- 





Re: [O] How to get numbered lists (1), (2), … ?

2011-10-14 Thread suvayu ali
Hi everyone,

On Fri, Oct 14, 2011 at 2:05 PM, Jambunathan K  wrote:
> Is it psychologically very taxing to see 1. instead of a (1) in an Org
> buffer. Could it be so taxing that a user's productivity will be
> impacted by it?
>

For my personal use I don't care much as long as there are
ordered/enumerated and unordered/plain lists to choose from, after all
only the exported file is for public consumption. :) However I
strongly feel _against_ the '*' syntax. Its too close to a headline.
It is also unusable if one chooses not to use indentation for the text
under a headline (e.g. below). I often prefer this as deeply nested
(say, level 4) headlines often start to run out of columns due to
wrapping.

** Heading

Some list
* list item 1
* list item 2

> Or
>
> Is it that more varieties of bullets is needed for creating "rich"
> deeply nested lists so that each level of the list can take on a
> different bullet for better differentiation.

This is pretty much the reason I switch list types. Something like:

1) some broad point
   + Case 1
 - comment on something of note
   + Case 2
2) another broad point

That said, I would probably use the customize option.

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] How to get numbered lists (1), (2), … ?

2011-10-14 Thread Carsten Dominik

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

> Hello,
> 
> Nick Dokos  writes:
> 
>> Marius Hofert  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
> 




Re: [O] How to get numbered lists (1), (2), … ?

2011-10-14 Thread Jambunathan K

>   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.

What percentage of users (OK, not percentage of users but numbers of
users) you think will *actually* exercise the opt-in and opt-out
configuration if provided?

If the number of hands raised is in single digits, I would assume that
it is more of a niche feature and let go of it.

Is it psychologically very taxing to see 1. instead of a (1) in an Org
buffer. Could it be so taxing that a user's productivity will be
impacted by it?

Or 

Is it that more varieties of bullets is needed for creating "rich"
deeply nested lists so that each level of the list can take on a
different bullet for better differentiation.
-- 



Re: [O] How to get numbered lists (1), (2), … ?

2011-10-14 Thread Nicolas Goaziou
Hello,

Nick Dokos  writes:

> Marius Hofert  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. 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



Re: [O] How to get numbered lists (1), (2), … ?

2011-10-13 Thread Nick Dokos
Alan E. Davis  wrote:

> Without diving into how to set it up in org-mode, the paralist package for 
> LaTeX enables inline numbered lists, as in
> 
> %% In preamble
> \usepackage{paralist}
> 
> %% In document
> \begin{inparaenum}
>    \item first element
>   \item second element
> \end{inparaenum}
> 
> As to how to organize this to be an option for org-mode without incorporating 
> above into the setup, I would also be interested.  
> 

The method described below can of course accomplish this: you need to
change the :ostart and :oend settings. It's also fairly easy to define
customizable variables for all of this, but that is left as an exercise
to the interested reader... Nicolas might be interested in anything you
come up with.

Nick

Hint (entirely untested):

(defcustom o-e-l-l-s-ostart "\begin{enumerate}\n" ...)
(defcustom o-e-l-l-s-oend ...)
...

(setq org-export-latex-list-settings `(:splice nil :ostart ,o-e-l-l-s-ostart 
:oend ,o-e-l-l-s-oend
   :ustart .)

...[ some way to reevaluate the above variable if any of its components change 
- does custom provide anything like that?? ]...

(defun org-list-to-latex (...)
   ...
   (org-combine-plists
org-export-latex-list-settings
params)
   ...


> Alan
> 
> On Thu, Oct 13, 2011 at 12:10 PM, Nick Dokos  wrote:
> 
> [ I started this earlier but I guess I didn't send it out. Suvayu has
>  replied in the meantime with a pointer to a better solution than this
>  one, but this might be of some minor interest to some people as well -
>  besides, I spent a whole 20 minutes on it, half of it trying to figure
>  out why my mail was not working :-( : why let that effort go to
>  waste?:-) ]
> 
> Marius Hofert  wrote:
>
> > Dear Suvayu,
> >
> > thanks.
> > It would be good to know how latex export can be customized to achieve 
> this.
> >
>
> Depends on how much customization you are willing to go through: there is 
> an
> enumerate.sty package in LaTeX that can do that:
>
> --8<---cut here---start->8---
> ...
> \usepackage{enumerate}
> ...
> \begin{enumerate}[(1)]
> \item foo
> \item bar
> \end{enumerate}
> ...
> --8<---cut here---start->8---
>
> Inserting the \usepackage from the org file is no problem:
>
> --8<---cut here---end--->8---
> #+LATEX_HEADER: \usepackage{enumerate}
> ...
> --8<---cut here---end--->8---
> 
> Getting the argument to the enumerate environment in the right place is
> another matter. I think the only way is to redefine 
> org-list-generic-to-latex
> like this (add this to your initialization file, .emacs or whatever, 
> after you
> load org):
>
> --8<---cut here---start->8---
> (require 'org-list)
>
> (defun org-list-to-latex (list &optional params)
>  "Convert LIST into a LaTeX list.
> LIST is as returned by `org-list-parse-list'.  PARAMS is a property list
> with overruling parameters for `org-list-to-generic'."
>  (org-list-to-generic
>   list
>   (org-combine-plists
>    '(:splice nil :ostart "\\begin{enumerate}[(1)]\n" :oend 
> "\\end{enumerate}"
>               :ustart "\\begin{itemize}\n" :uend "\\end{itemize}"
>               :dstart "\\begin{description}\n" :dend "\\end{description}"
>               :dtstart "[" :dtend "] "
>               :istart "\\item " :iend "\n"
>               :icount (let ((enum (nth depth '("i" "ii" "iii" "iv"
>                         (if enum
>                             ;; LaTeX increments counter just before
>                             ;; using it, so set it to the desired
>                             ;; value, minus one.
>                             (format "\\setcounter{enum%s}{%s}\n\\item "
>                                     enum (1- counter))
>                           "\\item "))
>               :csep "\n"
>               :cbon "\\texttt{[X]}" :cboff "\\texttt{[ ]}"
>               :cbtrans "$\\boxminus$")
>    params)))
> --8<---cut here---end--->8---
>
> The only change is the definition of :ostart. Not a very flexible method,
> but it will serve in a pinch. ngz et al. might have better ideas.
>
> I should say that there are other ways to customize enumeration labels
> in LaTeX - see e.g. 
> http://www.tex.ac.uk/cgi-bin/texfaq2html?label=enumerate -
> but afaict they would all require some rewiring of the above function, 
> similar
> to the above.
>
> Nick
>
> > Cheers,
> >
> > Marius
> >
> > On 2011-10-13, at 11:37 , suvayu ali wrote:
> >
> > > On Thu, Oct 13, 2011 at

Re: [O] How to get numbered lists (1), (2), … ?

2011-10-13 Thread Nick Dokos
Marius Hofert  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.

Nick

> Hmm... this is indeed a drawback. The latter lists a far better
> visible, they are more consistent with respect to other list types
> such as (i), (ii), etc., and ultimately also with respect to numbering
> of equations. There are probably even more typographic reasons to
> display lists like this. For example, if you refer to a list within a
> theorem environment (which has a label itself) and you use 1.,
> 2.,... lists, then this looks like this:

> Theorem 1.2 2. shows that ...

> The eye hardly sees that one means Theorem 1.2 Part (2). Even worse,
> when reading this, one thinks that the sentence stops after "2.". It's
> really a bad thing, and not getting much better with right-sided
> parentheses.
> 
> Cheers,
> 
> Marius
> 
> On 2011-10-13, at 21:10 , Nick Dokos wrote:
> 
> > 
> > [ I started this earlier but I guess I didn't send it out. Suvayu has
> >  replied in the meantime with a pointer to a better solution than this
> >  one, but this might be of some minor interest to some people as well -
> >  besides, I spent a whole 20 minutes on it, half of it trying to figure
> >  out why my mail was not working :-( : why let that effort go to
> >  waste?:-) ]
> > 
> > 
> > Marius Hofert  wrote:
> > 
> >> Dear Suvayu,
> >> 
> >> thanks. 
> >> It would be good to know how latex export can be customized to achieve 
> >> this.
> >> 
> > 
> > Depends on how much customization you are willing to go through: there is an
> > enumerate.sty package in LaTeX that can do that:
> > 
> > --8<---cut here---start->8---
> > ...
> > \usepackage{enumerate}
> > ...
> > \begin{enumerate}[(1)]
> > \item foo
> > \item bar
> > \end{enumerate}
> > ...
> > --8<---cut here---start->8---
> > 
> > Inserting the \usepackage from the org file is no problem:
> > 
> > --8<---cut here---end--->8---
> > #+LATEX_HEADER: \usepackage{enumerate}
> > ...
> > --8<---cut here---end--->8---
> > 
> > 
> > Getting the argument to the enumerate environment in the right place is
> > another matter. I think the only way is to redefine 
> > org-list-generic-to-latex
> > like this (add this to your initialization file, .emacs or whatever, after 
> > you
> > load org):
> > 
> > --8<---cut here---start->8---
> > (require 'org-list)
> > 
> > (defun org-list-to-latex (list &optional params)
> >  "Convert LIST into a LaTeX list.
> > LIST is as returned by `org-list-parse-list'.  PARAMS is a property list
> > with overruling parameters for `org-list-to-generic'."
> >  (org-list-to-generic
> >   list
> >   (org-com

Re: [O] How to get numbered lists (1), (2), … ?

2011-10-13 Thread Alan E. Davis
Without diving into how to set it up in org-mode, the paralist package for
LaTeX enables inline numbered lists, as in

%% In preamble
\usepackage{paralist}


%% In document
\begin{inparaenum}
   \item first element
  \item second element
\end{inparaenum}

As to how to organize this to be an option for org-mode without
incorporating above into the setup, I would also be interested.

Alan

On Thu, Oct 13, 2011 at 12:10 PM, Nick Dokos  wrote:

>
> [ I started this earlier but I guess I didn't send it out. Suvayu has
>  replied in the meantime with a pointer to a better solution than this
>  one, but this might be of some minor interest to some people as well -
>  besides, I spent a whole 20 minutes on it, half of it trying to figure
>  out why my mail was not working :-( : why let that effort go to
>  waste?:-) ]
>
>
> Marius Hofert  wrote:
>
> > Dear Suvayu,
> >
> > thanks.
> > It would be good to know how latex export can be customized to achieve
> this.
> >
>
> Depends on how much customization you are willing to go through: there is
> an
> enumerate.sty package in LaTeX that can do that:
>
> --8<---cut here---start->8---
> ...
> \usepackage{enumerate}
> ...
> \begin{enumerate}[(1)]
> \item foo
> \item bar
> \end{enumerate}
> ...
> --8<---cut here---start->8---
>
> Inserting the \usepackage from the org file is no problem:
>
> --8<---cut here---end--->8---
> #+LATEX_HEADER: \usepackage{enumerate}
> ...
> --8<---cut here---end--->8---
>
>
> Getting the argument to the enumerate environment in the right place is
> another matter. I think the only way is to redefine
> org-list-generic-to-latex
> like this (add this to your initialization file, .emacs or whatever, after
> you
> load org):
>
> --8<---cut here---start->8---
> (require 'org-list)
>
> (defun org-list-to-latex (list &optional params)
>  "Convert LIST into a LaTeX list.
> LIST is as returned by `org-list-parse-list'.  PARAMS is a property list
> with overruling parameters for `org-list-to-generic'."
>  (org-list-to-generic
>   list
>   (org-combine-plists
>'(:splice nil :ostart "\\begin{enumerate}[(1)]\n" :oend
> "\\end{enumerate}"
>   :ustart "\\begin{itemize}\n" :uend "\\end{itemize}"
>   :dstart "\\begin{description}\n" :dend "\\end{description}"
>   :dtstart "[" :dtend "] "
>   :istart "\\item " :iend "\n"
>   :icount (let ((enum (nth depth '("i" "ii" "iii" "iv"
> (if enum
> ;; LaTeX increments counter just before
> ;; using it, so set it to the desired
> ;; value, minus one.
> (format "\\setcounter{enum%s}{%s}\n\\item "
> enum (1- counter))
>   "\\item "))
>   :csep "\n"
>   :cbon "\\texttt{[X]}" :cboff "\\texttt{[ ]}"
>   :cbtrans "$\\boxminus$")
>params)))
> --8<---cut here---end--->8---
>
> The only change is the definition of :ostart. Not a very flexible method,
> but it will serve in a pinch. ngz et al. might have better ideas.
>
> I should say that there are other ways to customize enumeration labels
> in LaTeX - see e.g.
> http://www.tex.ac.uk/cgi-bin/texfaq2html?label=enumerate -
> but afaict they would all require some rewiring of the above function,
> similar
> to the above.
>
> Nick
>
> > Cheers,
> >
> > Marius
> >
> > On 2011-10-13, at 11:37 , suvayu ali wrote:
> >
> > > On Thu, Oct 13, 2011 at 11:11 AM, Marius Hofert
> > >  wrote:
> > >> Dear all,
> > >>
> > >> In the manual, I found that numbered lists can be created with 1), 2),
> ... or 1., 2., ...
> > >> How can I get numbered lists like this: (1), (2),...?
> > >> I found org-list-demote-modify-bullet, but the help (and a google
> search) did not help me in finding a solution to this.
> > >>
> > >
> > > I don't think you can. But you can customise latex export (maybe even
> > > html export, but I don't know) to show lists like that in the exported
> > > file.
> > >
> > > I hope this helps.
> > >
> > >> Cheers,
> > >>
> > >> Marius
> > >>
> > >
> > >
> > >
> > > --
> > > Suvayu
> > >
> > > Open source is the future. It sets us free.
> >
> >
> >
>
>


Re: [O] How to get numbered lists (1), (2), … ?

2011-10-13 Thread Marius Hofert
Dear Nick,

thanks for helping. 

What do you mean by "better solution"? As far as I can tell, your approach is 
precisely what Suvayu pointed to. Using your approach, of course much more is 
possible, please look at the create "enumitem" package with all its 
customizations. 

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)
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? 

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),...?
Hmm... this is indeed a drawback. The latter lists a far better visible, they 
are more consistent with respect to other list types such as (i), (ii), etc., 
and ultimately also with respect to numbering of equations. There are probably 
even more typographic reasons to display lists like this. For example, if you 
refer to a list within a theorem environment (which has a label itself) and you 
use 1., 2.,... lists, then this looks like this:
Theorem 1.2 2. shows that ...
The eye hardly sees that one means Theorem 1.2 Part (2). Even worse, when 
reading this, one thinks that the sentence stops after "2.". It's really a bad 
thing, and not getting much better with right-sided parentheses. 

Cheers,

Marius

On 2011-10-13, at 21:10 , Nick Dokos wrote:

> 
> [ I started this earlier but I guess I didn't send it out. Suvayu has
>  replied in the meantime with a pointer to a better solution than this
>  one, but this might be of some minor interest to some people as well -
>  besides, I spent a whole 20 minutes on it, half of it trying to figure
>  out why my mail was not working :-( : why let that effort go to
>  waste?:-) ]
> 
> 
> Marius Hofert  wrote:
> 
>> Dear Suvayu,
>> 
>> thanks. 
>> It would be good to know how latex export can be customized to achieve this.
>> 
> 
> Depends on how much customization you are willing to go through: there is an
> enumerate.sty package in LaTeX that can do that:
> 
> --8<---cut here---start->8---
> ...
> \usepackage{enumerate}
> ...
> \begin{enumerate}[(1)]
> \item foo
> \item bar
> \end{enumerate}
> ...
> --8<---cut here---start->8---
> 
> Inserting the \usepackage from the org file is no problem:
> 
> --8<---cut here---end--->8---
> #+LATEX_HEADER: \usepackage{enumerate}
> ...
> --8<---cut here---end--->8---
> 
> 
> Getting the argument to the enumerate environment in the right place is
> another matter. I think the only way is to redefine org-list-generic-to-latex
> like this (add this to your initialization file, .emacs or whatever, after you
> load org):
> 
> --8<---cut here---start->8---
> (require 'org-list)
> 
> (defun org-list-to-latex (list &optional params)
>  "Convert LIST into a LaTeX list.
> LIST is as returned by `org-list-parse-list'.  PARAMS is a property list
> with overruling parameters for `org-list-to-generic'."
>  (org-list-to-generic
>   list
>   (org-combine-plists
>'(:splice nil :ostart "\\begin{enumerate}[(1)]\n" :oend "\\end{enumerate}"
>  :ustart "\\begin{itemize}\n" :uend "\\end{itemize}"
>  :dstart "\\begin{description}\n" :dend "\\end{description}"
>  :dtstart "[" :dtend "] "
>  :istart "\\item " :iend "\n"
>  :icount (let ((enum (nth depth '("i" "ii" "iii" "iv"
>(if enum
>;; LaTeX increments counter just before
>;; using it, so set it to the desired
>;; value, minus one.
>(format "\\setcounter{enum%s}{%s}\n\\item "
>enum (1- counter))
>  "\\item "))
>  :csep "\n"
>  :cbon "\\texttt{[X]}" :cboff "\\texttt{[ ]}"
>  :cbtrans "$\\boxminus$")
>params)))
> --8<---cut here---end--->8---
> 
> The only change is the definition of :ostart. Not a very flexible method, 
> but it will serve in a pinch. ngz et al. might have better ideas.
> 
> I should say that there are other ways to customize enumeration labels
> in LaTeX - see e.g. http://www.tex.ac.uk/cgi-bin/texfaq2html?label=enumerate -
> but afaict they would all 

Re: [O] How to get numbered lists (1), (2), … ?

2011-10-13 Thread Nick Dokos

[ I started this earlier but I guess I didn't send it out. Suvayu has
  replied in the meantime with a pointer to a better solution than this
  one, but this might be of some minor interest to some people as well -
  besides, I spent a whole 20 minutes on it, half of it trying to figure
  out why my mail was not working :-( : why let that effort go to
  waste?:-) ]


Marius Hofert  wrote:

> Dear Suvayu,
> 
> thanks. 
> It would be good to know how latex export can be customized to achieve this.
> 

Depends on how much customization you are willing to go through: there is an
enumerate.sty package in LaTeX that can do that:

--8<---cut here---start->8---
...
\usepackage{enumerate}
...
\begin{enumerate}[(1)]
\item foo
\item bar
\end{enumerate}
...
--8<---cut here---start->8---

Inserting the \usepackage from the org file is no problem:

--8<---cut here---end--->8---
#+LATEX_HEADER: \usepackage{enumerate}
...
--8<---cut here---end--->8---


Getting the argument to the enumerate environment in the right place is
another matter. I think the only way is to redefine org-list-generic-to-latex
like this (add this to your initialization file, .emacs or whatever, after you
load org):

--8<---cut here---start->8---
(require 'org-list)

(defun org-list-to-latex (list &optional params)
  "Convert LIST into a LaTeX list.
LIST is as returned by `org-list-parse-list'.  PARAMS is a property list
with overruling parameters for `org-list-to-generic'."
  (org-list-to-generic
   list
   (org-combine-plists
'(:splice nil :ostart "\\begin{enumerate}[(1)]\n" :oend "\\end{enumerate}"
   :ustart "\\begin{itemize}\n" :uend "\\end{itemize}"
   :dstart "\\begin{description}\n" :dend "\\end{description}"
   :dtstart "[" :dtend "] "
   :istart "\\item " :iend "\n"
   :icount (let ((enum (nth depth '("i" "ii" "iii" "iv"
 (if enum
 ;; LaTeX increments counter just before
 ;; using it, so set it to the desired
 ;; value, minus one.
 (format "\\setcounter{enum%s}{%s}\n\\item "
 enum (1- counter))
   "\\item "))
   :csep "\n"
   :cbon "\\texttt{[X]}" :cboff "\\texttt{[ ]}"
   :cbtrans "$\\boxminus$")
params)))
--8<---cut here---end--->8---

The only change is the definition of :ostart. Not a very flexible method, 
but it will serve in a pinch. ngz et al. might have better ideas.

I should say that there are other ways to customize enumeration labels
in LaTeX - see e.g. http://www.tex.ac.uk/cgi-bin/texfaq2html?label=enumerate -
but afaict they would all require some rewiring of the above function, similar
to the above.

Nick

> Cheers,
> 
> Marius
> 
> On 2011-10-13, at 11:37 , suvayu ali wrote:
> 
> > On Thu, Oct 13, 2011 at 11:11 AM, Marius Hofert
> >  wrote:
> >> Dear all,
> >> 
> >> In the manual, I found that numbered lists can be created with 1), 2), ... 
> >> or 1., 2., ...
> >> How can I get numbered lists like this: (1), (2),...?
> >> I found org-list-demote-modify-bullet, but the help (and a google search) 
> >> did not help me in finding a solution to this.
> >> 
> > 
> > I don't think you can. But you can customise latex export (maybe even
> > html export, but I don't know) to show lists like that in the exported
> > file.
> > 
> > I hope this helps.
> > 
> >> Cheers,
> >> 
> >> Marius
> >> 
> > 
> > 
> > 
> > -- 
> > Suvayu
> > 
> > Open source is the future. It sets us free.
> 
> 
> 



Re: [O] How to get numbered lists (1), (2), … ?

2011-10-13 Thread suvayu ali
Hi Marius,

On Thu, Oct 13, 2011 at 5:26 PM, Marius Hofert
 wrote:
> Dear Suvayu,
>
> thanks.
> It would be good to know how latex export can be customized to achieve this.
>

This thread might be helpful:


-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] How to get numbered lists (1), (2), … ?

2011-10-13 Thread Marius Hofert
Dear Suvayu,

thanks. 
It would be good to know how latex export can be customized to achieve this.

Cheers,

Marius

On 2011-10-13, at 11:37 , suvayu ali wrote:

> On Thu, Oct 13, 2011 at 11:11 AM, Marius Hofert
>  wrote:
>> Dear all,
>> 
>> In the manual, I found that numbered lists can be created with 1), 2), ... 
>> or 1., 2., ...
>> How can I get numbered lists like this: (1), (2),...?
>> I found org-list-demote-modify-bullet, but the help (and a google search) 
>> did not help me in finding a solution to this.
>> 
> 
> I don't think you can. But you can customise latex export (maybe even
> html export, but I don't know) to show lists like that in the exported
> file.
> 
> I hope this helps.
> 
>> Cheers,
>> 
>> Marius
>> 
> 
> 
> 
> -- 
> Suvayu
> 
> Open source is the future. It sets us free.





Re: [O] How to get numbered lists (1), (2), … ?

2011-10-13 Thread suvayu ali
On Thu, Oct 13, 2011 at 11:11 AM, Marius Hofert
 wrote:
> Dear all,
>
> In the manual, I found that numbered lists can be created with 1), 2), ... or 
> 1., 2., ...
> How can I get numbered lists like this: (1), (2),...?
> I found org-list-demote-modify-bullet, but the help (and a google search) did 
> not help me in finding a solution to this.
>

I don't think you can. But you can customise latex export (maybe even
html export, but I don't know) to show lists like that in the exported
file.

I hope this helps.

> Cheers,
>
> Marius
>



-- 
Suvayu

Open source is the future. It sets us free.



[O] How to get numbered lists (1), (2), … ?

2011-10-13 Thread Marius Hofert
Dear all,

In the manual, I found that numbered lists can be created with 1), 2), ... or 
1., 2., ...
How can I get numbered lists like this: (1), (2),...?
I found org-list-demote-modify-bullet, but the help (and a google search) did 
not help me in finding a solution to this.

Cheers,

Marius