requesting tugboat articles

Reinhard Kotucha reinhard.kotucha at gmx.de
Mon Oct 3 01:50:41 CEST 2022


On 2022-10-02 at 21:55:35 +0000, Mike Marchywka wrote:

 > Thanks, at least one of those talks about a JAVA GUI to prepare
 > input :) I'm amazed at what you can do just writing in version of
 > TeX but I like c++ for data structures and familiarity. I guess
 > instead of generating LaTex from c++ I could learn how to do more
 > in TeX programming but then it is tied to TeX . Some of the
 > charting Nicola describes may be done in R although not sure what
 > the issues are. I have written my own svg generators in c++
 > although I could get same result from R but I am just used to c++
 > instead of R.

Hi Mike,
an alternative to C++ is Lua.  Scripting languages are more portable
than C++ because they don't have to be compiled for every platform to
be supported.  And Lua is already supported by TeX Live (luatex and
texlua).

Lua also supports data structures (called tables), see "TablesTutorial"
at

  http://lua-users.org/wiki

If you are already familiar with C++ you should be able to learn Lua
rather quickly.

Parsing CSV in tex is certainly less convenient than in any other
language.

It's also difficult to parse CSV because there is no formal
documentation.  In most cases the field separator is a semicolon
though the name "CSV" implies something different.  If you want to
process arbitrary files you have to determine the field separator
in advance, one way or another.  Even nastier are quoting rules.

There is no formal specification but you might want to read this
instead:

  https://www.ietf.org/rfc/rfc4180.txt

IMO it's worthwhile to consider Lua because Lua scripts are supported
by all TeX distributions.

There is one thing worth to be mentioned: unlike Lua, luatex/texlua
provide a function string.explode() which is quite helpful when
parsing CSV files.  This is described in the LuaTeX manual:

  texdoc luatex

Regards,
  Reinhard

 > ________________________________________
 > From: Karl Berry <karl at freefriends.org>
 > Sent: Sunday, October 2, 2022 5:39 PM
 > To: marchywka at hotmail.com
 > Cc: texhax at tug.org
 > Subject: Re: requesting tugboat articles
 >
 > Hi Mike -
 >
 >     make Tex tables from csv files.
 >
 > The most complete package I know of in this area is Nicola Talbot's
 > datatool. It's for LaTeX. https://ctan.org/pkg/datatool
 >
 > In general, Nicola has created a number of packages that solve
 > nontrivial problems in approximately complete ways, e.g., texlocale,
 > texosquery, bib2gls. https://ctan.org/author/talbot
 >
 > FWIW ... --best, karl.
 >

--
------------------------------------------------------------------
Reinhard Kotucha                            Phone: +49-511-3373112
Marschnerstr. 25
D-30167 Hannover                    mailto:reinhard.kotucha at gmx.de
------------------------------------------------------------------



More information about the texhax mailing list.