From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Include heading title in HTML section-number cross-reference, like LaTex \nameref? Date: Sat, 08 Feb 2014 22:50:47 +0100 Message-ID: <87k3d5nuiw.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38671) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCFnG-0001wa-2y for emacs-orgmode@gnu.org; Sat, 08 Feb 2014 16:50:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WCFnA-0008TA-1u for emacs-orgmode@gnu.org; Sat, 08 Feb 2014 16:50:33 -0500 Received: from mail-wi0-x22b.google.com ([2a00:1450:400c:c05::22b]:50155) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCFn9-0008SW-J1 for emacs-orgmode@gnu.org; Sat, 08 Feb 2014 16:50:27 -0500 Received: by mail-wi0-f171.google.com with SMTP id cc10so1800255wib.10 for ; Sat, 08 Feb 2014 13:50:26 -0800 (PST) In-Reply-To: (D. C. Toedt's message of "Sat, 8 Feb 2014 15:11:22 -0600") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "D. C. Toedt" Cc: emacs-orgmode@gnu.org Hello, "D. C. Toedt" 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