]> git.lyx.org Git - wiki-uploads.git/blob - Tools/LyX2OpenOffice/convtex.lyx
Import uploads from wiki
[wiki-uploads.git] / Tools / LyX2OpenOffice / convtex.lyx
1 #LyX 1.3 created this file. For more info see http://www.lyx.org/
2 \lyxformat 221
3 \textclass article
4 \language english
5 \inputencoding auto
6 \fontscheme default
7 \graphics default
8 \paperfontsize default
9 \papersize Default
10 \paperpackage a4
11 \use_geometry 0
12 \use_amsmath 0
13 \use_natbib 0
14 \use_numerical_citations 0
15 \paperorientation portrait
16 \secnumdepth 3
17 \tocdepth 3
18 \paragraph_separation indent
19 \defskip medskip
20 \quotes_language english
21 \quotes_times 2
22 \papercolumns 1
23 \papersides 1
24 \paperpagestyle default
25
26 \layout Title
27
28 Conversion to OpenOffice
29 \layout Author
30
31 N C Thomas
32 \layout Date
33
34 13th September 2007
35 \layout Standard
36
37
38 \begin_inset LatexCommand \tableofcontents{}
39
40 \end_inset 
41
42
43 \layout Section
44
45 Introduction
46 \layout Standard
47
48 It is sometimes useful to be able to convert 
49 \emph on 
50 Lyx
51 \emph default 
52  files to word-processor formats, particularly 
53 \emph on 
54 Word
55 \emph default 
56 .
57  It is more straight forward to convert to 
58 \emph on 
59 OpenOffice
60 \emph default 
61  format.
62  
63 \emph on 
64 OpenOffice
65 \emph default 
66  generally makes a good job of converting to 
67 \emph on 
68 Word
69 \emph default 
70 .
71  The script 
72 \family sans 
73 \emph on 
74 ConvTex
75 \family default 
76 \emph default 
77  performs the conversion from 
78 \emph on 
79 LaTex
80 \emph default 
81  to 
82 \emph on 
83 OpenOffice
84 \emph default 
85  i.e.
86  the 
87 \emph on 
88 Lyx
89 \emph default 
90  document must be exported to 
91 \emph on 
92 LaTex
93 \emph default 
94  first.
95  This allows 
96 \family typewriter 
97 tex
98 \family default 
99  documents that have not been produced from 
100 \emph on 
101 Lyx
102 \emph default 
103  to be converted, but sometimes that may not work as unknown assumptions
104  are often made.
105 \layout Standard
106
107 The programs are written in 
108 \emph on 
109 Python
110 \emph default 
111  for a PC running Linux or Windows®
112 \begin_inset Foot
113 collapsed true
114
115 \layout Standard
116
117 Wherever 
118 \emph on 
119 Windows
120 \emph default 
121  is referred to in this document, read it as Windows®
122 \end_inset 
123
124 , or a Mac.
125 \layout Section
126
127 Version
128 \layout Standard
129
130 This is for Release 4.
131  See 
132 \begin_inset LatexCommand \ref{Changes}
133
134 \end_inset 
135
136  for changes and bug fixes.
137 \layout Section
138
139 Installation
140 \layout Standard
141
142 This may seem a bit like ringing someone up to find out their telephone
143  number! Although you will have installed the program if you are reading
144  this, there are one or two extra points to be made.
145 \layout Subsection
146
147 Components needed
148 \layout Itemize
149
150 You need to have Python installed.
151  Linux users will probably find it included in their distribution.
152 \layout Itemize
153
154 Windows users can download it from e.g.
155  
156 \family typewriter 
157 http://www.python.org/download/
158 \layout Itemize
159
160 The GUI dialogs require the 
161 \family typewriter 
162 Tk
163 \family default 
164  and 
165 \family typewriter 
166 Tix
167 \family default 
168  to packages to be installed.
169 \layout Subsection
170
171 Configuration Completion
172 \layout Standard
173
174 You need to run the script 
175 \emph on 
176 Config.py
177 \emph default 
178  to specify your default paths and construct the configuration files used
179  by the programs.
180  See 
181 \begin_inset LatexCommand \ref{sub:Config.py}
182
183 \end_inset 
184
185  for details.
186 \layout Subsection
187
188
189 \family sans 
190 Configuration Files
191 \layout Standard
192
193 There are two configuration files constructed by 
194 \emph on 
195 Config.py
196 \emph default 
197 :
198 \layout Subsubsection
199
200 ConvTexConfig
201 \layout Enumerate
202
203
204 \begin_inset LatexCommand \label{homeDir}
205
206 \end_inset 
207
208 The first line contains your home directory path.
209  This is set to the folder within which you installed 
210 \family typewriter 
211 ConvTex.zip
212 \family default 
213  for Linux or 
214 \family typewriter 
215 ConvTexWin.zip
216 \family default 
217  for Windows.
218 \layout Enumerate
219
220
221 \begin_inset LatexCommand \label{defPath}
222
223 \end_inset 
224
225 The second line contains the full default path of your tex documents.
226 \layout Enumerate
227
228 The third line contains the default path where picture files contained in
229  your documents are stored.
230  If the program cannot find a path for a picture it assumes this as the
231  default.
232 \layout Enumerate
233
234 The fourth line contains a printer set-up string for 
235 \emph on 
236 OpenOffice
237 \emph default 
238 .
239  It defaults to an 
240 \family typewriter 
241 Epson EPL-6200
242 \family default 
243  as the document needs something.
244  It is probably best to change the printer, if you need it, from within
245  
246 \emph on 
247 OpenOffice.
248 \layout Subsubsection
249
250 ConvTexPaths
251 \layout Standard
252
253
254 \begin_inset LatexCommand \label{tempPaths}
255
256 \end_inset 
257
258 This contains the various platform-dependent paths and presets that are
259  needed internally by the Python programs.
260 \layout Section
261
262 Converting 
263 \emph on 
264 Lyx
265 \emph default 
266  Documents
267 \layout Standard
268
269
270 \begin_inset LatexCommand \label{conversion}
271
272 \end_inset 
273
274 This is done as follows:
275 \layout Subsection
276
277 Linux
278 \layout Itemize
279
280 Export your 
281 \emph on 
282 Lyx
283 \emph default 
284  file to 
285 \emph on 
286 LaTex
287 \layout Itemize
288
289 Run the program 
290 \emph on 
291 TexConv.py
292 \emph default 
293  without any parameters, or click the 
294 \family typewriter 
295 ConvTex
296 \family default 
297  bash script (which may be relocated, or you may create a link to it on
298  your Desktop; do not create a link directly to 
299 \emph on 
300 TexConv.py
301 \emph default 
302  as the default directory will be wrong); a file dialog will appear to select
303  the 
304 \family typewriter 
305 tex
306 \family default 
307  file to convert
308 \layout Itemize
309
310 Alternatively run 
311 \emph on 
312 TexConv.py
313 \emph default 
314  from a shell console, specifying 
315 \family typewriter 
316 myfile
317 \family default 
318  without the 
319 \family typewriter 
320 .tex
321 \family default 
322  extension but optionally including the full path:
323 \begin_deeper 
324 \layout LyX-Code
325
326 ./TexConv.py myfile
327 \end_deeper 
328 \layout LyX-Code
329
330 a file selection GUI will not then appear
331 \layout Itemize
332
333 If the conversion is successful then a text window will appear saying so,
334  and the result will be an
335 \noun on 
336  
337 \family typewriter 
338 sxw
339 \family default 
340 \noun default 
341  file located in your 
342 \family typewriter 
343 Documents
344 \family default 
345  directory, with the same name as your 
346 \emph on 
347 Lyx
348 \emph default 
349  file.
350  Otherwise a brief error message will appear in a text window, unless a
351  program execution error has occurred, when you may need to inspect the
352  file 
353 \family typewriter 
354 TexError
355 \family default 
356  in the 
357 \begin_inset LatexCommand \ref{tempPath}
358
359 \end_inset 
360
361  temporay folder.
362  See also 
363 \begin_inset LatexCommand \ref{errors}
364
365 \end_inset 
366
367 .
368 \layout Itemize
369
370 If you wish to obtain a 
371 \emph on 
372 Word
373 \emph default 
374  or other format file, open the 
375 \family typewriter 
376 \noun on 
377 sxw
378 \family default 
379 \noun default 
380  file in 
381 \emph on 
382 OpenOffice
383 \emph default 
384  and go from there.
385 \layout Subsection
386
387 Windows
388 \layout Itemize
389
390 Export your 
391 \emph on 
392 Lyx
393 \emph default 
394  file to 
395 \emph on 
396 LaTex
397 \layout Itemize
398
399 Double-click on 
400 \emph on 
401 TexConv.py
402 \emph default 
403  in your 
404 \begin_inset LatexCommand \ref{homeDir}
405
406 \end_inset 
407
408 home directory, or on a shortcut to it of you have made one; a file dialog
409  will appear to select the 
410 \family typewriter 
411 tex
412 \family default 
413  file to convert
414 \layout Itemize
415
416 Alternatively run 
417 \emph on 
418 TexConv.py
419 \emph default 
420  from the command prompt, specifying 
421 \family typewriter 
422 myfile
423 \family default 
424  without the 
425 \family typewriter 
426 .tex
427 \family default 
428  extension but optionally including the full path:
429 \layout LyX-Code
430
431 TexConv.py myfile
432 \newline 
433
434 \newline 
435 a file selection GUI will not then appear
436 \layout Itemize
437
438 If the conversion is successful then a text window will appear saying so,
439  and the result will be an 
440 \family typewriter 
441 odt
442 \family default 
443  file located in your
444 \begin_inset LatexCommand \ref{homeDir}
445
446 \end_inset 
447
448 home directory, with the same name as your 
449 \emph on 
450 Lyx
451 \emph default 
452  file.
453  Otherwise a brief error message will appear in a text window, unless a
454  program execution error has occurred, when you may need to inspect the
455  file 
456 \family typewriter 
457 TexError
458 \family default 
459  in the 
460 \begin_inset LatexCommand \ref{tempPath}
461
462 \end_inset 
463
464 temporay folder.
465  See also 
466 \begin_inset LatexCommand \ref{errors}
467
468 \end_inset 
469
470 .
471 \layout Itemize
472
473 If you wish to obtain a 
474 \emph on 
475 Word
476 \emph default 
477  or other format file, open the 
478 \family typewriter 
479 odt
480 \family default 
481  file in 
482 \emph on 
483 OpenOffice
484 \emph default 
485  and go from there.
486 \layout Subsection
487
488 If there are errors
489 \begin_inset LatexCommand \label{errors}
490
491 \end_inset 
492
493
494 \layout Standard
495
496 Examine the file 
497 \family typewriter 
498 TexError
499 \family default 
500  in your 
501 \begin_inset LatexCommand \ref{tempPath}
502
503 \end_inset 
504
505  temporary folder for a brief error report.
506 \layout Section
507
508 Viewing the Converted Document
509 \layout Standard
510
511 When you view the converted document with 
512 \emph on 
513 OpenOffice
514 \emph default 
515  it may reformat itself after a short time, and you may lose your viewing
516  position, especially if the document is large.
517  If you have placed the cursor then left-arrow/right-arrow should restore
518  your viewing point.
519 \layout Standard
520
521 The reason for this has not been discovered, but may arise from 
522 \begin_inset Quotes eld
523 \end_inset 
524
525 overkill
526 \begin_inset Quotes erd
527 \end_inset 
528
529  in specifying the paragraph formats more completely in XML than is perhaps
530  necessary (to save a lot of extra mucking about when parsing).
531 \layout Standard
532
533 Before submitting for publication you can make a trivial amendment and re-save
534  the document, which overcomes this (that is, if you have not had to make
535  other amendments anyway :-) )
536 \layout Section
537
538 Exceptions
539 \layout Standard
540
541 This project is only partially complete, but has reached a useful stage.
542  For example the 
543 \emph on 
544 Lyx
545 \emph default 
546  UserGuide part 1 can be converted successfully, which covers a lot of ground.
547 \layout Subsection
548
549 Features not implemented
550 \layout Standard
551
552 So far the following 
553 \emph on 
554 Lyx
555 \emph default 
556  features have not been implemented:
557 \layout Itemize
558
559 document layout: some features are omitted (see
560 \begin_inset LatexCommand \ref{sec:Styles}
561
562 \end_inset 
563
564 ), in particular
565 \begin_deeper 
566 \layout Itemize
567
568 split columns
569 \layout Itemize
570
571 change of colour
572 \layout Itemize
573
574 customised list labels
575 \layout Itemize
576
577 language (English assumed)
578 \end_deeper 
579 \layout Itemize
580
581 paragraph layout: only label widths have been implemented
582 \layout Itemize
583
584 character layout: mostly implemented (see
585 \begin_inset LatexCommand \ref{sec:Styles}
586
587 \end_inset 
588
589 ), but colour, language and toggling are not implemented
590 \layout Itemize
591
592 document paging has not been calculated, so 
593 \family typewriter 
594 vfill
595 \family default 
596  is not implemented, page references are converted into chapter or section
597  references, and forced page breaks are not implemented
598 \layout Itemize
599
600 AMS standards have not been implemented as presumably that august body prefers
601  documents in 
602 \emph on 
603 Lyx
604 \emph default 
605
606 \emph on 
607 LaTex
608 \emph default 
609  or 
610 \emph on 
611 Tex
612 \emph default 
613  form rather than in word-processor format
614 \layout Itemize
615
616 hyphenation points
617 \layout Itemize
618
619
620 \begin_inset LatexCommand \label{mathcal}
621
622 \end_inset 
623
624 neither 
625 \family typewriter 
626 blackboard
627 \family default 
628
629 \family typewriter 
630 calligraphic
631 \family default 
632
633 \family typewriter 
634 fraktur
635 \family default 
636  nor 
637 \family typewriter 
638 teletype
639 \family default 
640  fonts are recognised by 
641 \emph on 
642 StarMath
643 \emph default 
644  (used by 
645 \emph on 
646 OpenOffice
647 \emph default 
648  for equations)
649 \layout Itemize
650
651 Algorithm and Floatfit Figure
652 \layout Subsection
653
654 Variations from 
655 \emph on 
656 Lyx
657 \layout Standard
658
659 Variations from 
660 \emph on 
661 Lyx
662 \emph default 
663  are:
664 \layout Itemize
665
666 equation array lines are only labelled if referred to by cross-references
667 \layout Itemize
668
669 the use of sideways text in tables can only be used in table header rows,
670  and only for the whole row; this is because 
671 \emph on 
672 OpenOffice
673 \emph default 
674  does not permit otherwise (as far as the author has been able to discover)
675 \layout Itemize
676
677 the 
678 \family typewriter 
679 slanted
680 \family default 
681  font is rendered as
682 \family typewriter 
683  italic
684 \family default 
685  (a suitable alternative in 
686 \emph on 
687 OpenOffice
688 \emph default 
689  has not been found)
690 \layout Itemize
691
692 floats are not implemented by 
693 \emph on 
694 OpenOffice
695 \emph default 
696 , so figure and table floats are put in a paragraph-aligned frame to keep
697  the caption and object together
698 \layout Itemize
699
700 margin notes are converted to footnotes
701 \layout Itemize
702
703 comments are ignored
704 \layout Subsection
705
706 Other Issues
707 \layout Standard
708
709 Other implementation aspects:
710 \layout Itemize
711
712 tables are not allowed to be split across pages
713 \layout Itemize
714
715 in the 
716 \family typewriter 
717 lyxcode
718 \family default 
719  environment protected blanks are converted into soft ones as otherwise
720  the word-processor can split long lines in the middle of words.
721  However a protected blank at the start of a line is retained for obvious
722  reasons.
723 \layout Itemize
724
725 The following graphics formats can be correctly sized:
726 \newline 
727
728 \family typewriter 
729 bmp, eps, gif, jpg 
730 \family default 
731 and
732 \family typewriter 
733  jpeg, pcx, png, ps, xbm
734 \family default 
735  
736 \newline 
737 other types are sized as 12 x 9 cm
738 \newline 
739 this is because no size information is available in the 
740 \emph on 
741 LaTex
742 \emph default 
743  file
744 \layout Itemize
745
746
747 \emph on 
748 OpenOffice
749 \emph default 
750  does not display 
751 \family typewriter 
752 eps
753 \family default 
754  or 
755 \family typewriter 
756 ps
757 \family default 
758  images
759 \family typewriter 
760 .
761  eps
762 \family default 
763  images appear as a sized box including details of the image, and will print
764  correctly on a Postscript® printer.
765  Otherwise convert the image to another format before including it.
766 \layout Itemize
767
768 If an object is defined which is not a standard 
769 \emph on 
770 Lyx
771 \emph default 
772  one the program does its best but may produce funny results as it cannot
773  guess what is really wanted.
774  This applies in particular to 
775 \family typewriter 
776 tex
777 \family default 
778  documents not produced by 
779 \emph on 
780 Lyx
781 \emph default 
782 .
783  The first program is adaptive and adds unrecognised objects to its dictionaries.
784 \layout Section
785
786
787 \begin_inset LatexCommand \label{Changes}
788
789 \end_inset 
790
791 Changes between Releases
792 \layout Subsection
793
794 Release 1
795 \layout Standard
796
797 None, but this was for Linux users only.
798 \layout Subsection
799
800 Release 2
801 \layout Standard
802
803 The Python programs were made platform-independent and extra configuration-suppo
804 rt files were introduced for Linux and Windows (XP by default) 
805 \layout Subsection
806
807 Release 3
808 \layout Standard
809
810 The following bugs were fixed
811 \layout Itemize
812
813 Table column formats now recognise >{centering}, >{raggedleft} and >{raggedright
814 }
815 \layout Itemize
816
817 Paragraph Spacing (see 
818 \begin_inset LatexCommand \ref{spacing}
819
820 \end_inset 
821
822 ) now works properly (for sizes specified in 
823 \family typewriter 
824 mm
825 \family default 
826
827 \family typewriter 
828 cm
829 \family default 
830
831 \family typewriter 
832 in
833 \family default 
834  and 
835 \family typewriter 
836 cc
837 \family default 
838  only).
839 \layout Itemize
840
841 Table and figure floats are now correctly sized
842 \layout Itemize
843
844 Small graphic items are now properly sized
845 \layout Itemize
846
847 Support for Windows 98 has been included
848 \layout Subsection
849
850 Release 4
851 \layout Itemize
852
853 GUI support has been introduced.
854  This relies on the 
855 \family typewriter 
856 Tk
857 \family default 
858  and 
859 \family typewriter 
860 Tix
861 \family default 
862  packages being available on your computer, which is generally true.
863 \layout Itemize
864
865 The policy to keep 
866 \emph on 
867 TexConv.py
868 \emph default 
869  independent from 
870 \emph on 
871 ConvTex.py
872 \emph default 
873  has been relaxed in so far as 
874 \emph on 
875 TexConv.py
876 \emph default 
877  now calls 
878 \emph on 
879 ConvTex.py
880 \emph default 
881 , which means you only have to run 
882 \emph on 
883 TexConv.py
884 \emph default 
885  to convert a document.
886 \layout Itemize
887
888 All the final zipping and clean-up previously done in Bash or .bat script
889  files is now incorporated into 
890 \emph on 
891 ConvTex.py
892 \emph default 
893 , so those files are no longer needed.
894 \layout Itemize
895
896 The program 
897 \emph on 
898 Config.py
899 \emph default 
900  now enables the configuration files to suit your platform to be generated
901  automatically.
902 \layout Itemize
903
904 Thus no distinction between WindowsXP and Windows98 is any longer necessary.
905 \layout Section
906
907 Programs
908 \layout Standard
909
910 The conversion is performed by two 
911 \emph on 
912 Python
913 \emph default 
914  programs, and you need to have the 
915 \emph on 
916 Python
917 \emph default 
918  system installed.
919  They are both platform-independent.
920 \layout Subsection
921
922 TexConv.py
923 \layout Standard
924
925 This parses the 
926 \emph on 
927 LaTex
928 \emph default 
929  file and stores the result in a pickled dictionary located in your temporay
930  directory.
931  The idea is to parse into a (large!) Python dictionary so that all similar
932  objects are grouped together.
933  Then other dictionaries can be used to convert styles, formats and special
934  characters to suit the target file type.
935  In other words this program makes no assumption about the target file type,
936  and its results can be used to convert to any other file type, given a
937  suitable program and supporting dictionaries to implement that.
938  It contains options to print out its results either by direct calls from
939  the terminal or from a supervising program of some kind.
940  It generates the following files in your temporay directory for 
941 \family typewriter 
942 myfile
943 \family default 
944 :
945 \begin_inset LatexCommand \label{files}
946
947 \end_inset 
948
949
950 \layout List
951 \labelwidthstring MMMMMM
952
953
954 \family typewriter 
955 myfile.ftd
956 \family default 
957  contains the pickled dictionary which is the principal result used in the
958  second stage of conversion
959 \layout List
960 \labelwidthstring 00.00.0000
961
962
963 \family typewriter 
964 myfile.ftm
965 \family default 
966  contains headings for use by a supervisor program (not supplied
967 \begin_inset LatexCommand \ref{c_progs}
968
969 \end_inset 
970
971 ) to display the results
972 \layout List
973 \labelwidthstring 00.00.0000
974
975
976 \family typewriter 
977 myfile.ftr
978 \family default 
979  contains a report of the object types found and incorporated in 
980 \family typewriter 
981 myfile.ftd
982 \family default 
983 , again for use by a supervisor program to inspect the results.
984 \layout Standard
985
986 The latter two files may be inspected directly if desired, but see
987 \begin_inset LatexCommand \ref{normal}
988
989 \end_inset 
990
991  to do that.
992  The first one is in Python pickled form and is not suitable for direct
993  inspection.
994 \layout Subsection
995
996 ConvOffice.py
997 \layout Standard
998
999 This program reads in 
1000 \family typewriter 
1001 myfile.ftd
1002 \family default 
1003  and produces the final 
1004 \emph on 
1005 OpenOffice
1006 \emph default 
1007  file from it.
1008  It requires the following dictionaries and 
1009 \family typewriter 
1010 \noun on 
1011 xml
1012 \family default 
1013 \noun default 
1014  templates as supplied:
1015 \layout List
1016 \labelwidthstring MMMMMMMM
1017
1018 EndOffice converts compound object end tags
1019 \layout List
1020 \labelwidthstring MMMMMMMM
1021
1022 EscOffice converts escape characters
1023 \layout List
1024 \labelwidthstring MMMMMMMM
1025
1026 FontSizeOffice converts font sizes
1027 \layout List
1028 \labelwidthstring MMMMMMMM
1029
1030 FontStyleMathsOffice converts styles for equations
1031 \layout List
1032 \labelwidthstring MMMMMMMM
1033
1034 FontStyleOffice converts text styles
1035 \layout List
1036 \labelwidthstring MMMMMMMM
1037
1038 StartOffice converts compound object start tags
1039 \layout List
1040 \labelwidthstring MMMMMMMM
1041
1042 sizes 
1043 \family typewriter 
1044 charCount, mathsSizes, mathsSymb
1045 \family default 
1046  and 
1047 \family typewriter 
1048 nonAscii
1049 \family default 
1050  contain sizing information
1051 \layout List
1052 \labelwidthstring MMMMMMMM
1053
1054 OfficeXML is a folder containing the template 
1055 \family typewriter 
1056 xml
1057 \family default 
1058  files from which the final document is constructed
1059 \layout Subsection
1060
1061
1062 \begin_inset LatexCommand \label{sub:Config.py}
1063
1064 \end_inset 
1065
1066 Config.py
1067 \layout Standard
1068
1069 Available in Release 4, this script provides a GUI based method of creating
1070  the configuration files 
1071 \family typewriter 
1072 ConvTexPaths
1073 \family default 
1074  and 
1075 \family typewriter 
1076 ConvTexConfig
1077 \family default 
1078 , which are thus not supplied.
1079  You specify the three paths for:
1080 \layout Itemize
1081
1082
1083 \begin_inset LatexCommand \label{tempPath}
1084
1085 \end_inset 
1086
1087 the location for temporary files 
1088 \layout Itemize
1089
1090 the default path for your tex files, which is used by 
1091 \emph on 
1092 TexConv
1093 \emph default 
1094  as the initial folder in its file dialog box
1095 \layout Itemize
1096
1097 the default path for graphics to be included in the document
1098 \layout Standard
1099
1100 For each path a path-selection dialog is presented to navigate to the desired
1101  folder: double-click on the folder and close the widget; a confirmation
1102  button dialogue will then be presented with three buttons:
1103 \layout Enumerate
1104
1105
1106 \color green
1107 YES
1108 \color default
1109  to accept the result
1110 \layout Enumerate
1111
1112
1113 \color red
1114 NO
1115 \color default
1116  to reject it, in which case the path-selection dialog is presented again
1117 \layout Enumerate
1118
1119
1120 \color red
1121 ABORT CONFIGURATION
1122 \color default
1123  which closes the program leaving any previously constructed configuration
1124  files undisturbed i.e.
1125  this script may be re-run at any time to change the defaults.
1126 \layout Standard
1127
1128 The configuration files are constructed from this information.
1129  The platform is deduced from the type of file path delimiter character
1130  encountered; if there is any doubt a radio-button dialog will be presented
1131  to select the platform.
1132  After configuration, the only significance of the platorm type is the type
1133  of file path delimiter used by the programs.
1134 \layout Subsection
1135
1136 Errors
1137 \layout Standard
1138
1139 If an error occurs in either of the Python programs, the file 
1140 \family typewriter 
1141 TexError
1142 \family default 
1143  will exist in your temporay directory and any files constructed as part
1144  of the process up to the error will remain in that folder.
1145  A brief note of the error may be reported on the terminal, depending on
1146  where the error occurred, which will also be found in a file named 
1147 \family typewriter 
1148 null
1149 \family default 
1150  in the temporary folder.
1151  An even briefer one will be found there in the file 
1152 \family typewriter 
1153 TexError
1154 \family default 
1155  (which is really created for the benefit of the script and/or supervisor
1156  programs to determine unambiguously that an error has occurred; it is deleted
1157  if all goes well).
1158  If the error was a file error the offending file name will be reported.
1159 \layout Section
1160
1161 Contact
1162 \layout Standard
1163
1164 The author can be contacted at nctsm@safe-mail.net
1165 \layout Standard
1166
1167 If you would like to be informed of upgrades and bug fixes, please tell
1168  me.
1169 \layout Section
1170
1171 Styles
1172 \begin_inset LatexCommand \label{sec:Styles}
1173
1174 \end_inset 
1175
1176
1177 \layout Subsection
1178
1179 Document Layout
1180 \layout Standard
1181
1182 The following Layout/Document options have been implemented:
1183 \layout List
1184 \labelwidthstring 00.00.0000
1185
1186 Page\SpecialChar ~
1187 size all page size options are available; default is treated as A4
1188 \layout List
1189 \labelwidthstring 00.00.0000
1190
1191 Orientation 
1192 \family typewriter 
1193 landscape
1194 \family default 
1195 \emph on 
1196  
1197 \emph default 
1198 may be selected instead of 
1199 \family typewriter 
1200 portrait
1201 \layout List
1202 \labelwidthstring 00.00.0000
1203
1204 Margins 
1205 \layout Itemize
1206
1207
1208 \family typewriter 
1209 top
1210 \family default 
1211
1212 \family typewriter 
1213 bottom
1214 \family default 
1215
1216 \family typewriter 
1217 inner
1218 \family default 
1219  and 
1220 \family typewriter 
1221 outer
1222 \family default 
1223  margins may be set
1224 \layout Itemize
1225
1226 the only units recognised are 
1227 \family typewriter 
1228 mm
1229 \family default 
1230 ,
1231 \family typewriter 
1232  cm
1233 \family default 
1234  or
1235 \family typewriter 
1236  in
1237 \family default 
1238 ches; any other setting will default to 
1239 \family typewriter 
1240 cm
1241 \layout Itemize
1242
1243 if the inner margin differs from the outer and two-sided paper has been
1244  selected then pages will be mirrored correctly
1245 \layout List
1246 \labelwidthstring 00.00.0000
1247
1248 Font\SpecialChar ~
1249 size all are recognised; the default is assumed to be 
1250 \family typewriter 
1251 10pt
1252 \layout List
1253 \labelwidthstring 00.00.0000
1254
1255 font the default font is 
1256 \noun on 
1257 Times New Roman
1258 \newline 
1259 times, palatino, helvetica, avant
1260 \noun default 
1261  [garde gothic], 
1262 \noun on 
1263 newcent
1264 \noun default 
1265  [New Century Schoolbook] and 
1266 \noun on 
1267 bookman
1268 \noun default 
1269  are all recognised; 
1270 \noun on 
1271 ae
1272 \noun default 
1273  and 
1274 \noun on 
1275 pslatex
1276 \noun default 
1277  are not and default to 
1278 \noun on 
1279 Times New Roman
1280 \noun default 
1281
1282 \newline 
1283 we have gained a font in 
1284 \emph on 
1285 OpenOffice
1286 \emph default 
1287  by assuming the default is 
1288 \noun on 
1289 Times New Roman
1290 \layout List
1291 \labelwidthstring 00.00.0000
1292
1293 Line\SpecialChar ~
1294 spacing all are recognised, default is single-spacing; custom settings
1295  are assumed to be specified by integers
1296 \layout List
1297 \labelwidthstring 00.00.0000
1298
1299 Quote\SpecialChar ~
1300 style implemented
1301 \layout Standard
1302
1303 Changes to other settings will not be recognised and the defaults are assumed:-
1304 \layout Itemize
1305
1306 Layout
1307 \family sans 
1308 \SpecialChar \menuseparator
1309 Page style
1310 \layout Itemize
1311
1312 Layout
1313 \family sans 
1314 \SpecialChar \menuseparator
1315 Separation
1316 \layout Itemize
1317
1318 Paper
1319 \family sans 
1320 \SpecialChar \menuseparator
1321 Default
1322 \layout Itemize
1323
1324 Margins
1325 \family sans 
1326 \SpecialChar \menuseparator
1327 Head sep
1328 \layout Itemize
1329
1330 Margins
1331 \family sans 
1332 \SpecialChar \menuseparator
1333 Head height
1334 \layout Itemize
1335
1336 Margins
1337 \family sans 
1338 \SpecialChar \menuseparator
1339 Foot skip
1340 \layout Itemize
1341
1342 Language
1343 \family sans 
1344 \SpecialChar \menuseparator
1345 Language
1346 \layout Itemize
1347
1348 Language
1349 \family sans 
1350 \SpecialChar \menuseparator
1351 Encoding
1352 \layout Itemize
1353
1354 Bullets
1355 \layout Itemize
1356
1357 Numbering
1358 \layout Itemize
1359
1360 Bibliography
1361 \layout Subsection
1362
1363 Paragraph Layout
1364 \layout Itemize
1365
1366 The Label Width may be set
1367 \layout Itemize
1368
1369
1370 \begin_inset LatexCommand \label{spacing}
1371
1372 \end_inset 
1373
1374 Spacing using the 
1375 \family typewriter 
1376 custom
1377 \family default 
1378  option only, which may be specified in 
1379 \family typewriter 
1380 mm, cm, in
1381 \family default 
1382  and 
1383 \family typewriter 
1384 cc
1385 \family default 
1386  only.
1387  The minimum spacing corresponds to 2.1mm
1388 \layout Itemize
1389
1390 Otherwise the defaults are assumed.
1391 \layout Subsection
1392
1393 Character Layout
1394 \layout Standard
1395
1396 The following options are implemented in Layout/Character:
1397 \layout List
1398 \labelwidthstring 00.00.0000
1399
1400 Family all
1401 \layout List
1402 \labelwidthstring 00.00.0000
1403
1404 Series all
1405 \layout List
1406 \labelwidthstring 00.00.0000
1407
1408 Shape all, but 
1409 \family typewriter 
1410 slanted
1411 \family default 
1412  is rendered as 
1413 \family typewriter 
1414 italic
1415 \layout List
1416 \labelwidthstring 00.00.0000
1417
1418 Colour black assumed
1419 \layout List
1420 \labelwidthstring 00.00.0000
1421
1422 Language English assumed
1423 \layout List
1424 \labelwidthstring 00.00.0000
1425
1426 Toggling defaults assumed
1427 \layout Section
1428
1429 More on Dictionaries
1430 \layout Standard
1431
1432 The dictionaries have stylised names as it was initially envisaged that
1433  other programs apart from 
1434 \family typewriter 
1435 ConvOffice.py
1436 \family default 
1437  could be written to convert to other formats.
1438  During early testing a plain text version called 
1439 \family typewriter 
1440 ConvVanilla.py
1441 \family default 
1442  was used before 
1443 \family typewriter 
1444 ConvOffice.py
1445 \family default 
1446  was written.
1447  It required different dictionaries from 
1448 \family typewriter 
1449 ConvOffice.py
1450 \family default 
1451 , and template dictionaries were used as the starting point for constructing
1452  sets of customised dictionaries.
1453  Because of this open approach 
1454 \family typewriter 
1455 ConvOffice.py
1456 \family default 
1457  reads in some dictionaries based on its own name, as it too was derived
1458  from a template program.
1459  However it is unlikely that other conversion programs will be needed or
1460  desired, so none of this stuff has been supplied, although the first Python
1461  program remains in generalised form.
1462 \layout Section
1463
1464 Equations
1465 \layout Standard
1466
1467 Equation objects have to be corrected for 
1468 \begin_inset Quotes eld
1469 \end_inset 
1470
1471 faulty
1472 \begin_inset Quotes erd
1473 \end_inset 
1474
1475  syntax, as otherwise 
1476 \emph on 
1477 OpenOffice
1478 \emph default 
1479  shows errors.
1480  These may not be errors in fact as it may genuinely be desired to print
1481  
1482 \begin_inset Formula $\sum$
1483 \end_inset 
1484
1485  for example, yet 
1486 \emph on 
1487 OpenOffice
1488 \emph default 
1489  expects an argument after the symbol and prints an error indicator.
1490  To avoid this, {} is inserted after 
1491 \begin_inset Formula $\sum$
1492 \end_inset 
1493
1494  which does not show and satisfies 
1495 \emph on 
1496 OpenOffice
1497 \emph default 
1498 .
1499  There are numerous such potential corrections to be made, and each equation
1500  has to be parsed for them.
1501  The most tricky is to correct for un-matched brackets of any kind, which
1502  can be useful for tensor equations such as 
1503 \begin_inset Formula $x_{(1}=\left\{ \begin{array}{cc}
1504 \alpha_{0} & \alpha_{0}^{s}\end{array}\right\} $
1505 \end_inset 
1506
1507 .
1508  So far unmatched left brackets (of any kind) are corrected (the unmatched
1509  bracket is enclosed in ordinary double quotes which do not show), but the
1510  syntax analyser cannot (yet) correct for unmatched right brackets.
1511  If you need them, enclose them in ordinary double quotes.
1512 \layout Standard
1513
1514 I have noticed a problem when 
1515 \emph on 
1516 Lyx
1517 \emph default 
1518  exports to 
1519 \emph on 
1520 Latex
1521 \emph default 
1522 :- including a reserved text word like 'and' in an equation can cause the
1523  rest of the equation to be set to Roman style rather than just that word;
1524  this causes confusion as 
1525 \family typewriter 
1526
1527 \backslash 
1528 mathrm
1529 \family default 
1530  usually means render in non-italic Roman style until its scope ends, which
1531  in turn for 
1532 \emph on 
1533 StarMath
1534 \emph default 
1535  implies putting an ordinary double quote " at the start and end of the
1536  scope, ruining the equation if the scope is wrong.
1537  I have left this interpretation of 
1538 \family typewriter 
1539
1540 \backslash 
1541 mathrm
1542 \family default 
1543  in place as I'm not sure what else to do, so beware! The same applies to
1544  
1545 \family typewriter 
1546
1547 \backslash 
1548 mathtt
1549 \family default 
1550
1551 \family typewriter 
1552
1553 \backslash 
1554 mathbb
1555 \family default 
1556 ,
1557 \family typewriter 
1558  
1559 \backslash 
1560 mathcal
1561 \family default 
1562  and
1563 \family typewriter 
1564  
1565 \backslash 
1566 mathfrac
1567 \family default 
1568  which in any case cannot be rendered
1569 \begin_inset LatexCommand \ref{mathcal}
1570
1571 \end_inset 
1572
1573 .
1574 \layout Section
1575
1576
1577 \begin_inset LatexCommand \label{confFiles}
1578
1579 \end_inset 
1580
1581 Configuration files
1582 \layout Itemize
1583
1584 The Python programs require one parameter, which is the name of the file
1585  to be converted, without the 
1586 \family typewriter 
1587 .tex
1588 \family default 
1589  extension.
1590  If this is supplied without a path then the default path (c.f.
1591  
1592 \begin_inset LatexCommand \ref{defPath}
1593
1594 \end_inset 
1595
1596 ) is assumed, otherwise the full path supplied will be used instead.
1597  When the 
1598 \family typewriter 
1599 ConvTex
1600 \family default 
1601  script is used this is supplied as its parameter.
1602 \layout Itemize
1603
1604 The programs use the home directory (c.f.
1605  
1606 \begin_inset LatexCommand \ref{homeDir}
1607
1608 \end_inset 
1609
1610 ) to control where to find things.
1611 \layout Itemize
1612
1613 The programs use the paths 
1614 \begin_inset LatexCommand \ref{tempPaths}
1615
1616 \end_inset 
1617
1618  in the 
1619 \emph on 
1620 ConvTexPaths
1621 \emph default 
1622  file to control where temporary files are to be created during the conversion
1623  process.
1624  They must be specified as follows
1625 \begin_deeper 
1626 \layout Itemize
1627
1628 Line 1: the path 
1629 \family typewriter 
1630 p
1631 \family default 
1632  where temporary files are constructed
1633 \layout Itemize
1634
1635 Line 2: 
1636 \family typewriter 
1637 |p|TexError
1638 \family default 
1639 , replacing 
1640 \family typewriter 
1641 |
1642 \family default 
1643  with 
1644 \family typewriter 
1645 /
1646 \family default 
1647  for Linux users, or 
1648 \family typewriter 
1649
1650 \backslash 
1651
1652 \family default 
1653  for Windows users.
1654 \layout Itemize
1655
1656 Line 3: 
1657 \family typewriter 
1658 |p|officeXML
1659 \layout Itemize
1660
1661 Line 4: 
1662 \family typewriter 
1663 |p|pythonTmp
1664 \layout Itemize
1665
1666 Line 5: 
1667 \family typewriter 
1668 zz|ConvLaTex|Dictionaries|
1669 \family default 
1670  where 
1671 \family typewriter 
1672 zz
1673 \family default 
1674  is the document sub-folder in your home directory
1675 \layout Itemize
1676
1677 Line 6: the path separator used by your platform: 
1678 \family typewriter 
1679 /
1680 \family default 
1681  for Linux users, or 
1682 \family typewriter 
1683
1684 \backslash 
1685
1686 \family default 
1687  for Windows users.
1688 \layout Itemize
1689
1690 Line 7: the separator for 
1691 \family typewriter 
1692 xml
1693 \family default 
1694  paths, must be 
1695 \family typewriter 
1696 /
1697 \layout Itemize
1698
1699 Line 8: the separator for 
1700 \family typewriter 
1701 url
1702 \family default 
1703  paths, must be 
1704 \family typewriter 
1705 /
1706 \the_end