5

I'm not terrible experienced with latex, an I'm trying to wrap up the \begin{collect*} command with some common arguments used into its own enviroment, but I'm having trouble getting the whole thing to work. The issue only shows inside a custom enviroment. A minimal example that shows this example is:

\documentclass[11pt,english]{article}

\usepackage{xparse}
\usepackage{collect}


\DeclareDocumentEnvironment{dup}{ m }
  {  \begin{collect*}{#1dupcollection}{}{}{}{}
  }
  {
  \end{collect*}
  }

\begin{document}

\begin{dup}{atest}
content...
\end{dup}

\end{document}

The error I'm getting is: File ended while scanning use of \@tempa

I have tried looking for a solution but had no luck finding one. I'm sure someone here can assist.

5

From the package documentation (PDF):

\documentclass[11pt,english]{article}

\usepackage{collect}

\makeatletter
\newenvironment{dup}[1]{%
  \definecollection{#1dupcollection}%
  \@nameuse{collect*}{#1dupcollection}{}{}{}{}%
}{%
  \@nameuse{endcollect*}%
}
\makeatother

\begin{document}

\begin{dup}{atest}
content...
\end{dup}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for?Browse other questions tagged or ask your own question.