From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marius Hofert Subject: =?UTF-8?B?UmU6IEhvdyB0byBnZXQgbnVtYmVyZWQgbGlzdHMgKDEpLCAoMiks?= =?UTF-8?B?IOKApiA/?= Date: Thu, 13 Oct 2011 22:00:36 +0200 Message-ID: <3414CE30-6774-4566-9391-D6929BDC4C87@math.ethz.ch> References: <5133.1318533018@alphaville.americas.hpqcorp.net> Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:49805) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RERSL-0004mi-WB for emacs-orgmode@gnu.org; Thu, 13 Oct 2011 16:00:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RERSK-0000Ti-AV for emacs-orgmode@gnu.org; Thu, 13 Oct 2011 16:00:41 -0400 Received: from edge10.ethz.ch ([82.130.75.186]:30928) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RERSK-0000Td-22 for emacs-orgmode@gnu.org; Thu, 13 Oct 2011 16:00:40 -0400 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: Emacs help Dear Nick, thanks for helping.=20 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.=20 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?=20 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.=20 Cheers, Marius On 2011-10-13, at 21:10 , Nick Dokos wrote: >=20 > [ 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?:-) ] >=20 >=20 > Marius Hofert wrote: >=20 >> Dear Suvayu, >>=20 >> thanks.=20 >> It would be good to know how latex export can be customized to = achieve this. >>=20 >=20 > Depends on how much customization you are willing to go through: there = is an > enumerate.sty package in LaTeX that can do that: >=20 > --8<---------------cut here---------------start------------->8--- > ... > \usepackage{enumerate} > ... > \begin{enumerate}[(1)] > \item foo > \item bar > \end{enumerate} > ... > --8<---------------cut here---------------start------------->8--- >=20 > Inserting the \usepackage from the org file is no problem: >=20 > --8<---------------cut here---------------end--------------->8--- > #+LATEX_HEADER: \usepackage{enumerate} > ... > --8<---------------cut here---------------end--------------->8--- >=20 >=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 > --8<---------------cut here---------------start------------->8--- > (require 'org-list) >=20 > (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--- >=20 > The only change is the definition of :ostart. Not a very flexible = method,=20 > but it will serve in a pinch. ngz et al. might have better ideas. >=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=3Denumerate - > but afaict they would all require some rewiring of the above function, = similar > to the above. >=20 > Nick >=20 >> Cheers, >>=20 >> Marius >>=20 >> On 2011-10-13, at 11:37 , suvayu ali wrote: >>=20 >>> On Thu, Oct 13, 2011 at 11:11 AM, Marius Hofert >>> wrote: >>>> Dear all, >>>>=20 >>>> 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. >>>>=20 >>>=20 >>> 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. >>>=20 >>> I hope this helps. >>>=20 >>>> Cheers, >>>>=20 >>>> Marius >>>>=20 >>>=20 >>>=20 >>>=20 >>> --=20 >>> Suvayu >>>=20 >>> Open source is the future. It sets us free. >>=20 >>=20 >>=20