emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* LaTeX export - can't skip a heading level
@ 2012-03-20 19:27 Richard Stanton
  2012-03-20 19:31 ` TODO items as part of an itemized list? Richard Stanton
  2012-03-20 19:55 ` LaTeX export - can't skip a heading level Nick Dokos
  0 siblings, 2 replies; 14+ messages in thread
From: Richard Stanton @ 2012-03-20 19:27 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

Using org-mode 7.8.03, I've found that exporting to LaTeX has a tough time
if you try to skip a header level. For example, to prevent my TODO items
being numbered, one method is to make them a lower-level heading, and then
make that level un-numbered.

However, if I try the following:

* To Do List
*** TODO First item
*** TODO Second item

Then when exported to LaTeX, only the title appears (both TODO items are
excluded).

I tried make the first title one level lower, like this:

** To Do List
*** TODO First item
*** TODO Second item

* Next Section

Now the TODO list exports, though it now treats ** as the section header,
so it hasn't solved that problem, and moreover, the next section is
omitted entirely.

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

* TODO items as part of an itemized list?
  2012-03-20 19:27 LaTeX export - can't skip a heading level Richard Stanton
@ 2012-03-20 19:31 ` Richard Stanton
  2012-03-20 23:44   ` Bastien
  2012-03-21 21:43   ` Samuel Wales
  2012-03-20 19:55 ` LaTeX export - can't skip a heading level Nick Dokos
  1 sibling, 2 replies; 14+ messages in thread
From: Richard Stanton @ 2012-03-20 19:31 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

To save space in LaTeX exports and also to stop my TODO items being
numbered, I'd like to have TODO items as part of a list, e.g.,

- TODO Item 1
- TODO Item 2

However, while this prints OK, these entries are ignored by org-mode when
I ask it to create a TODO list. Is there any way to do what I want?

Thanks.

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

* Re: LaTeX export - can't skip a heading level
  2012-03-20 19:27 LaTeX export - can't skip a heading level Richard Stanton
  2012-03-20 19:31 ` TODO items as part of an itemized list? Richard Stanton
@ 2012-03-20 19:55 ` Nick Dokos
  2012-03-20 19:57   ` Richard Stanton
  2012-03-20 20:30   ` Nick Dokos
  1 sibling, 2 replies; 14+ messages in thread
From: Nick Dokos @ 2012-03-20 19:55 UTC (permalink / raw)
  To: Richard Stanton; +Cc: nicholas.dokos, emacs-orgmode@gnu.org

Richard Stanton <stanton@haas.berkeley.edu> wrote:

> Using org-mode 7.8.03, I've found that exporting to LaTeX has a tough time
> if you try to skip a header level. For example, to prevent my TODO items
> being numbered, one method is to make them a lower-level heading, and then
> make that level un-numbered.
> 
> However, if I try the following:
> 
> * To Do List
> *** TODO First item
> *** TODO Second item
> 

Does this do what you want?

--8<---------------cut here---------------start------------->8---

#+OPTIONS: num:1

* To Do List
** TODO First item
** TODO Second item
--8<---------------cut here---------------end--------------->8---

Nick

PS. Not sure why the third level headlines are skipped if the second level
headline is absent. This feels like a bug to me.

> Then when exported to LaTeX, only the title appears (both TODO items are
> excluded).
> 
> I tried make the first title one level lower, like this:
> 
> ** To Do List
> *** TODO First item
> *** TODO Second item
> 
> * Next Section
> 
> Now the TODO list exports, though it now treats ** as the section header,
> so it hasn't solved that problem, and moreover, the next section is
> omitted entirely.
> 
> 
> 
> 
> 
> 
> 
> 

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

* Re: LaTeX export - can't skip a heading level
  2012-03-20 19:55 ` LaTeX export - can't skip a heading level Nick Dokos
@ 2012-03-20 19:57   ` Richard Stanton
  2012-03-20 20:30   ` Nick Dokos
  1 sibling, 0 replies; 14+ messages in thread
From: Richard Stanton @ 2012-03-20 19:57 UTC (permalink / raw)
  To: nicholas.dokos@hp.com; +Cc: emacs-orgmode@gnu.org

> From: nicholas.dokos@hp.com [mailto:nicholas.dokos@hp.com]
> Sent: Tuesday, March 20, 2012 12:55 PM
> To: Richard Stanton
> Cc: emacs-orgmode@gnu.org; nicholas.dokos@hp.com
> Subject: Re: [O] LaTeX export - can't skip a heading level
> 
> Richard Stanton <stanton@haas.berkeley.edu> wrote:
> 
> > Using org-mode 7.8.03, I've found that exporting to LaTeX has a tough
> > time if you try to skip a header level. For example, to prevent my
> > TODO items being numbered, one method is to make them a lower-level
> > heading, and then make that level un-numbered.
> >
> > However, if I try the following:
> >
> > * To Do List
> > *** TODO First item
> > *** TODO Second item
> >
> 
> Does this do what you want?
> 
> --8<---------------cut here---------------start------------->8---
> 
> #+OPTIONS: num:1
> 
> * To Do List
> ** TODO First item
> ** TODO Second item
> --8<---------------cut here---------------end--------------->8---

Not quite, I don't think, as it removes numbers from *all* second level headers.

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

* Re: LaTeX export - can't skip a heading level
  2012-03-20 19:55 ` LaTeX export - can't skip a heading level Nick Dokos
  2012-03-20 19:57   ` Richard Stanton
@ 2012-03-20 20:30   ` Nick Dokos
  2012-03-20 22:05     ` Achim Gratz
  1 sibling, 1 reply; 14+ messages in thread
From: Nick Dokos @ 2012-03-20 20:30 UTC (permalink / raw)
  To: Richard Stanton, emacs-orgmode@gnu.org; +Cc: nicholas.dokos

Nick Dokos <nicholas.dokos@hp.com> wrote:

> Richard Stanton <stanton@haas.berkeley.edu> wrote:
> 
> > Using org-mode 7.8.03, I've found that exporting to LaTeX has a tough time
> > if you try to skip a header level. For example, to prevent my TODO items
> > being numbered, one method is to make them a lower-level heading, and then
> > make that level un-numbered.
> > 
> > However, if I try the following:
> > 
> > * To Do List
> > *** TODO First item
> > *** TODO Second item
> > 
> 
> > Then when exported to LaTeX, only the title appears (both TODO items are
> > excluded).
> > 
> PS. Not sure why the third level headlines are skipped if the second level
> headline is absent. This feels like a bug to me.
> 

The latex exporter is very rigid about what it will accept: it wants the
levels to be in strict sequence. So this has to be chalked down as a
fairly deeply ingrained limitation of the exporter. I don't see an easy way
to lift it.

Nick

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

* Re: LaTeX export - can't skip a heading level
  2012-03-20 20:30   ` Nick Dokos
@ 2012-03-20 22:05     ` Achim Gratz
  2012-03-20 23:24       ` Nick Dokos
  0 siblings, 1 reply; 14+ messages in thread
From: Achim Gratz @ 2012-03-20 22:05 UTC (permalink / raw)
  To: emacs-orgmode

Nick Dokos <nicholas.dokos@hp.com> writes:
> The latex exporter is very rigid about what it will accept: it wants the
> levels to be in strict sequence. So this has to be chalked down as a
> fairly deeply ingrained limitation of the exporter. I don't see an easy way
> to lift it.

Especially as this is a limitation of LaTeX, not the exporter.

:-)


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

DIY Stuff:
http://Synth.Stromeko.net/DIY.html

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

* Re: LaTeX export - can't skip a heading level
  2012-03-20 22:05     ` Achim Gratz
@ 2012-03-20 23:24       ` Nick Dokos
  2012-03-21  7:26         ` Achim Gratz
  0 siblings, 1 reply; 14+ messages in thread
From: Nick Dokos @ 2012-03-20 23:24 UTC (permalink / raw)
  To: Achim Gratz; +Cc: nicholas.dokos, emacs-orgmode

Achim Gratz <Stromeko@nexgo.de> wrote:

> Nick Dokos <nicholas.dokos@hp.com> writes:
> > The latex exporter is very rigid about what it will accept: it wants the
> > levels to be in strict sequence. So this has to be chalked down as a
> > fairly deeply ingrained limitation of the exporter. I don't see an easy way
> > to lift it.
> 
> Especially as this is a limitation of LaTeX, not the exporter.
> 
> :-)
> 
> 

Not true - the following compiles with no problems:

--8<---------------cut here---------------start------------->8---
...
\begin{document}

\maketitle

\setcounter{tocdepth}{3}
\tableofcontents
\vspace*{1cm}

\section{foo}
\label{sec-1}

\subsubsection{baz}
\label{sec-1-1-1}
\subsubsection{hunoz}
\label{sec-1-1-2}

\end{document}
--8<---------------cut here---------------end--------------->8---

Nick

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

* Re: TODO items as part of an itemized list?
  2012-03-20 19:31 ` TODO items as part of an itemized list? Richard Stanton
@ 2012-03-20 23:44   ` Bastien
  2012-03-21 20:40     ` Richard Stanton
  2012-03-21 21:43   ` Samuel Wales
  1 sibling, 1 reply; 14+ messages in thread
From: Bastien @ 2012-03-20 23:44 UTC (permalink / raw)
  To: Richard Stanton; +Cc: emacs-orgmode@gnu.org

Hi Richard,

Richard Stanton <stanton@haas.berkeley.edu> writes:

> To save space in LaTeX exports and also to stop my TODO items being
> numbered, I'd like to have TODO items as part of a list, e.g.,
>
> - TODO Item 1
> - TODO Item 2
>
> However, while this prints OK, these entries are ignored by org-mode when
> I ask it to create a TODO list. Is there any way to do what I want?

No, because you are mixing to different things: lists and TODO items.

TODO items start with "*".

You can convert 

* TODO item 1
* TODO item 2

to a list by selecting the region they are in, then doing C-u C-c -

You can convert a list to TODO items with C-u C-c *

Best,

-- 
 Bastien

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

* Re: LaTeX export - can't skip a heading level
  2012-03-20 23:24       ` Nick Dokos
@ 2012-03-21  7:26         ` Achim Gratz
  2012-03-21 12:12           ` Nick Dokos
  0 siblings, 1 reply; 14+ messages in thread
From: Achim Gratz @ 2012-03-21  7:26 UTC (permalink / raw)
  To: emacs-orgmode

Nick Dokos <nicholas.dokos@hp.com> writes:
>> 
>> Especially as this is a limitation of LaTeX, not the exporter.
>> 
>> :-)
>
> Not true - the following compiles with no problems:

Yes, LaTeX doesn't really enforce it, but it makes the assumption of
"correct nesting".  It's been a few years since I tried something like
you've posted, but I've quickly learned that funny things happen when
your document grows to a more realistic size (it had to do with how the
counters are interacting).  So I've stopped doing it and have never
looked back.  If you must, you can provide your own sectioning commands
in LaTeX that handle this situation more gracefully, but that's really a
bit much to ask of an org exporter, don't you think?


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptation for Waldorf rackAttack V1.04R1:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada

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

* Re: LaTeX export - can't skip a heading level
  2012-03-21  7:26         ` Achim Gratz
@ 2012-03-21 12:12           ` Nick Dokos
  0 siblings, 0 replies; 14+ messages in thread
From: Nick Dokos @ 2012-03-21 12:12 UTC (permalink / raw)
  To: Achim Gratz; +Cc: nicholas.dokos, emacs-orgmode

Achim Gratz <Stromeko@nexgo.de> wrote:

> Nick Dokos <nicholas.dokos@hp.com> writes:
> >> 
> >> Especially as this is a limitation of LaTeX, not the exporter.
> >> 
> >> :-)
> >
> > Not true - the following compiles with no problems:
> 
> Yes, LaTeX doesn't really enforce it, but it makes the assumption of
> "correct nesting".  It's been a few years since I tried something like
> you've posted, but I've quickly learned that funny things happen when
> your document grows to a more realistic size (it had to do with how the
> counters are interacting).  So I've stopped doing it and have never
> looked back.  If you must, you can provide your own sectioning commands
> in LaTeX that handle this situation more gracefully, but that's really a
> bit much to ask of an org exporter, don't you think?
> 

Certainly - I did not argue that the exporter should do this. I just
pointed out its limitation and that the limitation would be tough to
lift.

Nick

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

* Re: TODO items as part of an itemized list?
  2012-03-20 23:44   ` Bastien
@ 2012-03-21 20:40     ` Richard Stanton
  2012-03-21 21:18       ` Nick Dokos
  0 siblings, 1 reply; 14+ messages in thread
From: Richard Stanton @ 2012-03-21 20:40 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode@gnu.org

Makes sense. I realize I can achieve almost all of what I want by making
my TODO items, say, level three headers, "***", then not including
\subsubsection in my latex_class definition. Now each TODO item is printed
in LaTeX as a separate \item in an itemize list, just as I wanted.

Just one remaining problem, however. The exporter inserts a hard
line-break, "\\" after the first line of each of these \item entries. This
is fine when there is additional text for that item, but if the TODO item
is just one line, this results in unwanted extra white space being
inserted between the \item entries.




On 3/20/12 4:44 PM, "Bastien" <bzg@altern.org> wrote:

>Hi Richard,
>
>Richard Stanton <stanton@haas.berkeley.edu> writes:
>
>> To save space in LaTeX exports and also to stop my TODO items being
>> numbered, I'd like to have TODO items as part of a list, e.g.,
>>
>> - TODO Item 1
>> - TODO Item 2
>>
>> However, while this prints OK, these entries are ignored by org-mode
>>when
>> I ask it to create a TODO list. Is there any way to do what I want?
>
>No, because you are mixing to different things: lists and TODO items.
>
>TODO items start with "*".
>
>You can convert 
>
>* TODO item 1
>* TODO item 2
>
>to a list by selecting the region they are in, then doing C-u C-c -
>
>You can convert a list to TODO items with C-u C-c *
>
>Best,
>
>-- 
> Bastien

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

* Re: TODO items as part of an itemized list?
  2012-03-21 20:40     ` Richard Stanton
@ 2012-03-21 21:18       ` Nick Dokos
  2012-03-26 17:41         ` Bastien
  0 siblings, 1 reply; 14+ messages in thread
From: Nick Dokos @ 2012-03-21 21:18 UTC (permalink / raw)
  To: Richard Stanton; +Cc: Bastien, nicholas.dokos, emacs-orgmode@gnu.org

Richard Stanton <stanton@haas.berkeley.edu> wrote:


> Just one remaining problem, however. The exporter inserts a hard
> line-break, "\\" after the first line of each of these \item entries. This
> is fine when there is additional text for that item, but if the TODO item
> is just one line, this results in unwanted extra white space being
> inserted between the \item entries.
> 

Yes - unfortunately it is hardwired (line 1321 of org-latex.el).
AFAICT, there is no good reason for it to be included, even with
additional text for the item: if one wants it, then adding one
explicitly to the org file works (although the other exporters might not
like that). BTW, the html exporter also adds a hardwired <br/>.

Nick

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

* Re: TODO items as part of an itemized list?
  2012-03-20 19:31 ` TODO items as part of an itemized list? Richard Stanton
  2012-03-20 23:44   ` Bastien
@ 2012-03-21 21:43   ` Samuel Wales
  1 sibling, 0 replies; 14+ messages in thread
From: Samuel Wales @ 2012-03-21 21:43 UTC (permalink / raw)
  To: Richard Stanton; +Cc: emacs-orgmode@gnu.org

Have you tried org-export-headline-levels ?

-- 
The Kafka Pandemic: http://thekafkapandemic.blogspot.com

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

* Re: TODO items as part of an itemized list?
  2012-03-21 21:18       ` Nick Dokos
@ 2012-03-26 17:41         ` Bastien
  0 siblings, 0 replies; 14+ messages in thread
From: Bastien @ 2012-03-26 17:41 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: Richard Stanton, emacs-orgmode@gnu.org

Hi Richard and Nick,

Nick Dokos <nicholas.dokos@hp.com> writes:

> Richard Stanton <stanton@haas.berkeley.edu> wrote:
>
>
>> Just one remaining problem, however. The exporter inserts a hard
>> line-break, "\\" after the first line of each of these \item entries. This
>> is fine when there is additional text for that item, but if the TODO item
>> is just one line, this results in unwanted extra white space being
>> inserted between the \item entries.
>> 
>
> Yes - unfortunately it is hardwired (line 1321 of org-latex.el).
> AFAICT, there is no good reason for it to be included, even with
> additional text for the item: if one wants it, then adding one
> explicitly to the org file works (although the other exporters might not
> like that). BTW, the html exporter also adds a hardwired <br/>.

I fixed the LaTeX exporter, it only includes the additional \\ when the
subtree has some content.

Thanks Richard for reporing this.

-- 
 Bastien

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

end of thread, other threads:[~2012-03-26 17:40 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-20 19:27 LaTeX export - can't skip a heading level Richard Stanton
2012-03-20 19:31 ` TODO items as part of an itemized list? Richard Stanton
2012-03-20 23:44   ` Bastien
2012-03-21 20:40     ` Richard Stanton
2012-03-21 21:18       ` Nick Dokos
2012-03-26 17:41         ` Bastien
2012-03-21 21:43   ` Samuel Wales
2012-03-20 19:55 ` LaTeX export - can't skip a heading level Nick Dokos
2012-03-20 19:57   ` Richard Stanton
2012-03-20 20:30   ` Nick Dokos
2012-03-20 22:05     ` Achim Gratz
2012-03-20 23:24       ` Nick Dokos
2012-03-21  7:26         ` Achim Gratz
2012-03-21 12:12           ` Nick Dokos

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