|
Document 419
Repairing a damaged document
Version: 3.x, 4.x, 5.x - Scientific WorkPlace & Scientific
Word
If your document has been damaged or corrupted somehow, you may be able to
repair it so that it will open successfully in SWP or SW. However, the program
does not handle every possible construct that might occur in a native LaTeX
document. If your document was originally written in native LaTeX and then
imported to SWP or SW, some problems may persist. In general, if a LaTeX
document contains a construct that differs from Plain TeX (such as array
versus matrix), you may be able to open the document in SWP or SW if you
modify it to use the LaTeX construct.
You may be able to repair a damaged document using this technique:
- Make a copy of the .tex file.
- Use the TrueTeX formatter to try to compile the document.
- Open the document with an ASCII editor, isolate and
correct any LaTeX errors, and then recompile the document with the TrueTeX
formatter.
- If LaTeX compiles the document successfully, try to open the document in SWP
or SW.
- As the program loads the document, carefully watch the display of paragraph
numbers on the Status bar.
If the document loads successfully, you have repaired the document
successfully.
- If not, note the paragraph number where the error occurred.
- Repeat steps 3 through 6 until the document loads successfully.
Encapsulating information in a TeX field
If you can isolate the lines that contain the error, you may be able to make
the document work temporarily in SWP or SW by enclosing those lines in an
encapsulated TeX field:
- Open the document with an ASCII editor.
- If much of the document is still commented out, remove the percent signs
from all but the few lines surrounding and containing the error.
- Copy the commented lines to the clipboard.
- Save and close the file.
- Open the document in SWP or SW.
- Place the insertion point where the commented lines should appear.
- Enter an encapsulated TeX field.
- Copy the lines from the clipboard, remove the percent sign at the beginning
of each line, and choose OK.
- Typeset compile the document.
- If the document compiles correctly, you've successfully repaired the document.
If the document still doesn't compile correctly, remove the TeX field from
the document.
Important Encapsulating
erroneous code is a temporary workaround. Pursue a more robust solution to the
problem.
Placing statements in an external file
Complex \def and \renewcommand statements in the preamble of your document can
prevent the program from loading the document. If your document preamble
contains such commands, you may be able to read the file if you place the
statements in an external file and then input the file from the preamble:
-
Open the document with an ASCII editor.
-
Select the statements you want to place in another file, and cut them to the
clipboard.
-
In place of the deleted items, type \input{filename.tex}
where filename is the name of the ASCII file you
will create in the next steps.
-
Open a new file with an ASCII editor.
-
Paste the statements from the clipboard into the file.
-
Name the file with a .tex extension.
-
Save the file in an appropriate subdirectory in the TCITeX/TeX directory of your
installation. If you place the file somewhere else, LaTeX won't find it when
you try to compile the document.
-
Try to open and compile the original document in SWP or SW.
Last revised 01/19/06
This document was created with Scientific WorkPlace.
|