emacs-orgmode
[Top][All Lists]

## Re: [Orgmode] problem with label in latex export

 From: Indraneel Majumdar Subject: Re: [Orgmode] problem with label in latex export Date: Wed, 22 Sep 2010 09:23:17 +0530 User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.9) Gecko/20100915 Lightning/1.0b2 Thunderbird/3.1.4

 Sorry, forgot to cc to the list...

Hi Bastien,


I'm so glad to receive a reply. The problem is twofold. I need numbered paragraphs in Latex, with cross-references to the paragraphs. Since latex seems to have muddled with \par and \endpar, although numbered paragraphs are possible in Tex, they are not automatic or simple in latex. Numbered lists, however are easy in orgmode. Another problem in Tex/Latex is that references always point to the beginning of the smallest environment (probably actually section, but maybe hyperref modifies it to the beginning of environment). So, placing a \label in a numbered list has the desired effect. However, orgmode seems to have a bug (or a feature lack), in that I cannot place a #+<<label>> inside a list without destroying the automatic numbering.
An example of what does not work (no label generated):
11.
#+ <<target>>
Some text
12.  More text [[target][go to]]

And this one breaks automatic numbering:

10. Something
#+<<target>>
11. Some text <<---- running C-c C-c on 11 changes it to 1.


Obviously, I want the target to be the item, not to some changeable text in the list content, and I also want to hide the target identifier. [Two more problems I noticed (or my lack of knowledge of orgmode): <<target>> always prints out the contents; i.e. an option like <<target><description>> would be nice. Also numbers in []; i.e. [[11]] or [[11][see 11]] get mangled in latex output; I couldn't figure out how to avoid that.]


Since I couldn't use numbered lists, the other option was to number paragraphs by hand, and place #+<<target>> in the lines above them. Orgmode does correctly place the \label but latex/tex ignores it. hyperref enables this label only if \phantomsection is present in the line above it. With \phantomsection and \label the pdf output works fine. Actually \phantomsection \label{target} works fine anywhere in the text.

My suggestion is twofold:


1. Allow a <<target><description>> where description can be empty or nil; eg. <<target><>> If orgmode does not do something like this already, this will allow suppressing contents of the target in the output, if target is present inline; i.e. no #+ 2. Add a \phantomsection where ever a <<target><description>> is located, while exporting to latex.


Please let me know if I'm missing something. I'm new to orgmode, and thank you for it.

Indraneel

On 2010-09-22 4:11, Bastien wrote:

Hi Indraneel,


Since orgmode already uses hyperref, is there any reason why
\phantomsection is not added before \label by default?

Can you explain why \phantomsection is useful here?

Thanks,