From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: =?UTF-8?B?UmU6IEhvdyB0byBnZXQgbnVtYmVyZWQgbGlzdHMgKDEpLCAoMiks?= =?UTF-8?B?IOKApiA/?= Date: Thu, 13 Oct 2011 16:44:56 -0400 Message-ID: <8172.1318538696@alphaville.americas.hpqcorp.net> References: <5133.1318533018@alphaville.americas.hpqcorp.net> Reply-To: nicholas.dokos@hp.com Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:59815) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RESB2-0001FF-JL for emacs-orgmode@gnu.org; Thu, 13 Oct 2011 16:46:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RESB1-0001IG-5S for emacs-orgmode@gnu.org; Thu, 13 Oct 2011 16:46:52 -0400 Received: from g5t0008.atlanta.hp.com ([15.192.0.45]:25102) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RESB0-0001IA-S6 for emacs-orgmode@gnu.org; Thu, 13 Oct 2011 16:46:51 -0400 In-Reply-To: Message from "Alan E. Davis" of "Thu\, 13 Oct 2011 13\:02\:50 PDT." 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: "Alan E. Davis" Cc: Marius Hofert , Emacs help , nicholas.dokos@hp.com Alan E. Davis wrote: > Without diving into how to set it up in org-mode, the paralist package fo= r LaTeX enables inline numbered lists, as in >=20 > %% In preamble > \usepackage{paralist} >=20 > %% In document > \begin{inparaenum} > =C2=A0=C2=A0 \item first element > =C2=A0 \item second element > \end{inparaenum} >=20 > As to how to organize this to be an option for org-mode without incorpora= ting above into the setup, I would also be interested.=C2=A0=C2=A0 >=20 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-ostar= t :oend ,o-e-l-l-s-oend :ustart .....) ...[ some way to reevaluate the above variable if any of its components cha= nge - does custom provide anything like that?? ]... (defun org-list-to-latex (...) ... (org-combine-plists org-export-latex-list-settings params) ... > Alan >=20 > On Thu, Oct 13, 2011 at 12:10 PM, Nick Dokos wrot= e: >=20 > [ I started this earlier but I guess I didn't send it out. Suvayu has > =C2=A0replied in the meantime with a pointer to a better solution tha= n this > =C2=A0one, but this might be of some minor interest to some people as= well - > =C2=A0besides, I spent a whole 20 minutes on it, half of it trying to= figure > =C2=A0out why my mail was not working :-( : why let that effort go to > =C2=A0waste?:-) ] >=20 > Marius Hofert wrote: >=20=20=20=20 > > Dear Suvayu, > > > > thanks. > > It would be good to know how latex export can be customized to achi= eve this. > > >=20=20=20=20 > Depends on how much customization you are willing to go through: ther= e is an > enumerate.sty package in LaTeX that can do that: >=20=20=20=20 > --8<---------------cut here---------------start------------->8--- > ... > \usepackage{enumerate} > ... > \begin{enumerate}[(1)] > \item foo > \item bar > \end{enumerate} > ... > --8<---------------cut here---------------start------------->8--- >=20=20=20=20 > Inserting the \usepackage from the org file is no problem: >=20=20=20=20 > --8<---------------cut here---------------end--------------->8--- > #+LATEX_HEADER: \usepackage{enumerate} > ... > --8<---------------cut here---------------end--------------->8--- >=20 > 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): >=20=20=20=20 > --8<---------------cut here---------------start------------->8--- > (require 'org-list) >=20=20=20=20 > (defun org-list-to-latex (list &optional params) > =C2=A0"Convert LIST into a LaTeX list. > LIST is as returned by `org-list-parse-list'. =C2=A0PARAMS is a prope= rty list > with overruling parameters for `org-list-to-generic'." > =C2=A0(org-list-to-generic > =C2=A0 list > =C2=A0 (org-combine-plists > =C2=A0 =C2=A0'(:splice nil :ostart "\\begin{enumerate}[(1)]\n" :oend = "\\end{enumerate}" > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 :ustart "\\begin{ite= mize}\n" :uend "\\end{itemize}" > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 :dstart "\\begin{des= cription}\n" :dend "\\end{description}" > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 :dtstart "[" :dtend = "] " > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 :istart "\\item " :i= end "\n" > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 :icount (let ((enum = (nth depth '("i" "ii" "iii" "iv")))) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 (if enum > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; LaTeX increments counter just before > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; using it, so set it to the desired > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; value, minus one. > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 (format "\\setcounter{enum%s}{%s}\n\\item " > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 enum (1- counter)) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 "\\item ")) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 :csep "\n" > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 :cbon "\\texttt{[X]}= " :cboff "\\texttt{[ ]}" > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 :cbtrans "$\\boxminu= s$") > =C2=A0 =C2=A0params))) > --8<---------------cut here---------------end--------------->8--- >=20=20=20=20 > The only change is the definition of :ostart. Not a very flexible met= hod, > but it will serve in a pinch. ngz et al. might have better ideas. >=20=20=20=20 > 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=3D= enumerate - > but afaict they would all require some rewiring of the above function= , similar > to the above. >=20=20=20=20 > Nick >=20=20=20=20 > > 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 googl= e 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 exp= orted > > > file. > > > > > > I hope this helps. > > > > > >> Cheers, > > >> > > >> Marius > > >> > > > > > > > > > > > > -- > > > Suvayu > > > > > > Open source is the future. It sets us free. > > > > > > >=20 >=20 > ---------------------------------------------------- > Alternatives: >=20 > ----------------------------------------------------