Re: [O] org-list-allow-alphabetical LaTeX export
Josiah Schwab writes: >> However, the type="a" thingie in 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
Re: [O] org-list-allow-alphabetical LaTeX export
Hello, Carsten Dominik 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. <> 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
Re: [O] org-list-allow-alphabetical LaTeX export
> However, the type="a" thingie in 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
Re: [O] org-list-allow-alphabetical LaTeX export
Josiah Schwab writes: >> On 6 jun. 2013, at 10:20, Michael Bach 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 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): TypeNumbering 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. OL.withroman { list-style-type: lower-roman } Step one ... Step two ... #+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": 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)))
Re: [O] org-list-allow-alphabetical LaTeX export
Rasmus writes: > Josiah Schwab 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 >> >> >> Do something. >> >> Use your answer in part 1 to do something else. >> >> >> >> and the link name will remain "1", even if one adds type="a" to the >> 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!
Re: [O] org-list-allow-alphabetical LaTeX export
Josiah Schwab 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 > > > Do something. > > Use your answer in part 1 to do something else. > > > > and the link name will remain "1", even if one adds type="a" to the > 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- bacon!
Re: [O] org-list-allow-alphabetical LaTeX export
> 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 Do something. Use your answer in part 1 to do something else. and the link name will remain "1", even if one adds type="a" to the tag to adjust the bullet appearance. Josiah
Re: [O] org-list-allow-alphabetical LaTeX export
Carsten Dominik 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!
Re: [O] org-list-allow-alphabetical LaTeX export
On 6.6.2013, at 19:39, Josiah Schwab wrote: >> On 6 jun. 2013, at 10:20, Michael Bach 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
Re: [O] org-list-allow-alphabetical LaTeX export
> On 6 jun. 2013, at 10:20, Michael Bach 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
Re: [O] org-list-allow-alphabetical LaTeX export
Marcin Borkowski wmi.amu.edu.pl> writes: > > Dnia 2013-06-06, o godz. 09:11:11 > Michael Bach 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.
Re: [O] org-list-allow-alphabetical LaTeX export
Carsten Dominik 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.
Re: [O] org-list-allow-alphabetical LaTeX export
Dnia 2013-06-06, o godz. 09:11:11 Michael Bach napisał(a): > Carsten Dominik gmail.com> writes: > > >> On 6 jun. 2013, at 10:20, Michael Bach 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
Re: [O] org-list-allow-alphabetical LaTeX export
On 6 jun. 2013, at 11:11, Michael Bach wrote: > Carsten Dominik gmail.com> writes: > >>> On 6 jun. 2013, at 10:20, Michael Bach 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 > > >
Re: [O] org-list-allow-alphabetical LaTeX export
Carsten Dominik gmail.com> writes: >> On 6 jun. 2013, at 10:20, Michael Bach 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
Re: [O] org-list-allow-alphabetical LaTeX export
On 6 jun. 2013, at 10:20, Michael Bach 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 >
[O] org-list-allow-alphabetical LaTeX export
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