📄 tex2rtf.tex
字号:
Optional arguments are specified using square brackets or parentheses.The braces that start command arguments must not be separated fromthe other arguments by whitespace. For example, the following producesan error:\begin{verbatim} \image{5cm;0cm} {picture.eps}\end{verbatim}and should be replaced by \begin{verbatim} \image{5cm;0cm}{picture.eps}\end{verbatim}\subsection{Avoid the setlength command}Using the $\backslash$setlength command doesn't work, since its firstargument looks like a command with the wrong number of arguments. Use analternative form instead, e.g.\begin{verbatim} \parindent 0pt\end{verbatim}instead of\begin{verbatim} \setlength{\parindent}{0pt}\end{verbatim}\subsection{Units}\index{units}%Only a subset of \LaTeX\ units may be used for specifying dimensions.Valid units are {\tt pt, mm, cm} and {\tt in}. Units should usuallybe specified for dimensions or the results may be unexpected.\subsection{Labels}\index{labels}%The \verb$\label$ command may be used for sections and figure captions,but must come immediately after the section or caption commands with nointervening whitespace.\subsection{Tables}\label{tables}\index{tables}%For best layout, table rows should be enclosed in a \verb$\row$\rtfspor \verb$\ruledrow$ command, since Tex2RTF can't cope with parsingthe \LaTeX\ tabular syntax unaided. However, if you really don't wantto go through \LaTeX\ files inserting new syntax, set the {\it compatibility}\rtfspflag to TRUE in your {\tt tex2rtf.ini} file. In this mode, Tex2RTF tries to makethe best of a bad job, but the results won't be optimal (e.g., no tableborders). Without this flag set, normal \LaTeX\ tables can crash RTF readerssuch as Word for Windows.\section{Tex2RTF for non-LaTeX users}\index{LaTeX}%You don't need to have \LaTeX\ installed to use Tex2RTF. Youcan still output RTF files to be imported into your favouriteword processor, and hypertext files for on-line help.This chapter gives a very brief introduction to \LaTeX. For furtherinformation, Kopka and Daly's {\it A Guide to \LaTeX} \cite{kopka} isrecommended.\subsection{What is \LaTeX?}\LaTeX\ is a macro package built on top of the typesetting package,\TeX. \TeX\ was written by Donald Knuth in the 1970s, and LeslieLamport wrote \LaTeX\ as a higher-level, easier way to write \TeX.\TeX\ was quite advanced for its day, and is still used (particularly byacademics) because of its free availability and its flexibility intypesetting maths and other symbols. It's more like a programminglanguage than a word processor, with embedded commands prefixed by abackslash and block structure. Like programs, \TeX\ documents areprocessed by a `compiler', outputting a .dvi file, which is a deviceindependent file which can be read by many converters for outputonto physical devices, such as screens and printers.A reason for its longevity is the ability to add facilities to\TeX, using macro packages that define new commands.\LaTeX\ is the most popular way to write \TeX. Although WYSIWYGword processors and DTP packages are outstripping \LaTeX, the increasinginterest in hypertext and mark-up languages makes \LaTeX\ relevant asa similar language to SGML documents (such as World Wide Web HTML files).Also, languages such as \LaTeX\ (and Rich Text Format, which it resemblesin many ways) are {\it complementary} to WYSIWYG packages. These languagesallow automatic production and translation of documents, where manualmark-up is impractical or undesirable.Since the source code of \TeX\ and \LaTeX\ is in the public domain,there are many free and commercial implementations of \LaTeX\ for almostevery computer in existance. Of PC implementations, EmTeX is arguablythe best and most complete. You can download it from various FTP sites.If you don't want to use \LaTeX\ itself, you may wish to use a programcalled lacheck to check your documents before using Tex2RTF, since itcatches some mistakes that Tex2RTF doesn't.\subsection{Document structure}Here is a sample of a typical \LaTeX\ document:\begin{verbatim} \documentstyle[a4,texhelp]{report} \title{A title} \author{Julian Smart} \date{October 1993} \begin{document} \maketitle \chapter{Introduction} ... \section{A section} ... \end{document}\end{verbatim}The first line is always a \verb$\documentstyle$ command. The square bracketsenclose optional {\it style} files (suffix {\tt .sty}) that alter the appearanceof the document or provide new commands, and the curly brackets enclosethe mandatory style, in this case `report'.Before the document begins properly with \verb$\begin{document}$,you can write various commands that have an effect on the appearance of thedocument or define title page information. The \verb$\maketitle$ commandwrites the title page using information defined previously (title, author,date).A report has chapters, which are divided into sections, and can be furtherdivided into subsections and subsubsections. To start a new section, youwrite the appropriate section command with the section heading; there isno specific end section command, since a new section heading or the endof the document will indicate the end of the previous section.An article is divided into sections, subsections and subsubsections, buthas no chapters. This is so an article can be included in a report as a chapter.Tex2RTF is written to deal with reports best, so stick with the reportstyle if you can.\subsection{Command syntax}There are several kinds of commands in \LaTeX. Most involve a keywordprefixed with a backslash. Here are some examples:\begin{verbatim} \titlepage \centerline{This is a centred line} \begin{center} This is a centred paragraph \end{center} {\bf This is bold font}\end{verbatim}The first example has no arguments. The second has one argument. The thirdexample is an {\it environment} which uses the begin and end keywords insteadof a pair of braces to enclose an argument (usually one). The fourth is an exampleof using a command within a pair of braces: the command applies to the scope withinthe braces. Tex2RTF treats this form as if it were a command with one argument,with the right brace delimiting the argument. In this case, the command mustimmediately follow a left brace as shown.Commands may be nested, but not overlapped.\subsection{Space}\index{space}%In \LaTeX, white space is mostly ignored, line breaks make no difference.However, \LaTeX\ interprets two successive newlines (a blank line) asdenoting a paragraph break. You may also use the \verb$\par$ command to enda paragraph.\section{Hypertext features}\index{hypertext}%\LaTeX\ is inherently suitable for specifying hypertext documents sinceit encourages description of the logical structure of a document usingsection commands. Therefore, a \LaTeX\ document is automaticallya hypertext document, without any further editing.For Windows Help, a single RTF file is generated with topicscorresponding to sections. A top level contents page shows each chapteror top-level section, and each chapter or section ends with a list offurther sections or subsections. Tex2RTF outputs help files that may beread linearly using the \rtfsp$<<$ and $>>$ buttons.Similarly, a single wxHelp XLP file is generated.For HTML, a different file is generated for each section, since theXMOSAIC browser works best with a large number of small files. The filesare named automatically based on the name of the output file, with thecontents page filename being formed from the output filename with {\tt\_contents} appended to the name. If the truncateFilenames option isbegin used, then the contents page is just the root name, with a .htmsuffix. The conversion may result in the generation of several hundredfiles for a large \LaTeX\ input file. To specify explicit jumps around a hypertext file, the \commandrefn{helpref}{helpref} command isused. The first argument is the text to be displayed at the point of reference,which will be highlighted in a hypertext file to allow jumping to a reference.The second argument is the reference label (there should be a corresponding\rtfsp\commandrefn{label}{label} command in the file, following a section or figure).To use extra Tex2RTF features in proper \LaTeX, such as \verb$\helpref$\rtfspand the C++ and CLIPS class reference documentation features, includethe style file {\tt texhelp.sty}.\section{Special sections}\index{special sections}%The treatment of bibliography, glossary and index are worth special mention.\subsection{Bibliography}\label{bibsection}\index{bibliography}%Tex2RTF recognises standard \LaTeX\ bibliography files (usually with {\tt .bib} extension)and resolves citations. The \commandrefn{bibliography}{bibliographycmd}\rtfspcommand reads the given {\tt .bib} file and includes a list ofreferences at that point in the input. Only numbered, unsortedreferences are catered for at the moment, with no variation inbibliography style. A {\bf References} heading is placed in the contentssection. Note that Tex2RTF must be run twice to ensure the citations areresolved properly.Tex2RTF can also cope with the \verb$\thebibliography$ environment, with \rtfsp \verb$\bibitem$ commands, so long as the text following the first \verb$\bibitem$\rtfsp argument is enclosed in braces as if it were a second argument.\subsection{Glossary}\label{glossarysection}\index{glossary}%Glossaries are formatted according to the following scheme.The \commandrefn{helpglossary}{helpglossary} environment is used together withthe \commandrefn{gloss}{gloss} command for glossary entries. In \LaTeX\ thisis interpreted as a description list, and each glossary entry is an item.In on-line help, each glossary entry is a section.A labelled glossary entry command may be referenced by \commandrefn{popref}{popref}\rtfsp to provide a quick popup explanation of a term.\subsection{Index}\index{index}%The explicit index is assumed to be redundant in on-line help, sincesearch facilities are provided. Therefore the \verb$\printindex$ commanddoes nothing in on-line versions. In linear RTF an index field isadded, and \commandrefn{index}{index} marks words for inserting in the index.In Windows Help, all section headings and C++ function names are treatedas keywords. A keyword may be ambiguous, that is, refer to more than onesection in the help file. This automatic indexing may not always beadequate, so the \LaTeX\ \commandrefn{index}{index} command may be usedto add keywords.In wxHelp, all section headings are indexed.\section{Authoring HTML documents}When an HTML document is generated, the suffix `\_contents' is appendedto the input file root. This will be the contents page for the document.A number of further HTML files will be generated, possibly a large numberfor a document with a large number of sections. If you are runninga 16-bit Windows version of Tex2RTF, you may wish to usethe {\it truncateFilenames} option to generate DOS filenames withappropriately truncated references inside the HTML files.\normalbox{Tip: to reduce the number of sections generated and makethe document more linear, you could define new chapter and sectioncommands. Alias them to the normal commands in real LaTeX (edit {\tt texhelp.sty}), andto appropriate bold/large headings (but not section commands) inthe Tex2RTF initialisation file.}Each HTML section file (except for the contents page) is given browsebuttons, similar to a Windows Help file: Contents, Up, Down, Back, Forward.You can set {\it htmlBrowseButtons} to specify whether bitmaps or text shouldbe used for these buttons. On a text-only browser, the buttons will showas text even if images have been specified.As well as the usual jumps within a document, you can use the \commandref{urlref}{urlref} command to jumpto other documents. `Advanced features' which are implemented for HTML include:\begin{itemize}\itemsep=0pt\item Simple tables: \commandref{tabular}{tabular} command\item Background colour/bitmap: \commandref{backgroundcolour}{backgroundcolour} and\rtfsp\commandref{backgroundimage}{backgroundimage}\item Text colour: \commandref{textcolour}{textcolour} command\end{itemize}See \helpref{HTML options}{htmloptions} for relevant initialisation fileswitches.\section{Authoring Windows Help documents}\index{WinHelp files}%To produce a Windows Help file, you need to generate a WinHelp RTF filewith Tex2RTF and then invoke a Windows Help compiler (such as hc505.exe)to translate this to a .hlp file.WinHelp support has split into two streams, Windows 3.1 help formatand Windows 95 (WinHelp 4) format. You control this with the {\it winHelpVersion} option,setting it to 3 for Windows 3.1, and 4 for Windows 95. In the latter case,you also need the Help Compiler for Windows (hcw.exe and associated components)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -