]> git.saurik.com Git - wxWidgets.git/blob - utils/tex2rtf/src/tex2any.h
5b2c6f4e55309758ccede08d02e3f29c93c8cf15
[wxWidgets.git] / utils / tex2rtf / src / tex2any.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: tex2any.h
3 // Purpose: Latex conversion header
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 7.9.93
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #include <stdio.h>
13 #include "wx/wx.h"
14 #include "wx/utils.h"
15 #include "wx/list.h"
16 #include "wx/hash.h"
17 #include "wxhlpblk.h"
18
19 /*
20 * Conversion modes
21 *
22 */
23
24 #define TEX_RTF 1
25 #define TEX_XLP 2
26 #define TEX_HTML 3
27
28 /*
29 * We have a list of macro definitions which we must define
30 * in advance to enable the parsing to recognize macros.
31 */
32
33 #define FORBID_OK 0
34 #define FORBID_WARN 1
35 #define FORBID_ABSOLUTELY 2
36
37
38 #ifdef __WXMSW__
39 const int MAX_LINE_BUFFER_SIZE = 600;
40 #else
41 const int MAX_LINE_BUFFER_SIZE = 11000;
42 #endif
43
44 class TexMacroDef: public wxObject
45 {
46 public:
47 int no_args;
48 char *name;
49 bool ignore;
50 int forbidden;
51 int macroId;
52
53 TexMacroDef(int the_id, const char *the_name, int n, bool ig, bool forbidLevel = FORBID_OK);
54 ~TexMacroDef(void);
55 };
56
57 #define CHUNK_TYPE_MACRO 1
58 #define CHUNK_TYPE_ARG 2
59 #define CHUNK_TYPE_STRING 3
60
61 /*
62 We have nested lists to represent the Tex document.
63 Each element of a list of chunks can be one of:
64 - a plain string
65 - a macro with/without arguments. Arguments are lists of TexChunks.
66
67 Example (\toplevel is implicit but made explicit here):
68
69 AddMacroDef(ltMYMAT, "mymat", 2);
70
71 \toplevel{The cat sat on the \mymat{very coarse and {\it cheap}}{mat}}.
72
73 Parsed as:
74
75 TexChunk: type = macro, name = toplevel, no_args = 1
76 Children:
77
78 TexChunk: type = argument
79
80 Children:
81 TexChunk: type = string, value = "The cat sat on the "
82 TexChunk: type = macro, name = mymat, no_args = 2
83
84 Children:
85 TexChunk: type = argument
86
87 Children:
88 TexChunk: type = string, value = "very coarse and "
89 TexChunk: type = macro, name = it, no_args = 1
90
91 Children:
92 TexChunk: type = argument
93
94 Children:
95 TexChunk: type = string, value = "cheap"
96
97 TexChunk: type = argument
98
99 Children:
100 TexChunk: type = string, value = mat
101 */
102
103 class TexChunk
104 {
105 public:
106 int type;
107 // char *name;
108 TexMacroDef *def;
109 char *value;
110 int macroId;
111 int no_args;
112 int argn;
113 bool optional; // Is an optional argument
114
115 wxList children;
116 TexChunk(int the_type, TexMacroDef *the_def = NULL);
117 TexChunk(TexChunk& toCopy);
118 virtual ~TexChunk(void);
119 };
120
121 // Represents a topic, used for generating a table of contents file (.cnt).
122 // Also for storing keywords found in a topic, a list of which is then inserted
123 // into the topic in the next pass.
124 class TexTopic: public wxObject
125 {
126 public:
127 // This flag is set to indicate that the topic has children.
128 // If this is the case, we know to insert a 'book' icon at this level,
129 // not just a 'page' icon. We don't want to have to open a book only
130 // to find there's only one page in it. We might force a book to be used if
131 // a top-level topic has no children (?)
132 bool hasChildren;
133 char *filename;
134 wxStringList *keywords;
135 TexTopic(char *f = NULL);
136 ~TexTopic(void);
137 };
138 extern wxHashTable TopicTable;
139 void AddKeyWordForTopic(char *topic, char *entry, char *filename = NULL);
140 void ClearKeyWordTable(void);
141
142 extern TexChunk *TopLevel;
143 extern wxHashTable MacroDefs;
144 extern wxStringList IgnorableInputFiles; // Ignorable \input files, e.g. psbox.tex
145
146 bool read_a_line(char *buf);
147 bool TexLoadFile(char *filename);
148 int ParseArg(TexChunk *thisArg, wxList& children, char *buffer, int pos,
149 char *environment = NULL, bool parseArgToBrace = TRUE, TexChunk *customMacroArgs = NULL);
150 int ParseMacroBody(const char *macro_name, TexChunk *parent, int no_args,
151 char *buffer, int pos, char *environment = NULL, bool parseArgToBrace = TRUE, TexChunk *customMacroArgs = NULL);
152 void TraverseDocument(void);
153 void TraverseFromChunk(TexChunk *chunk, wxNode *thisNode = NULL, bool childrenOnly = FALSE);
154 #define TraverseChildrenFromChunk(arg) TraverseFromChunk(arg, NULL, TRUE)
155 void SetCurrentOutput(FILE *fd);
156 void SetCurrentOutputs(FILE *fd1, FILE *fd2);
157 extern FILE *CurrentOutput1;
158 extern FILE *CurrentOutput2;
159 void AddMacroDef(int the_id, const char *name, int n, bool ignore = FALSE, bool forbidden = FALSE);
160 void TexInitialize(int bufSize);
161 void TexCleanUp(void);
162 void TexOutput(const char *s, bool ordinaryText = FALSE);
163 char *GetArgData(TexChunk *chunk);
164 char *GetArgData(void); // Get the string for the current argument
165 int GetNoArgs(void); // Get the number of arguments for the current macro
166 TexChunk *GetArgChunk(void); // Get the chunk for the current argument
167 TexChunk *GetTopLevelChunk(void); // Get the chunk for the top level
168 TexChunk *GetNextChunk(void); // Look ahead to the next chunk
169 bool IsArgOptional(void); // Is this argument an optional argument?
170 void DefineDefaultMacros(void); // Optional set of default macros
171 int GetCurrentColumn(void); // number of characters on current line
172 char *ConvertCase(char *s); // Convert case, according to upperCaseNames setting.
173 extern wxPathList TexPathList; // Path list, can be used for file searching.
174
175 // Define a variable value from the .ini file
176 char *RegisterSetting(char *settingName, char *settingValue, bool interactive = TRUE);
177
178 // Major document styles
179 #define LATEX_REPORT 1
180 #define LATEX_ARTICLE 2
181 #define LATEX_LETTER 3
182 #define LATEX_BOOK 4
183 #define LATEX_SLIDES 5
184
185 extern TexChunk *DocumentTitle;
186 extern TexChunk *DocumentAuthor;
187 extern TexChunk *DocumentDate;
188 extern int DocumentStyle;
189 extern int MinorDocumentStyle;
190 extern char *BibliographyStyleString;
191 extern char *DocumentStyleString;
192 extern char *MinorDocumentStyleString;
193
194 extern int normalFont;
195 extern int smallFont;
196 extern int tinyFont;
197 extern int largeFont1;
198 extern int LargeFont2;
199 extern int LARGEFont3;
200 extern int hugeFont1;
201 extern int HugeFont2;
202 extern int HUGEFont3;
203
204 /*
205 * USER-ADJUSTABLE SETTINGS
206 *
207 */
208
209 // Section font sizes
210 extern int chapterFont;
211 extern int sectionFont;
212 extern int subsectionFont;
213 extern int titleFont;
214 extern int authorFont;
215 extern bool winHelp; // Output in Windows Help format if TRUE, linear otherwise
216 extern bool isInteractive;
217 extern bool runTwice;
218 extern int convertMode;
219 extern bool checkCurleyBraces;
220 extern bool checkSyntax;
221 extern bool stopRunning;
222 extern int mirrorMargins;
223 extern bool headerRule;
224 extern bool footerRule;
225 extern int labelIndentTab; // From left indent to item label (points)
226 extern int itemIndentTab; // From left indent to item (points)
227 extern bool useUpButton;
228 extern int htmlBrowseButtons;
229 extern bool useHeadingStyles; // Insert \s1, s2 etc.
230 extern bool useWord; // Insert Word table of contents, etc. etc.
231 extern bool indexSubsections; // put subsections in index
232 extern bool compatibilityMode;
233 extern bool generateHPJ; // Generate WinHelp HPJ file
234 extern char *winHelpTitle; // Title for Windows Help file
235 extern int defaultTableColumnWidth;
236 extern char *bitmapMethod;
237 extern bool truncateFilenames; // Truncate for DOS
238 extern int winHelpVersion; // Version e.g. 4 for Win95
239 extern bool winHelpContents; // Generate .cnt file
240 extern bool htmlIndex; // Generate .htx HTML index file
241 extern bool htmlFrameContents; // Use frames for HTML contents page
242 extern int contentsDepth; // Depth of contents for linear RTF files
243 extern bool upperCaseNames; // Filenames; default is lower case
244 extern char *backgroundImageString; // HTML background image
245 extern char *backgroundColourString; // HTML background colour
246 extern char *textColourString; // HTML text colour
247 extern char *linkColourString; // HTML link colour
248 extern char *followedLinkColourString; // HTML followed link colour
249 extern bool combineSubSections; // Stop splitting files below section
250 extern bool htmlWorkshopFiles; // generate HTML Help Workshop project files
251 extern bool ignoreBadRefs; // Don't insert (REF NOT FOUND)
252
253 // Names to help with internationalisation
254 extern char *ContentsNameString;
255 extern char *AbstractNameString;
256 extern char *GlossaryNameString;
257 extern char *ReferencesNameString;
258 extern char *FiguresNameString;
259 extern char *TablesNameString;
260 extern char *FigureNameString;
261 extern char *TableNameString;
262 extern char *IndexNameString;
263 extern char *ChapterNameString;
264 extern char *SectionNameString;
265 extern char *SubsectionNameString;
266 extern char *SubsubsectionNameString;
267 extern char *UpNameString;
268
269 /*
270 * HTML button identifiers: what kind of browse buttons
271 * are placed in HTML files, if any.
272 *
273 */
274
275 #define HTML_BUTTONS_NONE 0
276 #define HTML_BUTTONS_BITMAP 1
277 #define HTML_BUTTONS_TEXT 2
278
279 /*
280 * Section numbering
281 *
282 */
283
284 extern int chapterNo;
285 extern int sectionNo;
286 extern int subsectionNo;
287 extern int subsubsectionNo;
288 extern int figureNo;
289 extern int tableNo;
290
291 extern int ParSkip;
292 extern int ParIndent;
293
294 extern bool isSync;
295
296 // Set by client and by Tex2Any
297 extern TexChunk *currentSection;
298
299 // Header/footers/pagestyle
300 extern TexChunk * LeftHeaderOdd;
301 extern TexChunk * LeftFooterOdd;
302 extern TexChunk * CentreHeaderOdd;
303 extern TexChunk * CentreFooterOdd;
304 extern TexChunk * RightHeaderOdd;
305 extern TexChunk * RightFooterOdd;
306 extern TexChunk * LeftHeaderEven;
307 extern TexChunk * LeftFooterEven;
308 extern TexChunk * CentreHeaderEven;
309 extern TexChunk * CentreFooterEven;
310 extern TexChunk * RightHeaderEven;
311 extern TexChunk * RightFooterEven;
312 extern char * PageStyle;
313
314 // Repeat the currentSection, either real (Chapter) or simulated (References)
315 extern void OutputCurrentSection(void);
316 extern void OutputCurrentSectionToString(char *buf);
317 extern void OutputChunkToString(TexChunk *chunk, char *buf);
318
319 extern char *fakeCurrentSection;
320
321 // Called by Tex2Any to simulate a section
322 extern void FakeCurrentSection(char *fakeSection, bool addToContents = TRUE);
323
324 /*
325 * Local to Tex2Any library
326 *
327 */
328
329 extern char *currentArgData;
330 extern bool haveArgData; // If TRUE, we're simulating the data.
331 void StartSimulateArgument(char *data);
332 void EndSimulateArgument(void);
333
334 /*
335 * Client-defined
336 *
337 */
338
339 // Called on start/end of macro examination
340 void OnMacro(int macroId, int no_args, bool start);
341
342 // Called on start/end of argument examination.
343 // Return TRUE at the start of an argument to traverse
344 // (output) the argument.
345 bool OnArgument(int macroId, int arg_no, bool start);
346
347 // Default: library-defined
348 void DefaultOnMacro(int macroId, int no_args, bool start);
349
350 // Default: library-defined
351 bool DefaultOnArgument(int macroId, int arg_no, bool start);
352
353 // Called on error
354 void OnError(const char *msg);
355
356 // Called for information
357 void OnInform(const char *msg);
358
359 // Special yield wrapper
360 void Tex2RTFYield(bool force = FALSE);
361
362 /*
363 * Useful utilities
364 *
365 */
366
367 // Look for \label macro, use this ref name if found or
368 // make up a topic name otherwise.
369 char *FindTopicName(TexChunk *chunk);
370 // Force the current topic to be this (e.g. force 'references' label).
371 void ForceTopicName(const char *name);
372 void ResetTopicCounter(void);
373
374 // Parse unit eg. 14, 12pt, 34cm and return value in points.
375 int ParseUnitArgument(char *unitArg);
376
377 // Set small, large, normal etc. point sizes for reference size
378 void SetFontSizes(int pointSize);
379
380 /*
381 * Strip off any extension (dot something) from end of file,
382 * IF one exists. Inserts zero into buffer.
383 *
384 */
385
386 void StripExtension(char *buffer);
387
388 /*
389 * Reference structure
390 *
391 */
392
393 class TexRef: public wxObject
394 {
395 public:
396 char *refLabel; // Reference label
397 char *refFile; // Reference filename (can be NULL)
398 char *sectionNumber; // Section or figure number (as a string)
399 char *sectionName; // name e.g. 'section'
400 TexRef(const char *label, const char *file, const char *section, const char *sectionN = NULL);
401 ~TexRef(void);
402 };
403
404 /*
405 * Add a reference
406 *
407 */
408
409 void AddTexRef(char *name, char *file = NULL, char *sectionName = NULL,
410 int chapter = 0, int section = 0, int subsection = 0, int subsubsection = 0);
411
412 /*
413 * Read and write reference file (.ref), to resolve refs for second pass.
414 *
415 */
416 void WriteTexReferences(char *filename);
417 void ReadTexReferences(char *filename);
418
419 /*
420 * Bibliography stuff
421 *
422 */
423
424 class BibEntry: public wxObject
425 {
426 public:
427 char *key;
428
429 /*
430 * book, inbook, article, phdthesis, inproceedings, techreport
431 */
432 char *type;
433
434 /*
435 * Possible fields
436 *
437 */
438 char *editor;
439 char *title;
440 char *booktitle;
441 char *author;
442 char *journal;
443 char *volume;
444 char *number;
445 char *year;
446 char *month;
447 char *pages;
448 char *chapter;
449 char *publisher;
450 char *address;
451 char *institution;
452 char *organization;
453 char *comment;
454
455 inline BibEntry(void)
456 {
457 key = NULL;
458 type = NULL;
459 editor = NULL;
460 title = NULL;
461 booktitle = NULL;
462 author = NULL;
463 journal = NULL;
464 volume = NULL;
465 number = NULL;
466 chapter = NULL;
467 year = NULL;
468 month = NULL;
469 pages = NULL;
470 publisher = NULL;
471 address = NULL;
472 institution = NULL;
473 organization = NULL;
474 comment = NULL;
475 }
476 };
477
478 extern wxList BibList;
479 extern wxStringList CitationList;
480
481 bool ReadBib(char *filename);
482 void OutputBib(void);
483 void ResolveBibReferences(void);
484 void AddCitation(char *citeKey);
485 TexRef *FindReference(char *key);
486
487 /*
488 * Ability to customize, or at least suppress unknown macro errors
489 *
490 */
491
492 extern wxList CustomMacroList;
493
494 #define CUSTOM_MACRO_IGNORE 0
495 #define CUSTOM_MACRO_OUTPUT 1
496 #define CUSTOM_MACRO_MARK 2
497
498 class CustomMacro: public wxObject
499 {
500 public:
501 char *macroName;
502 char *macroBody;
503 int noArgs;
504 inline CustomMacro(char *name, int args, char *body)
505 {
506 noArgs = args;
507 macroName = copystring(name);
508 if (body)
509 macroBody = copystring(body);
510 else
511 macroBody = NULL;
512 }
513 ~CustomMacro();
514 };
515
516 bool ReadCustomMacros(char *filename);
517 void ShowCustomMacros(void);
518 CustomMacro *FindCustomMacro(char *name);
519 char *ParseMultifieldString(char *s, int *pos);
520
521 /*
522 * Colour table stuff
523 *
524 */
525
526 class ColourTableEntry: public wxObject
527 {
528 public:
529 char *name;
530 unsigned int red;
531 unsigned int green;
532 unsigned int blue;
533
534 ColourTableEntry(const char *theName, unsigned int r, unsigned int g, unsigned int b);
535 ~ColourTableEntry(void);
536 };
537
538 extern wxList ColourTable;
539 extern void AddColour(const char *theName, unsigned int r, unsigned int g, unsigned int b);
540 extern int FindColourPosition(char *theName);
541 // Converts e.g. "red" -> "#FF0000"
542 extern bool FindColourHTMLString(char *theName, char *buf);
543 extern void InitialiseColourTable(void);
544
545 #define ltABSTRACT 1
546 #define ltADDCONTENTSLINE 2
547 #define ltADDTOCOUNTER 3
548 #define ltALPH1 4
549 #define ltALPH2 5
550 #define ltAPPENDIX 6
551 #define ltARABIC 7
552 #define ltARRAY 8
553 #define ltAUTHOR 9
554
555 #define ltBACKSLASH 30
556 #define ltBASELINESKIP 31
557 #define ltBF 32
558 #define ltBIBITEM 33
559 #define ltBIBLIOGRAPHYSTYLE 34
560 #define ltBIBLIOGRAPHY 35
561 #define ltBOXIT 36
562 #define ltBACKSLASHRAW 37
563 #define ltBACKGROUND 38
564 #define ltBACKGROUNDCOLOUR 39
565 #define ltBACKGROUNDIMAGE 40
566 #define ltBRCLEAR 41
567
568 #define ltCAPTIONSTAR 50
569 #define ltCAPTION 51
570 #define ltCDOTS 52
571 #define ltCENTERLINE 53
572 #define ltCENTERING 54
573 #define ltCENTER 55
574 #define ltCEXTRACT 56
575 #define ltCHAPTERHEADING 57
576 #define ltCHAPTERSTAR 58
577 #define ltCHAPTER 59
578 #define ltCINSERT 60
579 #define ltCITE 61
580 #define ltCLASS 62
581 #define ltCLEARDOUBLEPAGE 63
582 #define ltCLEARPAGE 64
583 #define ltCLINE 65
584 #define ltCLIPSFUNC 66
585 #define ltCOLUMNSEP 67
586 #define ltCOMMENT 68
587 #define ltCOPYRIGHT 69
588 #define ltCPARAM 70
589
590 #define ltCHEAD 71
591 #define ltCFOOT 72
592
593 #define ltCHAPTERHEADINGSTAR 73
594
595 #define ltDATE 90
596 #define ltDESCRIPTION 91
597 #define ltDESTRUCT 92
598 #define ltDOCUMENTSTYLE 93
599 #define ltDOCUMENT 94
600 #define ltDOUBLESPACE 95
601 #define ltDEFINECOLOUR 96
602 #define ltDEFINECOLOR 97
603
604 #define ltEM 120
605 #define ltENUMERATE 121
606 #define ltEQUATION 122
607 #define ltEVENSIDEMARGIN 123
608
609 #define ltFBOX 150
610 #define ltFIGURE 151
611 #define ltFLUSHLEFT 152
612 #define ltFLUSHRIGHT 153
613 #define ltFOOTHEIGHT 154
614 #define ltFOOTNOTE 155
615 #define ltFOOTSKIP 156
616 #define ltFRAMEBOX 157
617 #define ltFUNCTIONSECTION 158
618 #define ltFUNC 159
619 #define ltFIGURESTAR 160
620 #define ltFOOTNOTESIZE 161
621 #define ltFOOTNOTEPOPUP 162
622 #define ltFANCYPLAIN 163
623 #define ltFCOL 164
624 #define ltBCOL 165
625 #define ltFOLLOWEDLINKCOLOUR 166
626
627 #define ltGLOSSARY 180
628 #define ltGLOSS 181
629
630 #define ltHEADHEIGHT 200
631 #define ltHELPGLOSSARY 201
632 #define ltHELPIGNORE 202
633 #define ltHELPONLY 203
634 #define ltHELPINPUT 204
635 #define ltHELPFONTFAMILY 205
636 #define ltHELPFONTSIZE 206
637 #define ltHELPREFN 207
638 #define ltHELPREF 208
639 #define ltHFILL 209
640 #define ltHLINE 210
641 #define ltHRULE 211
642 #define ltHSPACESTAR 212
643 #define ltHSPACE 213
644 #define ltHSKIPSTAR 214
645 #define ltHSKIP 215
646 #define lthuge 216
647 #define ltHuge 217
648 #define ltHUGE 218
649 #define ltHTMLIGNORE 219
650 #define ltHTMLONLY 220
651
652 #define ltINCLUDEONLY 240
653 #define ltINCLUDE 241
654 #define ltINDEX 242
655 #define ltINPUT 243
656 #define ltITEMIZE 244
657 #define ltITEM 245
658 #define ltIMAGE 246
659 #define ltIT 247
660 #define ltITEMSEP 248
661 #define ltINDENTED 249
662 #define ltIMAGEMAP 250
663 #define ltIMAGER 251
664 #define ltIMAGEL 252
665 #define ltINSERTATLEVEL 253
666
667 #define ltKILL 260
668
669 #define ltLABEL 280
670 #define ltlarge 281
671 #define ltLarge 282
672 #define ltLARGE 283
673 #define ltLATEX 284
674 #define ltLBOX 285
675 #define ltLDOTS 286
676 #define ltLINEBREAK 287
677 #define ltLISTOFFIGURES 288
678 #define ltLISTOFTABLES 289
679 #define ltLHEAD 290
680 #define ltLFOOT 291
681 #define ltLATEXIGNORE 292
682 #define ltLATEXONLY 293
683 #define ltLOWERCASE 294
684 #define ltLBRACERAW 295
685 #define ltLINKCOLOUR 296
686
687 #define ltMAKEGLOSSARY 300
688 #define ltMAKEINDEX 301
689 #define ltMAKETITLE 302
690 #define ltMARKRIGHT 303
691 #define ltMARKBOTH 304
692 #define ltMARGINPARWIDTH 305
693 #define ltMARGINPAR 306
694 #define ltMARGINPARODD 307
695 #define ltMARGINPAREVEN 308
696 #define ltMBOX 309
697 #define ltMEMBERSECTION 310
698 #define ltMEMBER 311
699 #define ltMULTICOLUMN 312
700 #define ltMARGINPARSEP 313
701
702 #define ltNEWCOUNTER 330
703 #define ltNEWLINE 331
704 #define ltNEWPAGE 332
705 #define ltNOCITE 333
706 #define ltNOINDENT 334
707 #define ltNOLINEBREAK 335
708 #define ltNOPAGEBREAK 336
709 #define ltNORMALSIZE 337
710 #define ltNORMALBOX 338
711 #define ltNORMALBOXD 339
712 #define ltNUMBEREDBIBITEM 340
713
714 #define ltONECOLUMN 360
715 #define ltODDSIDEMARGIN 361
716
717 #define ltPAGEBREAK 380
718 #define ltPAGEREF 381
719 #define ltPAGESTYLE 382
720 #define ltPAGENUMBERING 383
721 #define ltPARAGRAPHSTAR 384
722 #define ltPARAGRAPH 385
723 #define ltPARAM 386
724 #define ltPARINDENT 387
725 #define ltPARSKIP 388
726 #define ltPARTSTAR 389
727 #define ltPART 390
728 #define ltPAR 391
729 #define ltPFUNC 392
730 #define ltPICTURE 393
731 #define ltPOPREF 394
732 #define ltPOUNDS 395
733 #define ltPRINTINDEX 396
734 #define ltPSBOXTO 397
735 #define ltPSBOX 398
736 #define ltPOPREFONLY 399
737
738 #define ltQUOTE 420
739 #define ltQUOTATION 421
740
741 #define ltRAGGEDBOTTOM 440
742 #define ltRAGGEDLEFT 441
743 #define ltRAGGEDRIGHT 442
744 #define ltREF 443
745 #define ltRM 444
746 #define ltROMAN 445
747 #define ltROMAN2 446
748 #define ltRTFSP 447
749 #define ltRULE 448
750 #define ltRULEDROW 449
751 #define ltDRULED 450
752 #define ltRHEAD 451
753 #define ltRFOOT 452
754 #define ltROW 453
755 #define ltRTFIGNORE 454
756 #define ltRTFONLY 455
757 #define ltRBRACERAW 456
758 #define ltREGISTERED 457
759
760 #define ltSC 470
761 #define ltSECTIONHEADING 471
762 #define ltSECTIONSTAR 472
763 #define ltSECTION 473
764 #define ltSETCOUNTER 474
765 #define ltSF 475
766 #define ltSHORTCITE 476
767 #define ltSINGLESPACE 477
768 #define ltSLOPPYPAR 478
769 #define ltSLOPPY 479
770 #define ltSL 480
771 #define ltSMALL 481
772 #define ltSUBITEM 482
773 #define ltSUBPARAGRAPHSTAR 483
774 #define ltSUBPARAGRAPH 484
775 #define ltSPECIAL 485
776 #define ltSUBSECTIONSTAR 486
777 #define ltSUBSECTION 487
778 #define ltSUBSUBSECTIONSTAR 488
779 #define ltSUBSUBSECTION 489
780 #define ltSCRIPTSIZE 490
781 #define ltSETHEADER 491
782 #define ltSETFOOTER 492
783 #define ltSIZEDBOX 493
784 #define ltSIZEDBOXD 494
785 #define ltSECTIONHEADINGSTAR 495
786 #define ltSS 496
787 #define ltSETHOTSPOTCOLOUR 497
788 #define ltSETHOTSPOTCOLOR 498
789 #define ltSETHOTSPOTUNDERLINE 499
790 #define ltSETTRANSPARENCY 500
791
792 #define ltTABBING 510
793 #define ltTABLEOFCONTENTS 511
794 #define ltTABLE 512
795 #define ltTABULAR 513
796 #define ltTAB 514
797 #define ltTEX 515
798 #define ltTEXTWIDTH 516
799 #define ltTEXTHEIGHT 517
800 #define ltTHEBIBLIOGRAPHY 518
801 #define ltTITLEPAGE 519
802 #define ltTITLE 520
803 #define ltTINY 521
804 #define ltTODAY 522
805 #define ltTOPMARGIN 523
806 #define ltTOPSKIP 524
807 #define ltTT 525
808 #define ltTYPEIN 526
809 #define ltTYPEOUT 527
810 #define ltTWOCOLUMN 528
811 #define ltTHEPAGE 529
812 #define ltTHECHAPTER 530
813 #define ltTHESECTION 531
814 #define ltTHISPAGESTYLE 532
815
816 #define ltTWOCOLWIDTHA 533
817 #define ltTWOCOLWIDTHB 534
818 #define ltTWOCOLSPACING 535
819 #define ltTWOCOLITEM 536
820 #define ltTWOCOLITEMRULED 537
821 #define ltTWOCOLLIST 538
822 #define ltTEXTCOLOUR 539
823
824 #define ltUNDERLINE 550
825 #define ltURLREF 551
826 #define ltUPPERCASE 552
827 #define ltUSEPACKAGE 553
828
829 #define ltVDOTS 570
830 #define ltVERBATIMINPUT 571
831 #define ltVERBATIM 572
832 #define ltVERB 573
833 #define ltVERSE 574
834 #define ltVFILL 575
835 #define ltVLINE 576
836 #define ltVOID 577
837 #define ltVRULE 578
838 #define ltVSPACESTAR 579
839 #define ltVSKIPSTAR 580
840 #define ltVSPACE 581
841 #define ltVSKIP 582
842 #define ltVERBSTAR 583
843
844 #define ltWXCLIPS 600
845 #define ltWINHELPIGNORE 601
846 #define ltWINHELPONLY 602
847
848 #define ltXLPIGNORE 603
849 #define ltXLPONLY 604
850
851 #define ltSPACE 620
852 #define ltBACKSLASHCHAR 621
853 #define ltPIPE 622
854 #define ltFORWARDSLASH 623
855 #define ltUNDERSCORE 624
856 #define ltAMPERSAND 625
857 #define ltPERCENT 626
858 #define ltDOLLAR 627
859 #define ltHASH 628
860 #define ltLPARENTH 629
861 #define ltRPARENTH 630
862 #define ltLBRACE 631
863 #define ltRBRACE 632
864 #define ltEQUALS 633
865 #define ltRANGLEBRA 634
866 #define ltLANGLEBRA 635
867 #define ltPLUS 636
868 #define ltDASH 637
869 #define ltSINGLEQUOTE 638
870 #define ltBACKQUOTE 639
871 #define ltTILDE 640
872 #define ltAT_SYMBOL 641
873
874 // Characters, not macros but with special Latex significance
875 #define ltSPECIALDOLLAR 660
876 #define ltSPECIALDOUBLEDOLLAR 661
877 #define ltSPECIALTILDE 662
878 #define ltSPECIALHASH 663
879 #define ltSPECIALAMPERSAND 664
880 #define ltSUPERTABULAR 665
881
882 // Accents
883 #define ltACCENT_GRAVE 700
884 #define ltACCENT_ACUTE 701
885 #define ltACCENT_CARET 702
886 #define ltACCENT_UMLAUT 703
887 #define ltACCENT_TILDE 704
888 #define ltACCENT_DOT 705
889 #define ltACCENT_CADILLA 706
890
891 // Symbols
892 #define ltALPHA 800
893 #define ltBETA 801
894 #define ltGAMMA 802
895 #define ltDELTA 803
896 #define ltEPSILON 804
897 #define ltVAREPSILON 805
898 #define ltZETA 806
899 #define ltETA 807
900 #define ltTHETA 808
901 #define ltVARTHETA 809
902 #define ltIOTA 810
903 #define ltKAPPA 811
904 #define ltLAMBDA 812
905 #define ltMU 813
906 #define ltNU 814
907 #define ltXI 815
908 #define ltPI 816
909 #define ltVARPI 817
910 #define ltRHO 818
911 #define ltVARRHO 819
912 #define ltSIGMA 820
913 #define ltVARSIGMA 821
914 #define ltTAU 822
915 #define ltUPSILON 823
916 #define ltPHI 824
917 #define ltVARPHI 825
918 #define ltCHI 826
919 #define ltPSI 827
920 #define ltOMEGA 828
921
922 #define ltCAP_GAMMA 830
923 #define ltCAP_DELTA 831
924 #define ltCAP_THETA 832
925 #define ltCAP_LAMBDA 833
926 #define ltCAP_XI 834
927 #define ltCAP_PI 835
928 #define ltCAP_SIGMA 836
929 #define ltCAP_UPSILON 837
930 #define ltCAP_PHI 838
931 #define ltCAP_PSI 839
932 #define ltCAP_OMEGA 840
933
934 // Binary operation symbols
935 #define ltLE 850
936 #define ltLEQ 851
937 #define ltLL 852
938 #define ltSUBSET 853
939 #define ltSUBSETEQ 854
940 #define ltSQSUBSET 855
941 #define ltSQSUBSETEQ 856
942 #define ltIN 857
943 #define ltVDASH 858
944 #define ltMODELS 859
945 #define ltGE 860
946 #define ltGEQ 861
947 #define ltGG 862
948 #define ltSUPSET 863
949 #define ltSUPSETEQ 864
950 #define ltSQSUPSET 865
951 #define ltSQSUPSETEQ 866
952 #define ltNI 867
953 #define ltDASHV 868
954 #define ltPERP 869
955 #define ltNEQ 870
956 #define ltDOTEQ 871
957 #define ltAPPROX 872
958 #define ltCONG 873
959 #define ltEQUIV 874
960 #define ltPROPTO 875
961 #define ltPREC 876
962 #define ltPRECEQ 877
963 #define ltPARALLEL 878
964 #define ltSIM 879
965 #define ltSIMEQ 880
966 #define ltASYMP 881
967 #define ltSMILE 882
968 #define ltFROWN 883
969 #define ltBOWTIE 884
970 #define ltSUCC 885
971 #define ltSUCCEQ 886
972 #define ltMID 887
973
974 // Negated relation symbols (selected)
975 #define ltNOTEQ 890
976 #define ltNOTIN 891
977 #define ltNOTSUBSET 892
978
979 // Arrows
980 #define ltLEFTARROW 900
981 #define ltLEFTARROW2 901
982 #define ltRIGHTARROW 902
983 #define ltRIGHTARROW2 903
984 #define ltLEFTRIGHTARROW 904
985 #define ltLEFTRIGHTARROW2 905
986 #define ltUPARROW 906
987 #define ltUPARROW2 907
988 #define ltDOWNARROW 908
989 #define ltDOWNARROW2 909
990
991 // Miscellaneous symbols
992 #define ltALEPH 1000
993 #define ltWP 1001
994 #define ltRE 1002
995 #define ltIM 1003
996 #define ltEMPTYSET 1004
997 #define ltNABLA 1005
998 #define ltSURD 1006
999 #define ltPARTIAL 1007
1000 #define ltBOT 1008
1001 #define ltFORALL 1009
1002 #define ltEXISTS 1010
1003 #define ltNEG 1011
1004 #define ltSHARP 1012
1005 #define ltANGLE 1013
1006 #define ltTRIANGLE 1014
1007 #define ltCLUBSUIT 1015
1008 #define ltDIAMONDSUIT 1016
1009 #define ltHEARTSUIT 1017
1010 #define ltSPADESUIT 1018
1011 #define ltINFTY 1019
1012
1013 // Binary operation symbols
1014 #define ltPM 1030
1015 #define ltMP 1031
1016 #define ltTIMES 1032
1017 #define ltDIV 1033
1018 #define ltCDOT 1034
1019 #define ltAST 1035
1020 #define ltSTAR 1036
1021 #define ltCAP 1037
1022 #define ltCUP 1038
1023 #define ltVEE 1039
1024 #define ltWEDGE 1040
1025 #define ltCIRC 1041
1026 #define ltBULLET 1042
1027 #define ltDIAMOND 1043
1028 #define ltOSLASH 1044
1029 #define ltBOX 1045
1030 #define ltDIAMOND2 1046
1031 #define ltBIGTRIANGLEDOWN 1047
1032 #define ltOPLUS 1048
1033 #define ltOTIMES 1049
1034
1035 // Latex2e commands
1036 #define ltRMFAMILY 1200
1037 #define ltSFFAMILY 1201
1038 #define ltTTFAMILY 1202
1039 #define ltBFSERIES 1203
1040 #define ltITSHAPE 1204
1041 #define ltSLSHAPE 1205
1042 #define ltSCSHAPE 1206
1043
1044 #define ltMDSERIES 1207
1045 #define ltUPSHAPE 1208
1046
1047 #define ltTEXTRM 1209
1048 #define ltTEXTSF 1210
1049 #define ltTEXTTT 1211
1050 #define ltTEXTBF 1212
1051 #define ltTEXTIT 1213
1052 #define ltTEXTSL 1214
1053 #define ltTEXTSC 1215
1054 #define ltEMPH 1216
1055
1056 #define ltDOCUMENTCLASS 1217
1057
1058 // Space macros
1059 #define ltSMALLSPACE1 1250
1060 #define ltSMALLSPACE2 1251
1061
1062 // Pseudo-macros
1063 #define ltTOPLEVEL 15000
1064 #define ltCUSTOM_MACRO 15001
1065 #define ltSOLO_BLOCK 15002
1066
1067
1068