On Sun, 29 Aug 2004, Georg Baum wrote:

> > 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?

I don't know about math mode nor a math box. I never (knowingly) enabled
it.

> >  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.
>

Instead of a minimal example. The entire files that shows all the issues
indicated in my original posting are here:

http://pilchuck.reedmedia.net/jeremy/tmp-7c33iuegileu/crontab.1.lyx
(5437 bytes)

http://pilchuck.reedmedia.net/jeremy/tmp-7c33iuegileu/crontab.1.tex
(2847 bytes)

> > 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).

I think a short dash would be more appropriate. I don't want math mode. I
am just trying to convert man pages to lyx (via latex first).

> > 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.

This tex file was created by running html2latex on the output from "groff
-Thtml".

> > 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.

Thank you for the information.

> Since you seem to document a computer program, I would suggest to use the
> docbook backend of lyx and use the appropriate formatting.

In this case, I am making a collection of already-existing manpages to
print in a book format. I want to use lyx for easy organization of table
of contents, chapters, sections, and great indexing.

Docbook does seem like a good idea, but my originals are in nroff mandoc
and man formats. I don't have any plan to regenerate the man pages. By the
way, a useful tool for converting manpages to docbook is doclifter, but I
don't plan on using that for this project.

 Jeremy C. Reed

                         BSD News, BSD tutorials, BSD links
                         http://www.bsdnewsletter.com/

Reply via email to