[tex-live] TeXLive (Windows) bash script -> exe

Josef Kleber josef.kleber at gmx.de
Tue May 20 12:45:22 CEST 2014

Am 20.05.2014 00:23, schrieb Reinhard Kotucha:
> On 2014-05-19 at 21:22:46 +0200, Josef Kleber wrote:
>
>   > Am 19.05.2014 19:47, schrieb Mojca Miklavec:
>   > >
>   > > (Cynicism aside, you should really learn lua or ask for step-by-step
>   > > help on the mailing list. Particularly with your complexity of the
>   > > script, it should be trivial to port it to lua and preserve all the
>   > > headaches for everyone else.)
>   > >
>   >
>   > construct the URL also on the LaTeX side. So it should be doable
>   > even for me! ;-)
>   >
>   > To download the map with a LaTeX command i would still need
>   >
>   > \immediate\write18{texlua osmimage.lua}
>   >
>   > Right? Or am i missing something?
>
> Well, this doesn't work because texlua doesn't know where in the TEXMF
> tree osmimage.lua is installed.  You have to write:
>
>    \immediate\write18{osmimage}
>
> On Unix osimage is a symlink to osmimage.lua and on Windows
> osmimage.exe passes its arguments to runscript.tlu, which determines
> the location of your script and finally executes it.  runscript.tlu is
> executed by texlua, which in turn has kpathsea built-in.

Thanks, create new synopses!

> Another interesting solution would be to put the Lua code directly
> into the LaTeX file.  Since LuaTeX is based on pdfTeX, the only
> restriction is that XeTeX users are excluded.  But a self-contained
> package has some advantages too.  In order to see how easy it is,
> look at my minimal example:

True, but i would like to support as many engines than possible.

>   > construct the URL also on the LaTeX side. So it should be doable
>   > even for me! ;-)
>
> BTW, if you assemble the URL on the LaTeX side, how do you read
> command-line arguments?  It's probably easier to do this in Lua.

It would be something like:

\wgetmap[file=mymap, ...]{Marienplatz 15, 80331 München, Deutschland}
\includegraphics{mymap}

with sensible defaults for the options. So, there's no need to read
command line arguments, but contruct the URL and send it to a lus script

> Here are some useful links:
>
>    The definite guide is the book "Programming in Lua".  Only the first
>    edition (Lua 5.0) is available online.  Most of the content is still
>    valid.  If in doubt, consult the Reference Manual.
>
>      http://www.lua.org/pil/contents.html

I know it. I've read the first few chapters. That's my very basic
knowledge of Lua! ;-)

>    The Lua 5.2 Reference Manual
>
>      http://www.lua.org/manual/5.2/
>
>    The Tutorial Wiki
>
>      http://lua-users.org/wiki/TutorialDirectory
>
> After all, the book "Programming in Lua", 3rd edition, ISBN 859037985X,
> is definitely worth it's money.
>
> In order to see which modules and extensions are avalable in texlua and
> luatex, run
>
>    texdoc luatex
>
> There are a few useful extensions.

Thanks, i will have a look.

Josef