4
\documentclass[a4paper, titlepage, twocolumn]{article}

\usepackage{expl3}

\ExplSyntaxOn

\seq_new:N \myStack

\begin{document}
    \begin{enumerate}
        \item\seq_put_right:Nn \myStack {1}
    \end{enumerate}

    \seq_put_right:Nn \myStack {1}  

    \seq_count:N \myStack
\end{document}

This code outputs:

  1.
1

which leads me to believe that the \seq_put_right command is not being executed when placed inside the \item. However, it works outside the enumerate.

How can I make this command execute and add the value to the sequence/stack?

1 Answer 1

6

It does execute, but makes local assignments that are discarded at \end{enumerate}, you see the same with a simple {} group, it is not connected to \item.

\documentclass[a4paper, titlepage, twocolumn]{article}

\usepackage{expl3}

\ExplSyntaxOn

\seq_new:N \myStack

\begin{document}
{\seq_put_right:Nn \myStack {1}}


    \seq_put_right:Nn \myStack {1}  

    \seq_count:N \myStack
\end{document}

You can use \seq_gput_right:Nn to make global assignments.

1
  • 1
    that often helps :-) though not always Commented Apr 20, 2015 at 8:47

You must log in to answer this question.

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