0

For example, I define two commands. \mytesta with optional argument, \mytestb without optional argument. Now using \cs_meaning:N to show the command definition. The result is like this:

enter image description here

\documentclass{article}
\newcommand{\mytesta}[2][]{#2\quad#1}
\newcommand{\mytestb}[2]{#1\quad#2}
\setlength{\parindent}{0pt}
\ExplSyntaxOn
\cs_set_eq:NN \checkmeaning \cs_meaning:N
\ExplSyntaxOff

\begin{document} \Large \section{Testing} \par\mytesta[default]{argument} \par\mytestb{argument}{default}

\vskip 2em \par\verb|\mytesta:| {\par\ttfamily\checkmeaning \mytesta} \par\verb|\mytestb:| {\par\ttfamily\checkmeaning \mytestb}

\vskip 2em \par\verb|Is possible to show:| \par\verb|"[#1]#2->#2\quad #1" in \mytesta?| \end{document}

Tom
  • 7,318
  • 4
  • 21

0 Answers0