4

Similar to Colophon in LuaTex I would like to get the information of the TeX Live-version, the compiler I used (LuaLaTeX) and its version into a colophon. Additionally the fonts used in the file and e.g. the version of biblatex.

This is not for debugging issues but for showing the information in the pdf.

3

1 Answer 1

5

The LuaTeX version is available through the internal variables \luatexversion and \luatexrevision. These are also accessible on the Lua level. Both major and minor version are encoded in \luatexversion, the major version being the result of \luatexversion/100 and the minor version mod(\luatexversion,100).

The TeXlive version is in the LuaTeX banner, so you can just extract it with regex.

This is LuaTeX, Version 0.95.0 (TeX Live 2016)

Because it is the only thing in parentheses we match everything inside. For the Biber version we need to call biber -v and read it's output. Here we match everything after :. However, we need shell escape for that.

\documentclass{article}
\usepackage{luacode}
\begin{document}
\begin{luacode*}
  tex.sprint("Lua\\TeX{} version "
             .. math.floor(tex.luatexversion / 100) .. "."
             .. math.floor(tex.luatexversion % 100) .. "."
             .. math.floor(tex.luatexrevision))

  local tlversion = string.match(tex.luatexbanner, "%((.*)%)")
  tex.sprint(tlversion)

  local fh = io.popen("biber -v")
  local biberversion = string.match(fh:read(), ":(.*)$")
  tex.sprint(biberversion)
\end{luacode*}
\end{document}

enter image description here

2
  • And how to get This is LuaTeX, Version 0.95.0 ? May 5, 2017 at 20:44
  • @LukasCB See updated answer. May 6, 2017 at 8:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .