Am Sonntag, 29. August 2004 06:16 schrieb Jeremy C. Reed: > I am using tex2lyx from cvs updated yesterday. I am glad to finally be > able to import tex into lyx (after a year of trying). > > It seems like some added spaces are being added. > > For example, the tex file has: > > $-$u user > > But lyx shows it as: > > - u user
Hopefully with the "-" in math mode? Are you sure that there is really a space in lx and not just the usual margin of the math box? > And: > > The \emph{$-$e} > option ... > > Shows: > > The - e option > > And when exporting as ASCII it also has that extra space. This is probably a problem of the ascii export and not tex2lyx. Please send a minimal example .tex file (and the resulting .lyx file) so that we can be sure. > When exporting as DVI or viewing with xdvi it looks fine. > And when exporting as Postscript and viewing with gv it looks fine. > > I zoomed in with xdvi and gv and it appears to be a long dash. Because it is in math mode, it is a minus sign. If you want a long dash, type --- in text mode (or -- for a not so long dash, I don't know the correct english words for these). > Maybe the ASCII output and the lyx display should not show a space between > dash and next character. > > A similar problem is lyx is showing indented text but is fine with DVI and > Postscript output. For example the tex file has two blank lines: > > \subsection*{NAME} > > > crontab - maintain crontab files for individual users (V3) > > > And so lyx shows wrongly like: > > NAME > crontab .... Again, please send an example. > Tex file has (two lines here): > > The \emph{crontab}$ > command conforms to IEEE Std1003.2$-$1992 (``POSIX''). This new command syntax differs from previous versions of Vixie Cron, as well as from the classic SVR3 syntax. > > ASCII output has: > > The crontab command conforms to IEEE Std1003.2 - 1992 ("POSIX" > ). This new command syntax differs from previous > > Problem above is the newline before the right close parenthesis. Again, an example file is needed to find the problem. > Tex file has: > > /var/cron/allow\\ <-- trailing space here > /var/cron/deny\\ <-- trailing space here > /var/cron/maxtabsize > > And ASCII output has: > > /var/cron/allow > /var/cron/deny > /var/cron/maxtabsize > > The problem above is that the last two lines should not be indented. (It > is fine in lyx interface and with dvi and postscript). The problem here is that tex2lyx is deliberately not 100% whitespace correct. See src/tex2lyx/text.C, function check_space() and the mailing list archive for reasons. BTW, the additional space at the end of the line is not the problem here, the additional space would only go away if you had /var/cron/allow\\/var/cron/deny\\/var/cron/maxtabsize in the .tex file. > Also is there a tool for cleaning up latex (like tidy is for html)? I don't know of any. The reason is probably that it is impossible to parse .tex files 100% correctly with other programs than tex itself. But as far as tex2lyx is concerned, no cleaning is necessary. The only exception is whitespace, so if you had a tool that removed every redundant whitespace it might be helpful, but the resulting .tex would be unreadable for humans. Since you seem to document a computer program, I would suggest to use the docbook backend of lyx and use the appropriate formatting. Georg