old-www/HOWTO/Linuxdoc-Reference-11.html

101 lines
3.6 KiB
HTML
Raw Permalink Normal View History

2020-08-23 10:33:19 +00:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
<TITLE>Linuxdoc Reference: Indices</TITLE>
<LINK HREF="Linuxdoc-Reference-12.html" REL=next>
<LINK HREF="Linuxdoc-Reference-10.html" REL=previous>
<LINK HREF="Linuxdoc-Reference.html#toc11" REL=contents>
</HEAD>
<BODY>
<A HREF="Linuxdoc-Reference-12.html">Next</A>
<A HREF="Linuxdoc-Reference-10.html">Previous</A>
<A HREF="Linuxdoc-Reference.html#toc11">Contents</A>
<HR>
<H2><A NAME="s11">11. Indices</A></H2>
<P>
<HR>
<PRE>
&lt;!entity % index "idx|cdx|nidx|ncdx" >
&lt;!element idx - - (#pcdata)>
&lt;!element cdx - - (#pcdata)>
&lt;!element nidx - - (#pcdata)>
&lt;!element ncdx - - (#pcdata)>
</PRE>
<HR>
<P>
<CENTER><TABLE BORDER><TR><TD>
<BR>
tag</TD><TD>my translation</TD></TR><TR><TD>
</TD></TR><TR><TD>
<CODE>idx</CODE></TD><TD>index</TD></TR><TR><TD>
<CODE>cdx</CODE></TD><TD>code index (terminaltype index)</TD></TR><TR><TD>
<CODE>nidx</CODE></TD><TD>invisible index</TD></TR><TR><TD>
<CODE>ncdx</CODE></TD><TD>invisible code index (terminaltype index)</TD></TR><TR><TD>
<CAPTION>Index elements
<A NAME="tindex"></A> </CAPTION>
</TD></TR></TABLE></CENTER>
<P>The index tags serve for making a index of your document.
They are only useful if you want do do LaTeX mapping.
They only differ very slightly as mentioned in table
<A HREF="#tindex">Index elements</A>.
<P>
<H2><A NAME="ss11.1">11.1 Including a index</A>
</H2>
<P>There are two ways to include indices into your document.
Look at both and decide.
<P>
<H3><A NAME="manind"></A> Manually</H3>
<P>
<OL>
<LI>Set the opts attribute of your document class to
contain the packages <EM>makeidx</EM>.
You do that by: <CODE>&lt;article opts=&quot;makeidx&quot;&gt;</CODE>.</LI>
<LI>Mark all the words you want to be in the index later
with a <EM>idx tag</EM> or <EM>cdx tag</EM>.
If the word you want to index to a location in your document
is not within the text you simply write it at the location you
want to index with the <EM>nidx tag</EM>.
It<EFBFBD>s like the normal <EM>idx</EM> only the tagged text will be silently
dropped in the normal document.</LI>
<LI>Process your file with makeindex
<CODE>sgml2latex -m mydocument.sgml</CODE>.<BR>
This will produce an additional <CODE>mydocument.idx</CODE>.</LI>
<LI>Process <CODE>mydocument.idx</CODE> with the <CODE>makeindex</CODE>
command like <CODE>makeindex mydocument.idx</CODE>.<BR>
This will produce an additional <CODE>mydocument.ind</CODE>.</LI>
<LI>To include the now generated index in your document
you process your document with
<CODE>sgml2latex -o tex -m mydocument.sgml</CODE>.<BR>
This results in output of <CODE>mydocument.tex</CODE>.</LI>
<LI>Edit <CODE>mydocument.tex</CODE> with the editor of your choice.<BR>
You look for the line <CODE>\end{document}</CODE> (should be somewhere
close to the end of the file) and insert the text
<CODE>\printindex</CODE> bevor this line.</LI>
<LI>Process the modified file with <CODE>latex mydocument.tex</CODE>.<BR>
This gives you the final <CODE>mydocument.dvi</CODE> wich aggain you might
process with <CODE>dvips</CODE> to generate a postscript document.</LI>
</OL>
A lot of a mess, ain't it?
<P>
<H3><A NAME="hackind"></A> Hacked</H3>
<P>I'm currently working on a patch to the sgmltools to automate the
inclusion and generation of a index.
To find out the current state see
<A HREF="http://www.bnhof.de/~uwe/lnd/indexpatch/index.html">http://www.bnhof.de/~uwe/lnd/indexpatch/index.html</A>.
<P>
<P>
<HR>
<A HREF="Linuxdoc-Reference-12.html">Next</A>
<A HREF="Linuxdoc-Reference-10.html">Previous</A>
<A HREF="Linuxdoc-Reference.html#toc11">Contents</A>
</BODY>
</HTML>