emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Include heading title in HTML section-number cross-reference, li


From: Nicolas Goaziou
Subject: Re: [O] Include heading title in HTML section-number cross-reference, like LaTex \nameref?
Date: Sat, 08 Feb 2014 22:50:47 +0100

Hello,

"D. C. Toedt" <address@hidden> writes:

> QUESTION:  When org-mode headings are NUMBERED, and the file is exported to
> HTML, is there any way to have org-mode include the TITLE, not just the
> section number, of a cross-referenced section, along the lines of the LaTex
> \nameref{} function?  Here's an example:
>
> ==BEGIN EXAMPLE==
>
> #+OPTIONS: H:7 TOC:nil @:t num:1 email:t author:t
>
> * Introduction to Technology Contracts
>   :PROPERTIES:
>   :CUSTOM_ID: IntroTechContracts
>   :END:
>
> Lorem ipsum etc. etc.
>
> * Dangerous Clauses
>   :PROPERTIES:
>   :CUSTOM_ID: DangerousClauses
>   :END:
>
> Lorem ipsum etc. etc. -- see Section [[#IntroTechContracts]].
>
> ==END EXAMPLE==

[...]

> Is that currently doable?

I think so. Not trivial, but doable nonetheless.

--8<---------------cut here---------------start------------->8---
#+MACRO: get-title (eval (save-excursion (org-open-link-from-string "[[#$1]]") 
(org-get-heading nil nil)))
#+MACRO: SECREF [[#$1][{{{get-title($1)}}}]]
#+OPTIONS: H:7 toc:nil num:1 email:t author:t

* Introduction to Technology Contracts
  :PROPERTIES:
  :CUSTOM_ID: IntroTechContracts
  :END:

Lorem ipsum etc. etc.

* Dangerous Clauses
  :PROPERTIES:
  :CUSTOM_ID: DangerousClauses
  :END:

Lorem ipsum etc. etc. -- see Section {{{SECREF(IntroTechContracts)}}}
--8<---------------cut here---------------end--------------->8---


Regards,

-- 
Nicolas Goaziou



reply via email to

[Prev in Thread] Current Thread [Next in Thread]