From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Berthier Subject: Re: formatted index entries Date: Wed, 18 Jun 2014 14:18:56 +0200 Message-ID: References: <87oaxqlft4.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41420) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxEpd-0007bx-Ea for emacs-orgmode@gnu.org; Wed, 18 Jun 2014 08:19:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WxEpX-0003xo-Ve for emacs-orgmode@gnu.org; Wed, 18 Jun 2014 08:19:13 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:3716) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxEpX-0003xW-Q5 for emacs-orgmode@gnu.org; Wed, 18 Jun 2014 08:19:07 -0400 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: Nicolas Goaziou Cc: emacs-orgmode@gnu.org You wrote: > Hello, > > Nicolas Berthier writes: > >> In an org file, I would like to add formatted index entries "=3Dword=3D", >> "!word" or similar things, possibly in a hierarchical way as sub entries >> (I know it's a very peculiar use case, but it turns out that I would >> appreciate having this feature for writing a technical manual). e.g, >> something in the spirit of: >> >> # verbatim entry: >> #+INDEX: =3Dword=3D >> #+INDEX: category!=3Dword=3D >> # # verbatim entry with an exclamation mark: >> #+INDEX: =3D!word=3D >> #+INDEX: category!=3D!word=3D >> # # or even, let's be audacious: formatted code as an entry: >> #+INDEX: src_emacs-list[:exports code](let) >> >> Using the current development branch of Org mode, exporting to HTML >> works fine for the verbatim case, yet index entries do not seem to be >> treated as Org elements when exporting to LaTeX: index entries are named >> "=3Dword=3D". Also, exclamation marks are category delimiters (as in LaT= eX), >> hence the cases makes Org insert extra categories named "=3D", and adds >> entries "word=3D" in them (both in HTML and LaTeX). >> >> This topic has already been discussed on this list before >> ( http://thread.gmane.org/gmane.emacs.orgmode/41442 ), but apparently >> this feature is not (yet?) available in org =E2=89=A5 8.0. >> >> Has it already been implemented by somebody somewhere? Any further >> thoughts on that point? > > LaTeX provides its own processor for index entries, so Org just lets it > handle #+INDEX keywords. Therefore "#+INDEX: something" becomes > "\index{something}" (see `org-latex-keyword'). You could write, e.g., > > > #+INDEX: \texttt{word} > > in order to get what you want. > > OTOH, every other back-end relies on > `org-publish-index-generate-theindex', which creates a file containing > a list of links. So "#+INDEX: something" becomes > > - [[file:...][something]] > > Thus, Org syntax is perfectly allowed, including "src_emacs-lisp{...}", > the only problem being that exclamation marks are separators in > "something". A workaround could be to make " ! " as a separator > instead: > > > #+INDEX: word ! !word > > but that would break #+INDEX keywords currently used. Putting the question of the separator aside, my objective is to be able to export the same Org document both as HTML and as LaTeX (at least). I think, as was discussed in the thread I mentioned, that being able to use Org markups in index entries could be a nice feature to do that. I understand the contents coming after `#+INDEX:' is used as is in every case (except in non-LaTeX exports for entries with `!' in them), but are handled differently: for HTML, they are put in `theindex.inc' to be handled later when this file is parsed by Org, and for LaTeX they are passed directly as argument to the `\index' command. > Note that the current set-up allows to preserve compatibility between > LaTeX and other back-ends in simple cases. IMHO, the handling of Org markups (at least) by the LaTeX exporter (and maybe others) would suffice to implement this feature (with a few tricks to still allow sorting by makeindex). Am I right? Regards, Nicolas --=20 Nicolas Berthier FSF Member #7975