1

If an "end-user" is preparing documents with LaTeX and using the current version of LaTeX(as of now, LaTeX2e <2021-06-01> patch level 1), which automatically loads L3 programming layer <2021-10-12>, and if the user is writing and applying macros that use \NewDocumentCommand, etc., is there any reason to either:

  1. include \usepackage{xparse}, or
  2. use \ExplSyntaxOn ?

As, for example, in the following source derived from https://tex.stackexchange.com/a/393188/13492:

\documentclass{article}

\NewDocumentCommand\test{o}{\IfNoValueTF{#1}{test}{#1}} \begin{document} \test[hello], and \test[hello]{\ world!} \end{document}

I am aware, of course, of discussions such as those in What do ExplSyntaxOn and ExplSyntaxOff do?, but I am asking a practical question from a document writer's point of view, not from the point of view of a package author or LaTeX developer!

murray
  • 7,944
  • 3
    xparse was included in the kernel release of 2020-10-01, I think. And you only need to enable \ExplSyntaxOn (and then Off) in your document if you are including expl3 code in it (meaning, directly, not inside a package). – gusbrs Oct 15 '21 at 01:22
  • 4
    In one sense, you need \ExplSyntaxOn if you're trying to write some macro that needs expl syntax. So I think the answer ends up being, "it depends on what you're wanting to do in your document". – Teepeemm Oct 15 '21 at 01:47
  • No. 2. Only if the document author needs to write expl3 code. The \ExplSyntaxOn, \ExplSyntaxOff switches handle changing the category codes of _, spaces, etc, which otherwise would be treated as math mode commands, glue, etc.
  • – Cicada Oct 15 '21 at 08:18