2

I'd like to include the TeX engine name and version in a document, Is there markup to capture those?

I tried this

\documentclass{article}
\usepackage{expl3}
\usepackage{hyperref}
\usepackage{listings}
\ExplSyntaxOn
\newcommand* \enginedetails
  {
    \c_sys_engine_exec_str
    \c_space_tl
    \c_sys_engine_version_str
    \c_space_tl
    (\c_sys_engine_format_str)
  }
\ExplSyntaxOff

\begin{document}
\lstset{language=Rexx, extendedchars=true, frame=trbl}

\title{Unicode Case and Width Issues}
\author{Shmuel (Seymour J.) Metz}
\thanks
  {
  This is a working document for the Rexx Language Association (RexxLA).
  It is written in \LaTeX \fmtversion and was rendered \today using \enginedetails{}.
  }

\maketitle

\end{document}

and got

Undefined control sequence. }

with the line number of the closing } on the /thanks.

1
  • In your edit, you do not say what was undefinfed
    – Joseph Wright
    Jun 6 at 18:32

3 Answers 3

6

You could query all of the low-level detail, but as that is already done in expl3:

\documentclass{article}
\ExplSyntaxOn
\newcommand* \enginedetails
  {
    \c_sys_engine_exec_str
    \c_space_tl
    \c_sys_engine_version_str
  }
\ExplSyntaxOff

\begin{document}

\enginedetails{}

\end{document}
1
  • That's missing usepackage. When I add it I get undefined control sequence \enginedetails on line 14. Should I do the equivalent with newdocumentcommand?
    – shmuel
    Jun 7 at 11:59
0

In LuaTeX, we can do this:

\def\luatexengine{\directlua{tex.print(status.luatex_engine)}}
\def\luatexversion{\expandafter\putdot\directlua{tex.print(status.luatex_version)}}
\def\luatexrevision{\directlua{tex.print(status.luatex_revision)}}
\def\putdot#1{#1.}

This is \luatexengine, \luatexversion.\luatexrevision.

\bye
0

I downloaded a more recent expl3 and that resolved the problem. However, I also wanted the command to be robust, so I used \NewDocumentCommand.

\documentclass{article}
\usepackage{xparse}
\ExplSyntaxOn
\NewDocumentCommand\enginedetails{}%
  {%
    {
    \c_sys_engine_exec_str
    \c_space_tl
    \c_sys_engine_version_str
    \c_space_tl
    (\c_sys_engine_format_str)
    }
  }
\ExplSyntaxOff

\begin{document}

\enginedetails

\end{document}

You must log in to answer this question.

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