Andre Poenitz wrote:

> On Fri, Sep 14, 2001 at 11:32:30AM +0200, Jean-Marc Lasgouttes wrote:
> > 1/ it is useless, since it is not will not be possible for an xdvi
> > running on an exported latex file to do anything
>
> There are people using LaTeX with regular editors...
>
> > 2/ it is tasteless to have such useless code in our files
>
> That's a point.
>
> > Since this macro package overloads some internal \LaTeX\ commands, it
> > is not as robust as one might wish, and may interact badly with other
> > packages. Furthermore, the spacing might be altered by using the
> > package; so please disable the package (with the \texttt{inactive}
> > option) before you prepare the final version of your document.
>
> Ok.
>
> > A much more robust method of inserting source specials is to use \TeX\
> > (the program) instead of a macro solution. Some \TeX\ implementations,
> > such as Mik\TeX\footnote{from v.1.20 upwards; the command line option
> > is `\file{-src}'; see the Mik\TeX\ manual for more information.}, have
> > a command line option to activate source specials.
>
> Does teTeX has something like that?
>
> Andre'

Sorry for not answering for a couple of days... I would recomment a slightly
different scheme of implementation:

1) I agree that src-specials make the TeX-file and the DVI-file longer, and
should be avoided, when the DVI file is not produced explicitely with kdvi in
mind. Thus, I suggest to insert the src-specials only when the user uses a
function like "preview dvi", when the dvi-viewer is set to "kdvi", and not
when the user "Exports to LaTeX", or previews the DVI-file with xdvi.

2) I know from bad experience that the srclatex macros sometimes cause
trouble. Likewise, we cannot expect the user to have a TeTeX installation
that supports src-specials natively (currently, only exerimental version of
TeTeX can do that). On the other hand, it seems to me that automatically
inserted references to the TeX-file and to line numbers in the TeX-file are
not desirable anyway ... assuing that we want to implement a functionality
like "Clicking into the DVI-file makes the Lyx-editor jump to the proper
line", we should rather insert src-specials which point to the Lyx-file and
to the unique paragraph identifier in the current Lyx session. I could
implement a functionality like the following: whenever the user clicks into
the DVI-file, a source-special exists, and it is of the form
"src:<number><filename.lyx>, assume that Lyx is running, that KDVI was
started from Lyx and pipe a certain string into ~/.lyxpipe.in. If Lyx is not
running, or if the file is not already loaded, complain and tell the user
that "Inverse search with Lyx is only possible if KDVI has been started from
Lyx with the command 'Preview in KDVI'".

Thus, the only thing to modify in Lyx would be the following:

2.1) Add an option "Preview in KDVI"
2.2) When a TeX-file is generated, which is to be LaTeXed immediately and
shown in KDVI, add commands like "\special{src:<number><filename.lyx>}" to
the beginning of each paragraph.
2.3) Tell me how to interpret these numbers and what string to pipe into
~/.lyxpipe.in

How do you like this?

Stefan.

Reply via email to