all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Enumeration within environment block
@ 2014-05-17 19:24 Xavier Garrido
  2014-05-18 16:33 ` Richard Lawrence
  2014-05-19  8:21 ` Eric S Fraga
  0 siblings, 2 replies; 3+ messages in thread
From: Xavier Garrido @ 2014-05-17 19:24 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

Dear orgers,

I am using org-mode to write teaching class corrections in order to get 
them properly exported in pdf and html. What I would like to do is to 
insert not only the answer but also the questions. So, I have created a 
"question" environment as shown below

#+BEGIN_SRC org
#+TITLE: Question Test

#+BEGIN_QUESTION
1) Question bla bla bla bla
#+END_QUESTION

The answer to this question is ...

#+BEGIN_QUESTION
2) Question bla bla bla
#+END_QUESTION

The answer to this second question is...
#+END_SRC

The problem is that the enumeration number gets lost either in the 
=enumerate= env. in LaTeX or the =ol= tags in html and thus question 
restart to number 1 every time I have a BEGIN_QUESTION/END_QUESTION 
block. Is there a way to solve that issue or at least to force the item 
number ? (for instance, in LaTeX I can write \item[1],\item[2] and in 
html I can set the =ol= start value).

Thanks in advance,
Xavier

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

* Re: Enumeration within environment block
  2014-05-17 19:24 Enumeration within environment block Xavier Garrido
@ 2014-05-18 16:33 ` Richard Lawrence
  2014-05-19  8:21 ` Eric S Fraga
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Lawrence @ 2014-05-18 16:33 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: Xavier Garrido

Hi Xavier,

Xavier Garrido <xavier.garrido@gmail.com> writes:

> The problem is that the enumeration number gets lost either in the
> =enumerate= env. in LaTeX or the =ol= tags in html and thus question
> restart to number 1 every time I have a BEGIN_QUESTION/END_QUESTION
> block. Is there a way to solve that issue or at least to force the
> item number ? (for instance, in LaTeX I can write \item[1],\item[2]
> and in html I can set the =ol= start value).

I don't have any real advice for HTML (CSS counters??) but there are
some solutions that exist in the LaTeX world for cumulative numbering
like this.

The solutions I am most familiar with are the linguex[1], gb4e[2], and
philex[3] packages.  (These are packages for linguists, who often need a
running set of examples with text in between -- though they also have
linguistics-specific stuff that you probably don't need.)

There is also the enumitem[4] package.  I don't have much experience
with this but it may work for you.

I wrote a custom exporter for Org that adds support for exporting Org
lists to the numbered example environments used by linguex and gb4e.  It
is called ox-linguistics[5] and is posted on Github.  If you like the
solution provided by linguex or gb4e at the LaTeX level, this would
allow you to access it from Org, without having to write embedded LaTeX.
It also lets you refer back to examples (questions, in your case) using
Org targets and links.

ox-linguistics is still alpha-quality and I may make some significant
changes to it soon, but I have been using it for a while now to compile
my dissertation, and it's been meeting my needs pretty well.  Let me
know what you think.

[1] http://www.ctan.org/pkg/linguex
[2] http://www.ctan.org/pkg/gb4e
[3] http://www.ctan.org/pkg/philex
[4] http://www.ctan.org/pkg/enumitem
[5] https://github.com/wyleyr/ox-linguistics

-- 
Best,
Richard

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

* Re: Enumeration within environment block
  2014-05-17 19:24 Enumeration within environment block Xavier Garrido
  2014-05-18 16:33 ` Richard Lawrence
@ 2014-05-19  8:21 ` Eric S Fraga
  1 sibling, 0 replies; 3+ messages in thread
From: Eric S Fraga @ 2014-05-19  8:21 UTC (permalink / raw)
  To: Xavier Garrido; +Cc: emacs-orgmode@gnu.org

On Saturday, 17 May 2014 at 21:24, Xavier Garrido wrote:

[...]

> block. Is there a way to solve that issue or at least to force the item 
> number ? (for instance, in LaTeX I can write \item[1],\item[2] and in 
> html I can set the =ol= start value).
>
> Thanks in advance,
> Xavier

Forcing the item number is easy:

#+begin_src org
  ,* list numbering
  1. this is the first item.

  some interrupting text

  2. [@2] this is the second item.

#+end_src

This functionality is describer in [[info:org#Plain%20lists]].

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.3.1, Org release_8.2.6-937-g60502a

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

end of thread, other threads:[~2014-05-19  9:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-17 19:24 Enumeration within environment block Xavier Garrido
2014-05-18 16:33 ` Richard Lawrence
2014-05-19  8:21 ` Eric S Fraga

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.