emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* LaTex Output with Index
@ 2019-05-12 15:17 Robert Love
  2019-05-12 19:21 ` Fraga, Eric
  0 siblings, 1 reply; 5+ messages in thread
From: Robert Love @ 2019-05-12 15:17 UTC (permalink / raw)
  To: emacs-orgmode list

Can someone point to an example of using Org mode to generate a LaTeX document with an index?   I see the Org has section 13.1.8 Generating an index.   What is the means to turn that into LaTex with an index?   Do I have to use a project?  Is there a simple example?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: LaTex Output with Index
  2019-05-12 15:17 LaTex Output with Index Robert Love
@ 2019-05-12 19:21 ` Fraga, Eric
  2019-05-15  4:58   ` Robert Love
  0 siblings, 1 reply; 5+ messages in thread
From: Fraga, Eric @ 2019-05-12 19:21 UTC (permalink / raw)
  To: Robert Love; +Cc: emacs-orgmode list

On Sunday, 12 May 2019 at 10:17, Robert Love wrote:
> Can someone point to an example of using Org mode to generate a LaTeX
> document with an index?  I see the Org has section 13.1.8 Generating
> an index.  What is the means to turn that into LaTex with an index?
> Do I have to use a project?  Is there a simple example?

That part of the manual is for publishing to HTML, not for creating a
PDF via LaTeX.

To generate an index for LaTeX, you add

#+index: term

lines to your org file.  

You need to have a couple of extra bits in your org file for LaTeX to
know about creating an index.  In particular, you need:

#+LaTeX_HEADER: \usepackage{makeidx} \makeindex

and then a \printindex statement somewhere in your org file (probably at
the end) for the index to be generated.

Once you have your org file the way you want it, you then need to use
LaTeX itself to create the index.  So:

1. export to LaTeX
2. run pdflatex on the LaTeX file
3. run it again just to make sure (sometimes 3 runs are needed...)
4. then run makeindex on the file (base name)
5. finally run pdflatex again (maybe twice)

You can do all these steps from within Emacs.  You can either visit the
LaTeX file directly to execute steps 2-5 or you can modify
org-latex-pdf-process (via file local variables, for instance) to insert
the makeindex command.

HTH.
-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.2.3-327-g3375f0

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: LaTex Output with Index
  2019-05-12 19:21 ` Fraga, Eric
@ 2019-05-15  4:58   ` Robert Love
  2019-05-15  9:02     ` Fraga, Eric
  0 siblings, 1 reply; 5+ messages in thread
From: Robert Love @ 2019-05-15  4:58 UTC (permalink / raw)
  To: Fraga, Eric; +Cc: emacs-orgmode list

With your instructions I can now generate a document with an index.  Thanks.

However, I have one hitch.   How do I generate an index with an entry that has an “@“ symbol in it?

For example

#+index: @ terms

I’ve tried \@ and \verb{@} and several other ideas but once there is an @ sign, no entry shows up.  If I have “terms” instead of “@ terms” it works fine. The @ sign shows up OK in the body of the document, just not in an index.

Any suggestions?   


> On May 12, 2019, at 2:21 PM, Fraga, Eric <e.fraga@ucl.ac.uk> wrote:
> 
> On Sunday, 12 May 2019 at 10:17, Robert Love wrote:
>> Can someone point to an example of using Org mode to generate a LaTeX
>> document with an index?  I see the Org has section 13.1.8 Generating
>> an index.  What is the means to turn that into LaTex with an index?
>> Do I have to use a project?  Is there a simple example?
> 
> That part of the manual is for publishing to HTML, not for creating a
> PDF via LaTeX.
> 
> To generate an index for LaTeX, you add
> 
> #+index: term
> 
> lines to your org file.  
> 
> You need to have a couple of extra bits in your org file for LaTeX to
> know about creating an index.  In particular, you need:
> 
> #+LaTeX_HEADER: \usepackage{makeidx} \makeindex
> 
> and then a \printindex statement somewhere in your org file (probably at
> the end) for the index to be generated.
> 
> Once you have your org file the way you want it, you then need to use
> LaTeX itself to create the index.  So:
> 
> 1. export to LaTeX
> 2. run pdflatex on the LaTeX file
> 3. run it again just to make sure (sometimes 3 runs are needed...)
> 4. then run makeindex on the file (base name)
> 5. finally run pdflatex again (maybe twice)
> 
> You can do all these steps from within Emacs.  You can either visit the
> LaTeX file directly to execute steps 2-5 or you can modify
> org-latex-pdf-process (via file local variables, for instance) to insert
> the makeindex command.
> 
> HTH.
> -- 
> Eric S Fraga via Emacs 27.0.50, Org release_9.2.3-327-g3375f0

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: LaTex Output with Index
  2019-05-15  4:58   ` Robert Love
@ 2019-05-15  9:02     ` Fraga, Eric
  2019-05-15  9:30       ` Julius Dittmar
  0 siblings, 1 reply; 5+ messages in thread
From: Fraga, Eric @ 2019-05-15  9:02 UTC (permalink / raw)
  To: Robert Love; +Cc: emacs-orgmode list

On Tuesday, 14 May 2019 at 23:58, Robert Love wrote:
> However, I have one hitch.  How do I generate an index with an entry
> that has an “@“ symbol in it?

Unfortunately, this is beyond my latex-fu.  May have something to do
with @ being a protected symbol.  If you want to play, you could try

#+index: {\makeatletter @} term

but this could lead you down a rabbit hole.  Not sure how org & LaTeX &
makeindex will interact...

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.2.2-290-g300f15

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: LaTex Output with Index
  2019-05-15  9:02     ` Fraga, Eric
@ 2019-05-15  9:30       ` Julius Dittmar
  0 siblings, 0 replies; 5+ messages in thread
From: Julius Dittmar @ 2019-05-15  9:30 UTC (permalink / raw)
  To: emacs-orgmode

Am 15.05.19 um 11:02 schrieb Fraga, Eric:
> On Tuesday, 14 May 2019 at 23:58, Robert Love wrote:
>> However, I have one hitch.  How do I generate an index with an entry
>> that has an “@“ symbol in it?
>
> Unfortunately, this is beyond my latex-fu.  May have something to do
> with @ being a protected symbol.  If you want to play, you could try
>
> #+index: {\makeatletter @} term
>
> but this could lead you down a rabbit hole.  Not sure how org & LaTeX &
> makeindex will interact...

I think the main reason is the fact that @ has special meaning within
index entries: it tells where to put something for cases where the
automatical sorting fails.

I just googled and found the following advice:

»In order to place values with !, @, or |, which are otherwise escape
characters, in the index, one must quote these characters in the \index
command by putting a double quotation mark (") in front of them, and one
can only place a " in the index by quoting it (i.e., a key for " would
be \index{""}).

This rule does not hold for \", so to put the letter ä in the index, one
may still use \index{a@\"{a}}.«

So perhaps

#+index: "@term

works?

HTH,

Julius

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-05-15  9:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-12 15:17 LaTex Output with Index Robert Love
2019-05-12 19:21 ` Fraga, Eric
2019-05-15  4:58   ` Robert Love
2019-05-15  9:02     ` Fraga, Eric
2019-05-15  9:30       ` Julius Dittmar

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).