Contents Up Previous Next

Troubleshooting

Below are some common problems and possible solutions.


Some of the syntax that is OK for true LaTeX but which trips up Tex2RTF, may be detected by the TCHECK program included in the tools directory of the Tex2RTF distribution. Some LaTeX errors may be picked up by the LACHECK program, also found in the tools directory.

Macro not found
Unresolved reference
Output crashes the RTF reader
Erratic list indentation
Missing figure or section reference
Linear RTF looks odd
Paragraphs preceding lists are formatted weirdly.
Unresolved references in Word for Windows
The Windows 95 help file contents hierarchy looks wrong


Macro not found

This error may indicate that Tex2RTF has not implemented a standard LaTeX command, or that a local macro package is being used that Tex2RTF does not know about. It can cause spurious secondary errors, such as not recognising the end document command.

You can get round this by defining a macro file (default name tex2rtf.ini) containing command definitions, such as:

    \crazy      [2]{{\bf #2} is crazy but #1 is not}
    \something  [0]{}
    \julian     [0]{Julian Smart}
New commands may be defined in LaTeX files, but custom macro files will have to be defined when local style files are being used. See Initialisation file syntax for further details.

The 'Macro not found' error can also be caused by a syntax error such as an unbalanced brace or passing the wrong number of arguments to a command, so look in the vicinity of the reported error for the real cause.

Here is one obscure situation that causes this error:

    \begin{center}
    {\large{\underline{A}}}
    \end{center}
The problem is too many curly brackets. This should be rewritten as:

    \begin{center}
    {\large \underline{A}}
    \end{center}
Often you get a 'Macro not found' error for \end{document}. This is a spurious side-effect of an earlier error, usually an incorrect number of arguments to a command. The location of the true error is then anywhere in the document. To home in on the error, try putting a verbatim environment \begin{comment}...\end{comment} around much of the document, and then move the \begin{comment} line down until the error manifests itself.


Unresolved reference

References and citations are usually resolved on a second pass of Tex2RTF. If this doesn't work, then a missing label or bibliographical entry is to blame.


Output crashes the RTF reader

This could be due to confusing table syntax. Set compatibility to TRUE in .ini file; also check for end of row characters backslash characters on their own on a line, and insert correct number of ampersands for the number of columns. E.g.

    hello & world\\
    \\
becomes

    hello & world\\
    &\\

Erratic list indentation

Try increasing the value of the variable listItemIndent (default 40 points) to give more space between label and following text. A global replacement of \item [ with \item[ may also be helpful to remove unnecessary space before the item label.


Missing figure or section reference

Ensure all labels directly follow captions or sections (no intervening white space).


Linear RTF looks odd

For viewing by programs other than MS Word, you should set the variable useWord to false. This will turn off some of the special RTF keywords recognised by Word (and possibly other advanced RTF readers).


Paragraphs preceding lists are formatted weirdly.

If a list has spurious spacing in it, e.g. before a \item command, the preceding paragraph can take on some of the list's indentation. This may be a WinHelp bug, or an aspect of RTF I don't fully understand. The solution is to remove unnecessary space.


Unresolved references in Word for Windows

If question marks appear instead of numbers for figures and tables, select all (e.g. CTRL-A), then press F9 twice to reformat the document twice. For the second format, respond with Update Entire Table to any prompts.


The Windows 95 help file contents hierarchy looks wrong

WinHelp version 4 (or the WIN32 Help Compiler) does not allow a book in the contents list to be followed by a page at the same level. A book must be followed by a book, for some strange reason, otherwise the page will be tacked on to the pages of the book above it, i.e. placed at the wrong level.

To get around this, Tex2RTF inserts a book in some places, if there was a book preceding it on the same level. This results in more navigation than necessary, but is better than a wrong contents page.