emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-list-allow-alphabetical LaTeX export
@ 2013-06-06  8:20 Michael Bach
  2013-06-06  8:52 ` Carsten Dominik
  0 siblings, 1 reply; 17+ messages in thread
From: Michael Bach @ 2013-06-06  8:20 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 618 bytes --]

The LaTeX exporter does not honor the setting of
org-list-allow-alphabetical.  It exports ordered alphabetical list as
standard enumerate environment with numbered items.

org-mode 8.0.3

I placed the setq before loading ox-latex.  I read in the docstring that
org-list-allow-alphabetical should be set before org.el is loaded.  I
installed org-plus-contrib from ELPA and thus do not manually load org.el.

I found a post on this ml [1] on a related issue where the OP states that
doing the setq before loading the exporter solved his issue.

[1] https://lists.gnu.org/archive/html/emacs-orgmode/2013-04/msg01843.html

[-- Attachment #2: Type: text/html, Size: 853 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: org-list-allow-alphabetical LaTeX export
  2013-06-06  8:20 org-list-allow-alphabetical LaTeX export Michael Bach
@ 2013-06-06  8:52 ` Carsten Dominik
  2013-06-06  9:11   ` Michael Bach
  0 siblings, 1 reply; 17+ messages in thread
From: Carsten Dominik @ 2013-06-06  8:52 UTC (permalink / raw)
  To: Michael Bach; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1277 bytes --]


On 6 jun. 2013, at 10:20, Michael Bach <phaebz@gmail.com> wrote:

> The LaTeX exporter does not honor the setting of org-list-allow-alphabetical.  

I think it never did.  Such a list is just an ordered list for export, the bullet type is just visual sugar in the Org buffer.
To force a special bulllet type, you should use other means (literal LaTeX).  For example:

---------------------------------------------------------------
* test

1. skfkshafkj
2. fkjshfksj

#+LaTeX: {\renewcommand{\theenumi}{\alph{enumi}}

1. kajsfkjhf
2. fjsfksjhf

#+LaTeX: }

1. sss
2. ljhsdfkjh
---------------------------------------------------------------

I hope this helps.

- Carsten


> It exports ordered alphabetical list as standard enumerate environment with numbered items.
> 
> org-mode 8.0.3
> 
> I placed the setq before loading ox-latex.  I read in the docstring that org-list-allow-alphabetical should be set before org.el is loaded.  I installed org-plus-contrib from ELPA and thus do not manually load org.el.
> 
> I found a post on this ml [1] on a related issue where the OP states that doing the setq before loading the exporter solved his issue.
> 
> [1] https://lists.gnu.org/archive/html/emacs-orgmode/2013-04/msg01843.html
> 


[-- Attachment #2: Type: text/html, Size: 2197 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: org-list-allow-alphabetical LaTeX export
  2013-06-06  8:52 ` Carsten Dominik
@ 2013-06-06  9:11   ` Michael Bach
  2013-06-06  9:17     ` Carsten Dominik
  2013-06-06  9:23     ` Marcin Borkowski
  0 siblings, 2 replies; 17+ messages in thread
From: Michael Bach @ 2013-06-06  9:11 UTC (permalink / raw)
  To: emacs-orgmode

Carsten Dominik <carsten.dominik <at> gmail.com> writes:

>> On 6 jun. 2013, at 10:20, Michael Bach <phaebz <at> gmail.com> wrote:
>> The LaTeX exporter does not honor the setting of org-list-allow-
alphabetical.  
> 
> I think it never did.  Such a list is just an ordered list for export, the 
bullet type is just visual sugar in the Org buffer.
> To force a special bulllet type, you should use other means (literal 
LaTeX).  For example:
> 
> ---------------------------------------------------------------
> 
> * test
> 
> 1. skfkshafkj
> 2. fkjshfksj
> 
> #+LaTeX: {\renewcommand{\theenumi}{\alph{enumi}}
> 
> 1. kajsfkjhf
> 2. fjsfksjhf
> 
> #+LaTeX: }
> 
> 1. sss
> 2. ljhsdfkjh
> ---------------------------------------------------------------
> 

Oh, I never saw it handled by the exporter, just a wrong assumption.  Just 
out of curiosity, do you think this could be implemented 'easily'?

Thanks for clarification and example.

Michael

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: org-list-allow-alphabetical LaTeX export
  2013-06-06  9:11   ` Michael Bach
@ 2013-06-06  9:17     ` Carsten Dominik
  2013-06-06  9:27       ` Michael Bach
  2013-06-06 17:39       ` Josiah Schwab
  2013-06-06  9:23     ` Marcin Borkowski
  1 sibling, 2 replies; 17+ messages in thread
From: Carsten Dominik @ 2013-06-06  9:17 UTC (permalink / raw)
  To: Michael Bach; +Cc: emacs-orgmode


On 6 jun. 2013, at 11:11, Michael Bach <phaebz@gmail.com> wrote:

> Carsten Dominik <carsten.dominik <at> gmail.com> writes:
> 
>>> On 6 jun. 2013, at 10:20, Michael Bach <phaebz <at> gmail.com> wrote:
>>> The LaTeX exporter does not honor the setting of org-list-allow-
> alphabetical.  
>> 
>> I think it never did.  Such a list is just an ordered list for export, the 
> bullet type is just visual sugar in the Org buffer.
>> To force a special bulllet type, you should use other means (literal 
> LaTeX).  For example:
>> 
>> ---------------------------------------------------------------
>> 
>> * test
>> 
>> 1. skfkshafkj
>> 2. fkjshfksj
>> 
>> #+LaTeX: {\renewcommand{\theenumi}{\alph{enumi}}
>> 
>> 1. kajsfkjhf
>> 2. fjsfksjhf
>> 
>> #+LaTeX: }
>> 
>> 1. sss
>> 2. ljhsdfkjh
>> ---------------------------------------------------------------
>> 
> 
> Oh, I never saw it handled by the exporter, just a wrong assumption.  Just 
> out of curiosity, do you think this could be implemented 'easily'?


I guess it could be - but I am not sure if it should.  Conventions about the type of bullet to be used in a document belong to the typesetting side, and I rather establish a global setting for a document than follow my momentary decisions when I write the Org-mode version of it.  On a similar vein, we do have lists starting with - and * and +, but we still let LaTeX and HTML choose what to use as a bullet.  To me this feels like the right behavior.

- Carsten

> 
> Thanks for clarification and example.
> 
> Michael
> 
> 
> 

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: org-list-allow-alphabetical LaTeX export
  2013-06-06  9:11   ` Michael Bach
  2013-06-06  9:17     ` Carsten Dominik
@ 2013-06-06  9:23     ` Marcin Borkowski
  2013-06-06  9:33       ` Michael Bach
  1 sibling, 1 reply; 17+ messages in thread
From: Marcin Borkowski @ 2013-06-06  9:23 UTC (permalink / raw)
  To: emacs-orgmode

Dnia 2013-06-06, o godz. 09:11:11
Michael Bach <phaebz@gmail.com> napisał(a):

> Carsten Dominik <carsten.dominik <at> gmail.com> writes:
> 
> >> On 6 jun. 2013, at 10:20, Michael Bach <phaebz <at> gmail.com>
> >> wrote: The LaTeX exporter does not honor the setting of
> >> org-list-allow-
> alphabetical.  
> > 
> > I think it never did.  Such a list is just an ordered list for
> > export, the 
> bullet type is just visual sugar in the Org buffer.
> > To force a special bulllet type, you should use other means
> > (literal 
> LaTeX).  For example:
> > 
> > ---------------------------------------------------------------
> > 
> > * test
> > 
> > 1. skfkshafkj
> > 2. fkjshfksj
> > 
> > #+LaTeX: {\renewcommand{\theenumi}{\alph{enumi}}
> > 
> > 1. kajsfkjhf
> > 2. fjsfksjhf
> > 
> > #+LaTeX: }
> > 
> > 1. sss
> > 2. ljhsdfkjh
> > ---------------------------------------------------------------
> > 
> 
> Oh, I never saw it handled by the exporter, just a wrong assumption.
> Just out of curiosity, do you think this could be implemented
> 'easily'?

If you mean "easily" on the LaTeX side, then yes, check out the
"enumitem" package.  Example:

\documentclass{article}

\usepackage{enumitem}

\begin{document}

\begin{enumerate}[label={Item number \arabic*:}]
\item First.
\item Second.
\end{enumerate}

\end{document}

But definitely check out the docs for that package, it is really good,
and supports much more than this.

> Thanks for clarification and example.
> 
> Michael

Hth,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: org-list-allow-alphabetical LaTeX export
  2013-06-06  9:17     ` Carsten Dominik
@ 2013-06-06  9:27       ` Michael Bach
  2013-06-06 17:39       ` Josiah Schwab
  1 sibling, 0 replies; 17+ messages in thread
From: Michael Bach @ 2013-06-06  9:27 UTC (permalink / raw)
  To: emacs-orgmode

Carsten Dominik <carsten.dominik <at> gmail.com> writes:

> > Oh, I never saw it handled by the exporter, just a wrong assumption.  Just 
> > out of curiosity, do you think this could be implemented 'easily'?
> 
> I guess it could be - but I am not sure if it should.  Conventions about the 
type of bullet to be used in a document
> belong to the typesetting side, and I rather establish a global setting for 
a document than follow my
> momentary decisions when I write the Org-mode version of it.  On a similar 
vein, we do have lists starting
> with - and * and +, but we still let LaTeX and HTML choose what to use as a 
bullet.  To me this feels like the right behavior.

Good point.  The separation of typesetting and content is of course more 
reasonable than my lazyness.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: org-list-allow-alphabetical LaTeX export
  2013-06-06  9:23     ` Marcin Borkowski
@ 2013-06-06  9:33       ` Michael Bach
  0 siblings, 0 replies; 17+ messages in thread
From: Michael Bach @ 2013-06-06  9:33 UTC (permalink / raw)
  To: emacs-orgmode

Marcin Borkowski <mbork <at> wmi.amu.edu.pl> writes:

> 
> Dnia 2013-06-06, o godz. 09:11:11
> Michael Bach <phaebz <at> gmail.com> napisał(a):
> 
> > Oh, I never saw it handled by the exporter, just a wrong assumption.
> > Just out of curiosity, do you think this could be implemented
> > 'easily'?
> 
> If you mean "easily" on the LaTeX side, then yes, check out the
> "enumitem" package.  Example:
> 

Thanks for mentioning the package and example. I was talking about the Org-
mode side though.

> But definitely check out the docs for that package, it is really good,
> and supports much more than this.
> 
  
Looks nice, will have a look at it.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: org-list-allow-alphabetical LaTeX export
  2013-06-06  9:17     ` Carsten Dominik
  2013-06-06  9:27       ` Michael Bach
@ 2013-06-06 17:39       ` Josiah Schwab
  2013-06-06 19:45         ` Carsten Dominik
  2013-06-07  5:01         ` Nick Dokos
  1 sibling, 2 replies; 17+ messages in thread
From: Josiah Schwab @ 2013-06-06 17:39 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: Michael Bach, Carsten Dominik

> On 6 jun. 2013, at 10:20, Michael Bach <phaebz <at> gmail.com> wrote:
>> The LaTeX exporter does not honor the setting of org-list-allow-alphabetical.  

A week or so ago I asked a similar question about the HTML export and lists.
http://lists.gnu.org/archive/html/emacs-orgmode/2013-05/msg01324.html
So I just wanted to toss in my 2¢.

On Jun 6, 2013, at 2:17 AM, Carsten Dominik wrote:
> Conventions about the type of bullet to be used in a document belong to the typesetting side, and I rather establish a global setting for a document than follow my momentary decisions when I write the Org-mode version of it.  On a similar vein, we do have lists starting with - and * and +, but we still let LaTeX and HTML choose what to use as a bullet.  To me this feels like the right behavior.

I think this argument makes sense;  and to be honest, that's probably how I want the exporter to behave most of the time.

However, there is particular use case where I find this frustrating, which is writing problem sets.  There I like to reference other parts of the problems by name.  For example, 

a) Do something.
b) Use your answer in part a) to do something else.

Then, if I want to export it to multiple formats (say, html and pdf), there is no general way to tell orgmode: "my alphabetical bullet choice was meaningful, please try to preserve it".  One ends up inserting little workarounds for each export format.  Which is not a big deal, but when everything else works so seamlessly it's these little things that stand out :)

Best,
Josiah

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: org-list-allow-alphabetical LaTeX export
  2013-06-06 17:39       ` Josiah Schwab
@ 2013-06-06 19:45         ` Carsten Dominik
  2013-06-06 21:20           ` Rasmus
  2013-06-07 11:12           ` Nicolas Goaziou
  2013-06-07  5:01         ` Nick Dokos
  1 sibling, 2 replies; 17+ messages in thread
From: Carsten Dominik @ 2013-06-06 19:45 UTC (permalink / raw)
  To: Josiah Schwab; +Cc: Michael Bach, emacs-orgmode


On 6.6.2013, at 19:39, Josiah Schwab <jschwab@gmail.com> wrote:

>> On 6 jun. 2013, at 10:20, Michael Bach <phaebz <at> gmail.com> wrote:
>>> The LaTeX exporter does not honor the setting of org-list-allow-alphabetical.  
> 
> A week or so ago I asked a similar question about the HTML export and lists.
> http://lists.gnu.org/archive/html/emacs-orgmode/2013-05/msg01324.html
> So I just wanted to toss in my 2¢.
> 
> On Jun 6, 2013, at 2:17 AM, Carsten Dominik wrote:
>> Conventions about the type of bullet to be used in a document belong to the typesetting side, and I rather establish a global setting for a document than follow my momentary decisions when I write the Org-mode version of it.  On a similar vein, we do have lists starting with - and * and +, but we still let LaTeX and HTML choose what to use as a bullet.  To me this feels like the right behavior.
> 
> I think this argument makes sense;  and to be honest, that's probably how I want the exporter to behave most of the time.
> 
> However, there is particular use case where I find this frustrating, which is writing problem sets.  There I like to reference other parts of the problems by name.  For example, 
> 
> a) Do something.
> b) Use your answer in part a) to do something else.
> 
> Then, if I want to export it to multiple formats (say, html and pdf), there is no general way to tell orgmode: "my alphabetical bullet choice was meaningful, please try to preserve it".  One ends up inserting little workarounds for each export format.  Which is not a big deal, but when everything else works so seamlessly it's these little things that stand out :)


This is a good point - but this calls for something else:  A mechanism to name a particular list item and refer to it by name.  In LaTeX you can put a \label into an ordered list item and refer to it with \ref.  I am not sure if the new exporter allows this for list items, but I do not thing so.  Nicolas, has this ever been considered?  I don't remember.

This would be useful.

Or, make sure you use a LaTeX stype or HTML style file that uses a specific labeling system.

- Carsten

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: org-list-allow-alphabetical LaTeX export
  2013-06-06 19:45         ` Carsten Dominik
@ 2013-06-06 21:20           ` Rasmus
  2013-06-06 21:36             ` Josiah Schwab
  2013-06-07 11:12           ` Nicolas Goaziou
  1 sibling, 1 reply; 17+ messages in thread
From: Rasmus @ 2013-06-06 21:20 UTC (permalink / raw)
  To: emacs-orgmode

Carsten Dominik <carsten.dominik@gmail.com> writes:

>> a) Do something.
>> b) Use your answer in part a) to do something else.
>> 
>> Then, if I want to export it to multiple formats (say, html and
>> pdf), there is no general way to tell orgmode: "my alphabetical
>> bullet choice was meaningful, please try to preserve it".  One ends
>> up inserting little workarounds for each export format.  Which is
>> not a big deal, but when everything else works so seamlessly it's
>> these little things that stand out :)
>
> This is a good point - but this calls for something else: A mechanism
> to name a particular list item and refer to it by name.  In LaTeX you
> can put a \label into an ordered list item and refer to it with \ref.
> I am not sure if the new exporter allows this for list items, but I do
> not thing so.  Nicolas, has this ever been considered?  I don't
> remember.
>
> This would be useful.
>
> Or, make sure you use a LaTeX stype or HTML style file that uses a specific labeling system.


Why doesn't this cut it:

#+BEGIN_SRC org
 1. <<1>> Do something.
 2. Use your answer in part [[1]] to do something else.
#+END_SRC

–Rasmus

-- 
Hooray!

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: org-list-allow-alphabetical LaTeX export
  2013-06-06 21:20           ` Rasmus
@ 2013-06-06 21:36             ` Josiah Schwab
  2013-06-06 22:39               ` Rasmus
  0 siblings, 1 reply; 17+ messages in thread
From: Josiah Schwab @ 2013-06-06 21:36 UTC (permalink / raw)
  To: Rasmus; +Cc: emacs-orgmode

> Why doesn't this cut it:
> 
> #+BEGIN_SRC org
> 1. <<1>> Do something.
> 2. Use your answer in part [[1]] to do something else.
> #+END_SRC

That will work ok in LaTeX I think.
But that will export to HTML like

<ol class="org-ol">
<li><a id="1" name="1"></a> Do something.
</li>
<li>Use your answer in part <a href="#1">1</a> to do something else.
</li>
</ol>

and the link name will remain "1", even if one adds type="a" to the <ol> tag to adjust the bullet appearance.

Josiah

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: org-list-allow-alphabetical LaTeX export
  2013-06-06 21:36             ` Josiah Schwab
@ 2013-06-06 22:39               ` Rasmus
  2013-06-06 22:49                 ` Rasmus
  0 siblings, 1 reply; 17+ messages in thread
From: Rasmus @ 2013-06-06 22:39 UTC (permalink / raw)
  To: emacs-orgmode

Josiah Schwab <jschwab@gmail.com> writes:

>> Why doesn't this cut it:
>> 
>> #+BEGIN_SRC org
>> 1. <<1>> Do something.
>> 2. Use your answer in part [[1]] to do something else.
>> #+END_SRC
>
> That will work ok in LaTeX I think.
> But that will export to HTML like
>
> <ol class="org-ol">
> <li><a id="1" name="1"></a> Do something.
> </li>
> <li>Use your answer in part <a href="#1">1</a> to do something else.
> </li>
> </ol>
>
> and the link name will remain "1", even if one adds type="a" to the
> <ol> tag to adjust the bullet appearance.

If you your type you can use a more advance link [[1][a)].  But that's
not very nice.

Perhaps, css counters is the way to go:

     https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Counters

(I did a quick search and I'm not sure css is powerful enough).

In any case, I think it's a fair feature request, but it's a "html
bug/deficit".  If we know how to do it in "hand-written" html it can
relatively easily be added to ox-html or incorporated locally via a
filter.

–Rasmus

-- 
m-mm-mmm-mmmm bacon!

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: org-list-allow-alphabetical LaTeX export
  2013-06-06 22:39               ` Rasmus
@ 2013-06-06 22:49                 ` Rasmus
  0 siblings, 0 replies; 17+ messages in thread
From: Rasmus @ 2013-06-06 22:49 UTC (permalink / raw)
  To: emacs-orgmode

Rasmus <rasmus@gmx.us> writes:

> Josiah Schwab <jschwab@gmail.com> writes:
>
>>> Why doesn't this cut it:
>>> 
>>> #+BEGIN_SRC org
>>> 1. <<1>> Do something.
>>> 2. Use your answer in part [[1]] to do something else.
>>> #+END_SRC
>>
>> That will work ok in LaTeX I think.
>> But that will export to HTML like
>>
>> <ol class="org-ol">
>> <li><a id="1" name="1"></a> Do something.
>> </li>
>> <li>Use your answer in part <a href="#1">1</a> to do something else.
>> </li>
>> </ol>
>>
>> and the link name will remain "1", even if one adds type="a" to the
>> <ol> tag to adjust the bullet appearance.
>
> If you your type you can use a more advance link [[1][a)].  But that's
> not very nice.
>
> Perhaps, css counters is the way to go:
>
>      https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Counters
>
> (I did a quick search and I'm not sure css is powerful enough).

It doesn't seem to be easy or pretty to get \ref-\label-like relations
in html.  Here's the best I could find:

http://stackoverflow.com/questions/2651739/how-to-access-css-generated-content-with-javascript

–Rasmus

-- 
When in doubt, do it!

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: org-list-allow-alphabetical LaTeX export
  2013-06-06 17:39       ` Josiah Schwab
  2013-06-06 19:45         ` Carsten Dominik
@ 2013-06-07  5:01         ` Nick Dokos
  2013-06-07  5:48           ` Josiah Schwab
  1 sibling, 1 reply; 17+ messages in thread
From: Nick Dokos @ 2013-06-07  5:01 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 4181 bytes --]

Josiah Schwab <jschwab@gmail.com> writes:

>> On 6 jun. 2013, at 10:20, Michael Bach <phaebz <at> gmail.com> wrote:
>>> The LaTeX exporter does not honor the setting of org-list-allow-alphabetical.  
>
> A week or so ago I asked a similar question about the HTML export and lists.
> http://lists.gnu.org/archive/html/emacs-orgmode/2013-05/msg01324.html
> So I just wanted to toss in my 2¢.
>
> On Jun 6, 2013, at 2:17 AM, Carsten Dominik wrote:
>> Conventions about the type of bullet to be used in a document belong
>> to the typesetting side, and I rather establish a global setting for
>> a document than follow my momentary decisions when I write the
>> Org-mode version of it.  On a similar vein, we do have lists
>> starting with - and * and +, but we still let LaTeX and HTML choose
>> what to use as a bullet.  To me this feels like the right behavior.
>
> I think this argument makes sense; and to be honest, that's probably
> how I want the exporter to behave most of the time.
>
> However, there is particular use case where I find this frustrating,
> which is writing problem sets.  There I like to reference other parts
> of the problems by name.  For example,
>
> a) Do something.
> b) Use your answer in part a) to do something else.
>
> Then, if I want to export it to multiple formats (say, html and pdf),
> there is no general way to tell orgmode: "my alphabetical bullet
> choice was meaningful, please try to preserve it".  One ends up
> inserting little workarounds for each export format.  Which is not a
> big deal, but when everything else works so seamlessly it's these
> little things that stand out :)
>

I don't have anything to add to what others have said on the
cross-reference question. But I did some investigation into
alpha lists and I wanted to expand a bit on that.

I looked at your earlier question and the latex question a bit and I
have a patch that implements something like what you want. However, I'm
not advocating that org actually implement this. In fact, there are good
reasons *not* to implement it (at least not in this form).

In the patch, there is a change in the parser so that it recognizes an
ordered-alpha list (in addition to the ordered, etc. lists it was
already recognizing). Then there are minor changes to ox-html.el:
basically ordered and ordered-alpha trigger the same response from the
exporter, except in one case: the opening of an ordered-alpha list
includes the ``type="a"'' thing. NB: the patch does not address any
of the other exporters.

However, the type="a" thingie in <ol> is a bad idea: it is deprecated in
the HTML spec, so it would be foolish to go chasing after it in
org. Here's what the spec says:

#+BEGIN_QUOTE

For the OL element, possible values for the type attribute are
summarized in the table below (they are case-sensitive):

Type	Numbering style
1	arabic numbers	1, 2, 3, ...
a	lower alpha	a, b, c, ...
A	upper alpha	A, B, C, ...
i	lower roman	i, ii, iii, ...
I	upper roman	I, II, III, ...

Note that the type attribute is deprecated and list styles should be
handled through style sheets.

For example, using CSS, one may specify that the style of numbers for
list elements in a numbered list should be lowercase roman numerals. In
the excerpt below, every OL element belonging to the class "withroman"
will have roman numerals in front of its list items.

<STYLE type="text/css">
OL.withroman { list-style-type: lower-roman }
</STYLE>
<BODY>
<OL class="withroman">
<LI> Step one ...  
<LI> Step two ...
</OL>
</BODY>

#+END_QUOTE

See http://www.w3.org/TR/html4/struct/lists.html#type-values.

Even if it were not deprecated, a good implementation would require org
to be able to generate all the values, which would probably require 
YAUO (yet another user option).

What org *could* do is to generate some discriminant (the "withroman" thing
above) so that the proper CSS could be applied.  Right now, there is no
such capability I believe. It could be done with YAUO, but I, for one,
think org has too many of those: we certainly don't need more unless it
is *really* necessary.

Here's the patch if you still want it: the only use for it
as far as I'm concerned is "educational":


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Alpha lists in the html exporter --]
[-- Type: text/x-diff, Size: 1905 bytes --]

diff --git a/lisp/org-list.el b/lisp/org-list.el
index 86afe11..7a606f0 100644
--- a/lisp/org-list.el
+++ b/lisp/org-list.el
@@ -1022,7 +1022,8 @@ Possible types are `descriptive', `ordered' and `unordered'.  The
 type is determined by the first item of the list."
   (let ((first (org-list-get-list-begin item struct prevs)))
     (cond
-     ((string-match "[[:alnum:]]" (org-list-get-bullet first struct)) 'ordered)
+     ((string-match "[[:alpha:]]" (org-list-get-bullet first struct)) 'ordered-alpha)
+     ((string-match "[[:digit:]]" (org-list-get-bullet first struct)) 'ordered)
      ((org-list-get-tag first struct) 'descriptive)
      (t 'unordered))))
 
diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index facd84c..b30c313 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -2387,7 +2387,7 @@ contextual information."
 	(br (org-html-close-tag "br" nil info)))
     (concat
      (case type
-       (ordered
+       ((ordered ordered-alpha)
 	(let* ((counter term-counter-id)
 	       (extra (if counter (format " value=\"%s\"" counter) "")))
 	  (concat
@@ -2409,7 +2409,7 @@ contextual information."
      (unless (eq type 'descriptive) checkbox)
      contents
      (case type
-       (ordered "</li>")
+       ((ordered ordered-alpha) "</li>")
        (unordered "</li>")
        (descriptive "</dd>")))))
 
@@ -2796,13 +2796,16 @@ lists."
     (ordered
      (format "<ol class=\"org-ol\"%s>"
 	     (if arg1 (format " start=\"%d\"" arg1) "")))
+    (ordered-alpha
+     (format "<ol type=\"a\" class=\"org-ol\"%s>"
+	     (if arg1 (format " start=\"%s\"" arg1) "")))
     (unordered "<ul class=\"org-ul\">")
     (descriptive "<dl class=\"org-dl\">")))
 
 (defun org-html-end-plain-list (type)
   "Insert the end of the HTML list depending on TYPE."
   (case type
-    (ordered "</ol>")
+    ((ordered ordered-alpha) "</ol>")
     (unordered "</ul>")
     (descriptive "</dl>")))
 

[-- Attachment #3: Type: text/plain, Size: 744 bytes --]


So much for HTML.

For LaTeX, you can do alpha lists as follows (no patch needed):

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

* Letters
#+ATTR_LATEX: :options [(a)]
a. foo
b. bar
c. baz


This is another list, and the option above does not apply to it - 
the enumerators are numbers by default:

a. foo
b. bar
c. baz

* Numbers
1. foo
2. bar
3. baz

This might look like a numbered list, but if you add an option
you can turn it into an alpha list:

#+ATTR_LATEX: :options [A]
1. foo
2. bar
3. baz
--8<---------------cut here---------------end--------------->8---

You can pass any of the options that the enumerate package allows
without org having to worry about it.

-- 
Nick

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: org-list-allow-alphabetical LaTeX export
  2013-06-07  5:01         ` Nick Dokos
@ 2013-06-07  5:48           ` Josiah Schwab
  2013-06-07 13:54             ` Nick Dokos
  0 siblings, 1 reply; 17+ messages in thread
From: Josiah Schwab @ 2013-06-07  5:48 UTC (permalink / raw)
  To: Nick Dokos; +Cc: emacs-orgmode

> However, the type="a" thingie in <ol> is a bad idea: it is deprecated in
> the HTML spec, so it would be foolish to go chasing after it in org.

I'll take a closer look the rest of your message to tomorrow, but I wanted
to mention that while "type" was deprecated in HTML4 that is no longer the
case in HTML5.

http://www.w3.org/TR/html-markup/ol.html#ol.attrs.type

Best,
Josiah

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: org-list-allow-alphabetical LaTeX export
  2013-06-06 19:45         ` Carsten Dominik
  2013-06-06 21:20           ` Rasmus
@ 2013-06-07 11:12           ` Nicolas Goaziou
  1 sibling, 0 replies; 17+ messages in thread
From: Nicolas Goaziou @ 2013-06-07 11:12 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Josiah Schwab, Michael Bach, emacs-orgmode

Hello,

Carsten Dominik <carsten.dominik@gmail.com> writes:

> This is a good point - but this calls for something else: A mechanism
> to name a particular list item and refer to it by name. In LaTeX you
> can put a \label into an ordered list item and refer to it with \ref.
> I am not sure if the new exporter allows this for list items, but I do
> not thing so. Nicolas, has this ever been considered? I don't
> remember.
>
> This would be useful.
>
> Or, make sure you use a LaTeX stype or HTML style file that uses
> a specific labeling system.

As pointed out by Rasmus in this thread, there is a cross-reference
mechanism in the export framework.

1. <<something>> Item 1.
2. Reference to item [[something]].

It will work in any back-end, but obviously, will ignore alphabetical
lists (link will always appear as a number).

Speaking of those, my opinion is we should drop them altogether, as they
are just (dubious) syntactic sugar, but some users will always expect
them to be more than that.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: org-list-allow-alphabetical LaTeX export
  2013-06-07  5:48           ` Josiah Schwab
@ 2013-06-07 13:54             ` Nick Dokos
  0 siblings, 0 replies; 17+ messages in thread
From: Nick Dokos @ 2013-06-07 13:54 UTC (permalink / raw)
  To: emacs-orgmode

Josiah Schwab <jschwab@gmail.com> writes:

>> However, the type="a" thingie in <ol> is a bad idea: it is deprecated in
>> the HTML spec, so it would be foolish to go chasing after it in org.
>
> I'll take a closer look the rest of your message to tomorrow, but I wanted
> to mention that while "type" was deprecated in HTML4 that is no longer the
> case in HTML5.
>
> http://www.w3.org/TR/html-markup/ol.html#ol.attrs.type
>

OK - thanks for the pointer!

-- 
Nick

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2013-06-07 13:54 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-06  8:20 org-list-allow-alphabetical LaTeX export Michael Bach
2013-06-06  8:52 ` Carsten Dominik
2013-06-06  9:11   ` Michael Bach
2013-06-06  9:17     ` Carsten Dominik
2013-06-06  9:27       ` Michael Bach
2013-06-06 17:39       ` Josiah Schwab
2013-06-06 19:45         ` Carsten Dominik
2013-06-06 21:20           ` Rasmus
2013-06-06 21:36             ` Josiah Schwab
2013-06-06 22:39               ` Rasmus
2013-06-06 22:49                 ` Rasmus
2013-06-07 11:12           ` Nicolas Goaziou
2013-06-07  5:01         ` Nick Dokos
2013-06-07  5:48           ` Josiah Schwab
2013-06-07 13:54             ` Nick Dokos
2013-06-06  9:23     ` Marcin Borkowski
2013-06-06  9:33       ` Michael Bach

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