emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Org-mode using enumerate properties to export to LaTeX
@ 2011-09-11 10:27 Søren Mikkelsen
  2011-09-11 13:18 ` Eric S Fraga
  0 siblings, 1 reply; 8+ messages in thread
From: Søren Mikkelsen @ 2011-09-11 10:27 UTC (permalink / raw)
  To: emacs-orgmode

I am currently struggling with enumerating my numbered list with a 
prefix. In org-mode I have

  1. This
  2. is
  3. a
  4. numbered
  5. list

In my LaTeX export I like to have it look like

  R1. This
  R2. is
  R3. a
  R4. numbered
  R5. list

In my latex-document I would do something like this:

\documentclass{article}
\usepackage{enumerate}
\begin{document}

\begin{enumerate}[{\bfseries R1.}]
\item This
\item is
\item a
\item numbered
\item list
\end{enumerate}
\end{document}

--
aagaard

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

* Re: Org-mode using enumerate properties to export to LaTeX
  2011-09-11 10:27 Org-mode using enumerate properties to export to LaTeX Søren Mikkelsen
@ 2011-09-11 13:18 ` Eric S Fraga
  2011-09-11 16:48   ` Søren Mikkelsen
  0 siblings, 1 reply; 8+ messages in thread
From: Eric S Fraga @ 2011-09-11 13:18 UTC (permalink / raw)
  To: Søren Mikkelsen; +Cc: emacs-orgmode

Søren Mikkelsen <sorenaamikkelsen@gmail.com> writes:

> I am currently struggling with enumerating my numbered list with a
> prefix. In org-mode I have
>
>  1. This
>  2. is
>  3. a
>  4. numbered
>  5. list

Try putting the line

#+latex: \renewcommand{\theenumi}{R\arabic{enumi}}

before the start of the list.  This changes how latex outputs the first
level (i) enumeration counter.  Set it back afterwards to the same thing
*without* the =R= to get the default behaviour.

This is obviously a latex issue not specific to org.  For these cases,
there are some very good resources online.  e.g.

  https://secure.wikimedia.org/wikibooks/en/wiki/LaTeX/

and my all time favourite:

  http://www.tex.ac.uk/tex-archive/info/visualFAQ/visualFAQ.pdf

one of the best things about org as a writing mode is that you still
have access to most latex (and other export target) features in a
straightforward manner!

HTH,
eric
-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
: using Org-mode version 7.7 (release_7.7.271.gbae8)

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

* Re: Org-mode using enumerate properties to export to LaTeX
  2011-09-11 13:18 ` Eric S Fraga
@ 2011-09-11 16:48   ` Søren Mikkelsen
  2011-09-11 19:06     ` Eric S Fraga
  0 siblings, 1 reply; 8+ messages in thread
From: Søren Mikkelsen @ 2011-09-11 16:48 UTC (permalink / raw)
  To: emacs-orgmode

On 2011-09-11 15:18, Eric S Fraga wrote:
> Søren Mikkelsen<sorenaamikkelsen@gmail.com>  writes:
>
>> I am currently struggling with enumerating my numbered list with a
>> prefix. In org-mode I have
>>
>>   1. This
>>   2. is
>>   3. a
>>   4. numbered
>>   5. list
>
> Try putting the line
>
> #+latex: \renewcommand{\theenumi}{R\arabic{enumi}}
>
> before the start of the list.  This changes how latex outputs the first
> level (i) enumeration counter.  Set it back afterwards to the same thing
> *without* the =R= to get the default behaviour.
>
> This is obviously a latex issue not specific to org.  For these cases,
> there are some very good resources online.  e.g.
>
>    https://secure.wikimedia.org/wikibooks/en/wiki/LaTeX/
>
> and my all time favourite:
>
>    http://www.tex.ac.uk/tex-archive/info/visualFAQ/visualFAQ.pdf
>
> one of the best things about org as a writing mode is that you still
> have access to most latex (and other export target) features in a
> straightforward manner!
>
> HTH,
> eric

Thanks, I thought something like renewing a command could do the job. 
However it could be nice, if it was possible to export a list with a 
generic prefix on the lists.

---
/aagaard

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

* Re: Org-mode using enumerate properties to export to LaTeX
  2011-09-11 16:48   ` Søren Mikkelsen
@ 2011-09-11 19:06     ` Eric S Fraga
  2011-09-11 20:12       ` Søren Mikkelsen
  0 siblings, 1 reply; 8+ messages in thread
From: Eric S Fraga @ 2011-09-11 19:06 UTC (permalink / raw)
  To: Søren Mikkelsen; +Cc: emacs-orgmode

Søren Mikkelsen <sorenaamikkelsen@gmail.com> writes:

> On 2011-09-11 15:18, Eric S Fraga wrote:
>> Søren Mikkelsen<sorenaamikkelsen@gmail.com>  writes:
>>
>
>>> I am currently struggling with enumerating my numbered list with a
>>> prefix. In org-mode I have
>>>
>>>   1. This
>>>   2. is
>>>   3. a
>>>   4. numbered
>>>   5. list
>>
>> Try putting the line
>>
>> #+latex: \renewcommand{\theenumi}{R\arabic{enumi}}
>>
>> before the start of the list.  This changes how latex outputs the first
>> level (i) enumeration counter.  Set it back afterwards to the same thing
>> *without* the =R= to get the default behaviour.
>>
>> This is obviously a latex issue not specific to org.  For these cases,
>> there are some very good resources online.  e.g.
>>
>>    https://secure.wikimedia.org/wikibooks/en/wiki/LaTeX/
>>
>> and my all time favourite:
>>
>>    http://www.tex.ac.uk/tex-archive/info/visualFAQ/visualFAQ.pdf
>>
>> one of the best things about org as a writing mode is that you still
>> have access to most latex (and other export target) features in a
>> straightforward manner!
>>
>> HTH,
>> eric
>
> Thanks, I thought something like renewing a command could do the
> job. However it could be nice, if it was possible to export a list
> with a generic prefix on the lists.
>
> ---
> /aagaard

I'm not sure what you mean?  Doesn't what I posted above do the job?
This is the standard latex means of doing this, at least with the
default latex enumeration environment. 

You may wish to check out other list environments; there are a few out
there, e.g. paralist.  However, I am not sure how the latex exporter
could be configured to pass the extra information that some of these
need to achieve what you want.

HTH,
eric

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

* Re: Org-mode using enumerate properties to export to LaTeX
  2011-09-11 19:06     ` Eric S Fraga
@ 2011-09-11 20:12       ` Søren Mikkelsen
  2011-09-12  9:30         ` Eric S Fraga
  0 siblings, 1 reply; 8+ messages in thread
From: Søren Mikkelsen @ 2011-09-11 20:12 UTC (permalink / raw)
  To: emacs-orgmode

On 2011-09-11 21:06, Eric S Fraga wrote:
> Søren Mikkelsen<sorenaamikkelsen@gmail.com>  writes:
>
>> On 2011-09-11 15:18, Eric S Fraga wrote:
>>> Søren Mikkelsen<sorenaamikkelsen@gmail.com>   writes:
>>>
>>
>>>> I am currently struggling with enumerating my numbered list with a
>>>> prefix. In org-mode I have
>>>>
>>>>    1. This
>>>>    2. is
>>>>    3. a
>>>>    4. numbered
>>>>    5. list
>>>
>>> Try putting the line
>>>
>>> #+latex: \renewcommand{\theenumi}{R\arabic{enumi}}
>>>
>>> before the start of the list.  This changes how latex outputs the first
>>> level (i) enumeration counter.  Set it back afterwards to the same thing
>>> *without* the =R= to get the default behaviour.
>>>
>>> This is obviously a latex issue not specific to org.  For these cases,
>>> there are some very good resources online.  e.g.
>>>
>>>     https://secure.wikimedia.org/wikibooks/en/wiki/LaTeX/
>>>
>>> and my all time favourite:
>>>
>>>     http://www.tex.ac.uk/tex-archive/info/visualFAQ/visualFAQ.pdf
>>>
>>> one of the best things about org as a writing mode is that you still
>>> have access to most latex (and other export target) features in a
>>> straightforward manner!
>>>
>>> HTH,
>>> eric
>>
>> Thanks, I thought something like renewing a command could do the
>> job. However it could be nice, if it was possible to export a list
>> with a generic prefix on the lists.
>>
>> ---
>> /aagaard
>
> I'm not sure what you mean?  Doesn't what I posted above do the job?
> This is the standard latex means of doing this, at least with the
> default latex enumeration environment.
>
> You may wish to check out other list environments; there are a few out
> there, e.g. paralist.  However, I am not sure how the latex exporter
> could be configured to pass the extra information that some of these
> need to achieve what you want.
>
> HTH,
> eric
>
>

Yes, it works perfectly when I export it into latex (and thank you for 
that). Just wondering if it was possible to do something similar within 
org-mode; a enumerate list with a prefix, e.g.:

  R1. One
  R2. Two


-- 
---
Søren Mikkelsen

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

* Re: Org-mode using enumerate properties to export to LaTeX
  2011-09-11 20:12       ` Søren Mikkelsen
@ 2011-09-12  9:30         ` Eric S Fraga
  2011-09-12 20:25           ` Søren Mikkelsen
  0 siblings, 1 reply; 8+ messages in thread
From: Eric S Fraga @ 2011-09-12  9:30 UTC (permalink / raw)
  To: Søren Mikkelsen; +Cc: emacs-orgmode

Søren Mikkelsen <sorenaamikkelsen@gmail.com> writes:

[...]

> Yes, it works perfectly when I export it into latex (and thank you for
> that). Just wondering if it was possible to do something similar
> within org-mode; a enumerate list with a prefix, e.g.:
>
>  R1. One
>  R2. Two

Ah, now I understand.  The answer is no and I imagine it would be
difficult to define a regular expression to match such cases without
catching all kinds of lines that were not intended to be lists (e.g. the
last word in a sentence that happens to end up at the start of the
line...).

However, latex does allow you to manually over-ride any item
label/number by simply specifying your own in square brackets.  e.g.

 - [R1] one
 - [R2] two

Org passes these through to the latex properly so this should do what
you want but obviously you won't have any automated procedure for
generating these labels.

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
: using Org-mode version 7.7 (release_7.7.275.gf1fc)

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

* Re: Org-mode using enumerate properties to export to LaTeX
  2011-09-12  9:30         ` Eric S Fraga
@ 2011-09-12 20:25           ` Søren Mikkelsen
  2011-09-12 21:04             ` Eric S Fraga
  0 siblings, 1 reply; 8+ messages in thread
From: Søren Mikkelsen @ 2011-09-12 20:25 UTC (permalink / raw)
  To: emacs-orgmode

On 2011-09-12 11:30, Eric S Fraga wrote:
> Søren Mikkelsen<sorenaamikkelsen@gmail.com>  writes:
>
> [...]
>
>> Yes, it works perfectly when I export it into latex (and thank you for
>> that). Just wondering if it was possible to do something similar
>> within org-mode; a enumerate list with a prefix, e.g.:
>>
>>   R1. One
>>   R2. Two
>
> Ah, now I understand.  The answer is no and I imagine it would be
> difficult to define a regular expression to match such cases without
> catching all kinds of lines that were not intended to be lists (e.g. the
> last word in a sentence that happens to end up at the start of the
> line...).
>
> However, latex does allow you to manually over-ride any item
> label/number by simply specifying your own in square brackets.  e.g.
>
>   - [R1] one
>   - [R2] two
>
> Org passes these through to the latex properly so this should do what
> you want but obviously you won't have any automated procedure for
> generating these labels.
>

This is also a latex related question, however I think it extents the 
previous question. How to I make my counter of the enumeration-list 
start at a specific position. Like

  1. Test
  2. of

Now I have something between the two enumerations

  3. counters
  4. in a
  5. enumeration environment

In latex I would insert \setcounter{enumi}{3} after starting a 
enumeration environment.

--
/aagaard

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

* Re: Org-mode using enumerate properties to export to LaTeX
  2011-09-12 20:25           ` Søren Mikkelsen
@ 2011-09-12 21:04             ` Eric S Fraga
  0 siblings, 0 replies; 8+ messages in thread
From: Eric S Fraga @ 2011-09-12 21:04 UTC (permalink / raw)
  To: Søren Mikkelsen; +Cc: emacs-orgmode

Søren Mikkelsen <sorenaamikkelsen@gmail.com> writes:

[...]

> This is also a latex related question, however I think it extents the
> previous question. How to I make my counter of the enumeration-list
> start at a specific position. Like
>
>  1. Test
>  2. of
>
> Now I have something between the two enumerations
>
>  3. counters
>  4. in a
>  5. enumeration environment
>
> In latex I would insert \setcounter{enumi}{3} after starting a
> enumeration environment.
>
> --
> /aagaard

From the manual:

,----
| File: org,  Node: Plain lists,  Next: Drawers,  Prev: Sparse trees,  Up: Document Structure
| 
| 2.7 Plain lists
| ===============
| 
| Within an entry of the outline tree, hand-formatted lists can provide
| additional structure.  They also provide a way to create lists of
| checkboxes (*note Checkboxes::).  Org supports editing such lists, and
| every exporter (*note Exporting::) can parse and format them.
| 
|    Org knows ordered lists, unordered lists, and description lists.
|    * _Unordered_ list items start with `-', `+', or `*'(1)  as bullets.
| 
|    * _Ordered_ list items start with a numeral followed by either a
|      period or a right parenthesis(2), such as `1.' or `1)'(3).  If you
|      want a list to start with a different value (e.g. 20), start the
|      text of the item with `[@20]'(4).  Those constructs can be used in
|      any item of the list in order to enforce a particular numbering.
`----

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
: using Org-mode version 7.7 (release_7.7.280.gdbf0)

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

end of thread, other threads:[~2011-09-12 21:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-11 10:27 Org-mode using enumerate properties to export to LaTeX Søren Mikkelsen
2011-09-11 13:18 ` Eric S Fraga
2011-09-11 16:48   ` Søren Mikkelsen
2011-09-11 19:06     ` Eric S Fraga
2011-09-11 20:12       ` Søren Mikkelsen
2011-09-12  9:30         ` Eric S Fraga
2011-09-12 20:25           ` Søren Mikkelsen
2011-09-12 21:04             ` Eric S Fraga

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