# [texworks] help

Paul A Norman paul.a.norman at gmail.com
Mon Mar 23 03:02:15 CET 2020

Thanks Duncan,

An update for scripting is in the works :-)
A tremendous amount is unchanged and stable from those times,
a real credit to the C++ developer team.

Here is the direct online web link for what you were recommending...
http://twscript.paulanorman.info/docs/html/StandardAutomatiucHookScripts.html

[image: image.png]

Kind regards,
Paul

On Mon, 23 Mar 2020 at 05:15, Duncan Murdoch <murdoch.duncan at gmail.com>
wrote:

> On 22/03/2020 4:03 a.m., Ovi Chitayat wrote:
> > Hi,
> > I just figured out that
> > \usepackage[miktex]{gnuplottex}
> > is required for gnuplot to work under windows/miktex while running the
> > same job under MacOS
> > requires
> > \usepackage{gnuplottex}
> > Is there a way to accomplish a conditional loading of packages based on
> > the platform?
> > Or an 'optional option' passed to the package loader somehow?
> > Ovi
> >
>
> Your question looks like a LaTeX question rather than a TeXworks
> question, but in fact I think it is not.  As far as I know by the time
> LaTeX is involved it is hard to know which system it is working in:  I
> can't see that MikTeX defines special macros, for example.
>
> The decision you want to make is more easily done in a preprocessor
> step.  If you are directly typing LaTeX code into TeXworks, then the
> simplest preprocessing is probably via a TeXworks hook script.
>
> Unfortunately, I can't find recent documentation on hook scripts.  The
> best I can find is here:
> https://twscript.paulanorman.com/docs/index.html, and that was last
> updated in 2012, so may not be valid any more.  Those scripts are
> written in Javascript.
>
> An alternative to working with TeXworks scripts would be to change the
> Typeset script to hook in some preprocessing.  For example, my
> TeXworks/configuration/tools.ini has this for pdfLatex:
>
> [002]
> name=pdfLaTeX
> program=pdflatex
> arguments=\$synctexoption, \$fullname
> showPdf=true
>
> Change that program entry to your own favourite shell script that
> preprocesses then runs pdflatex and you should be good.  The
> preprocessing would figure out whether pdflatex is coming from MikTeX
> and patch the \$fullname file as appropriately.
>
> Hopefully someone else will offer a simpler answer!
>
> Duncan Murdoch
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/texworks/attachments/20200323/34c48721/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 205920 bytes
Desc: not available
URL: <https://tug.org/pipermail/texworks/attachments/20200323/34c48721/attachment-0001.png>