From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Alan E. Davis" Subject: =?UTF-8?B?UmU6IEhvdyB0byBnZXQgbnVtYmVyZWQgbGlzdHMgKDEpLCAoMiks?= =?UTF-8?B?IOKApiA/?= Date: Thu, 13 Oct 2011 13:02:50 -0700 Message-ID: References: <5133.1318533018@alphaville.americas.hpqcorp.net> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=0016e65c8dda3bf47f04af33a1f2 Return-path: Received: from eggs.gnu.org ([140.186.70.92]:48377) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RERUn-0005Nn-SA for emacs-orgmode@gnu.org; Thu, 13 Oct 2011 16:03:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RERUm-000174-2p for emacs-orgmode@gnu.org; Thu, 13 Oct 2011 16:03:13 -0400 Received: from mail-ww0-f49.google.com ([74.125.82.49]:34333) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RERUl-00016t-Nf for emacs-orgmode@gnu.org; Thu, 13 Oct 2011 16:03:12 -0400 Received: by wwg9 with SMTP id 9so119134wwg.30 for ; Thu, 13 Oct 2011 13:03:10 -0700 (PDT) In-Reply-To: <5133.1318533018@alphaville.americas.hpqcorp.net> 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: nicholas.dokos@hp.com Cc: Marius Hofert , Emacs help --0016e65c8dda3bf47f04af33a1f2 Content-Type: text/plain; charset=ISO-8859-1 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. > > > > > > > > --0016e65c8dda3bf47f04af33a1f2 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Without diving into how to set it up in org-mode, the paralist package for = LaTeX enables inline numbered lists, as in

%% In preamble
\usepac= kage{paralist}


%% In document
\begin{inparaenum}
=A0=A0 \i= tem first element
=A0 \item second element
\end{inparaenum}

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

Alan

On Thu, Oct 13, 2011 at 12:10 PM, Nick Dokos <nicholas.dokos@hp.com> wrot= e:

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


Marius Hofert <marius.hofe= rt@math.ethz.ch> 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: ther= e 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-lat= ex
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)
=A0"Convert LIST into a LaTeX list.
LIST is as returned by `org-list-parse-list'. =A0PARAMS is a property l= ist
with overruling parameters for `org-list-to-generic'."
=A0(org-list-to-generic
=A0 list
=A0 (org-combine-plists
=A0 =A0'(:splice nil :ostart "\\begin{enumerate}[(1)]\n" :oe= nd "\\end{enumerate}"
=A0 =A0 =A0 =A0 =A0 =A0 =A0 :ustart "\\begin{itemize}\n" :uend &= quot;\\end{itemize}"
=A0 =A0 =A0 =A0 =A0 =A0 =A0 :dstart "\\begin{description}\n" :de= nd "\\end{description}"
=A0 =A0 =A0 =A0 =A0 =A0 =A0 :dtstart "[" :dtend "] " =A0 =A0 =A0 =A0 =A0 =A0 =A0 :istart "\\item " :iend "\n&quo= t;
=A0 =A0 =A0 =A0 =A0 =A0 =A0 :icount (let ((enum (nth depth '("i&q= uot; "ii" "iii" "iv"))))
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (if enum
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ;; LaTeX increment= s counter just before
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ;; using it, so se= t it to the desired
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ;; value, minus on= e.
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (format "\\se= tcounter{enum%s}{%s}\n\\item "
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 en= um (1- counter))
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "\\item "))<= br> =A0 =A0 =A0 =A0 =A0 =A0 =A0 :csep "\n"
=A0 =A0 =A0 =A0 =A0 =A0 =A0 :cbon "\\texttt{[X]}" :cboff "\= \texttt{[ ]}"
=A0 =A0 =A0 =A0 =A0 =A0 =A0 :cbtrans "$\\boxminus$")
=A0 =A0params)))
--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=3Denumerate -
but afaict they would all require some rewiring of the above function, simi= lar
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
> > <marius.hofert@m= ath.ethz.ch> wrote:
> >> Dear all,
> >>
> >> In the manual, I found that numbered lists can be created wit= h 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 go= ogle search) did not help me in finding a solution to this.
> >>
> >
> > I don't think you can. But you can customise latex export (ma= ybe 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.
>
>
>


--0016e65c8dda3bf47f04af33a1f2--