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:
- include
\usepackage{xparse}, or - 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!
xparsewas included in the kernel release of 2020-10-01, I think. And you only need to enable\ExplSyntaxOn(and thenOff) in your document if you are includingexpl3code in it (meaning, directly, not inside a package). – gusbrs Oct 15 '21 at 01:22\ExplSyntaxOnif 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\ExplSyntaxOn,\ExplSyntaxOffswitches handle changing the category codes of_, spaces, etc, which otherwise would be treated as math mode commands, glue, etc.