[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] formatted index entries
From: |
Nicolas Goaziou |
Subject: |
Re: [O] formatted index entries |
Date: |
Wed, 18 Jun 2014 11:36:55 +0200 |
Hello,
Nicolas Berthier <address@hidden> writes:
> In an org file, I would like to add formatted index entries "=word=",
> "!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: =word=
> #+INDEX: category!=word=
> # # verbatim entry with an exclamation mark:
> #+INDEX: =!word=
> #+INDEX: category!=!word=
> # # 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
> "=word=". Also, exclamation marks are category delimiters (as in LaTeX),
> hence the cases makes Org insert extra categories named "=", and adds
> entries "word=" 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 ≥ 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.
Note that the current set-up allows to preserve compatibility between
LaTeX and other back-ends in simple cases.
Regards,
--
Nicolas Goaziou