Re: LyX and Cygwin

2014-05-03 Thread Enrico Forestieri
On Sat, May 03, 2014 at 10:42:12AM -0400, Bert Lloyd wrote:
> 
> On Fri, May 2, 2014 at 10:40 PM, Enrico Forestieri  wrote:
> > Bert Lloyd writes:
> >>
> >> 1. Add my current Windows installation of LyX and MikTeX to my Cygwin
> >> PATH variable, so cygwin can find lyx.exe, etc.
> >
> > This works provided that you take into account that a native version
> > of LyX cannot use neither scripts nor commands that are symlinks.
> > If you need one of such commands you have to write a wrapper batch
> > file. Often, they can be one liners of the kind
> >
> > @bash -c 'script_or_symlink_name %*'
> >
> 
> Do you mean
> 
> "a native version of LyX (a) cannot use scripts and (b) cannot use
> commands that are symlinks"

Yes, scripts and symlinks cannot be directly executed by a native program.

> I'm just doing very simple things in these script: lyx -e to export to
> tex, ultra-simple sed commands to change a couple of lines in the
> tex-file (e.g. notes=show to notes=hide in beamer), then pdflatex to
> compile pdfs.
> 
> My belief was that these were simple enough to be consistent between
> native LyX and Cygwin LyX (indeed, only the first is a lyx command).
> Is this belief reasonable?

Yes, for these simple things both versions are suitable. However, I
think that the official native LyX is compiled as a GUI application.
If so, you will not get any output on the terminal and thus will not
see any error message. Also, a GUI application launched from a terminal
(or script) generally returns immediately and this may be a problem.
Your calling script should be prepared for this. For example, the
command "lyx -e pdf document.lyx" may return before document.pdf is
produced. Thus, you have to check that document.pdf actually is created
before continuing with other commands. But you are not notified if an
error occurs and your script may wait forever for the result...
Well, native GUI commands are not comfortable for scripting.

-- 
Enrico


PDF preview under Widows 8

2014-05-03 Thread UD-Kap
I am using Windows 8.1 (NOT my fault!), and pdf previewing does not 
work-- I have tried Adobe reader, Sumatra and Foxit as pdfLatex 
readers.   Can someone help?

Thanks,

--
Ehud Kaplan,



Re: LyX and Cygwin

2014-05-03 Thread Bert Lloyd
Dear Enrico,

Thank you for your thoughtful reply. I have two clarifying questions,
interspersed below.

Best,
BL


On Fri, May 2, 2014 at 10:40 PM, Enrico Forestieri  wrote:
> Bert Lloyd writes:
>>
>> Dear LyX-users,
>>
>> I am writing some scripts to create PDFs from a number of LyX files. I
>> use Windows, but to maximize cross-platform portability, I'm writing
>> the scripts for Cygwin so that they can run on unix and MacOS. I would
>> like to know whether one of the following three options is preferable:
>>
>> 1. Add my current Windows installation of LyX and MikTeX to my Cygwin
>> PATH variable, so cygwin can find lyx.exe, etc.
>
> This works provided that you take into account that a native version
> of LyX cannot use neither scripts nor commands that are symlinks.
> If you need one of such commands you have to write a wrapper batch
> file. Often, they can be one liners of the kind
>
> @bash -c 'script_or_symlink_name %*'
>

Do you mean

"a native version of LyX (a) cannot use scripts and (b) cannot use
commands that are symlinks"

or

"a native version of LyX (a) cannot use scripts that are (contain?)
symlinks (but could use scripts that do not contain symlinks) and (b)
cannot use commands that are symlinks"


>> 2. In Cygwin, install the most recent version of LyX (and, presumably,
>> texlive or some other latex engine) and run the cygwin scripts using
>> these.
>
> While there can be some issues using a Cygwin TeX engine with a native
> LyX version (but it can be done), a Cygwin version of LyX can use
> without problems a native TeX engine. So, if you install LyX/Cygwin
> and already have, say MikTeX, you don't need installing texlive in Cygwin.
>
>> 3. Download the tar.gz Cygwin binary directly from
>> http://www.lyx.org/Download and [install? compile?] it. This is
>> currently a bit beyond my ability, although I could learn.
>
> That tar.gz contains a Cygwin package to be installed through the
> setup.exe installation tool. Simply untar it (using the Cygwin tar
> version, not a native one) and follow the instructions in the README
> file. This version does not use an X server and is visually identical
> to the native version.
>
>> Any other general tips for Cygwin and LyX are of course appreciated.
>
> If you already use Cygwin, then install the Cygwin version of LyX.
> If you only sporadically need Cygwin, then install the native version
> of LyX and use wrapper batch files to call the commands you need.
> If you need interoperability with unix and MacOS, then definitely
> install the Cygwin version of LyX.
>

I'm just doing very simple things in these script: lyx -e to export to
tex, ultra-simple sed commands to change a couple of lines in the
tex-file (e.g. notes=show to notes=hide in beamer), then pdflatex to
compile pdfs.

My belief was that these were simple enough to be consistent between
native LyX and Cygwin LyX (indeed, only the first is a lyx command).
Is this belief reasonable?