2
votes
0answers
91 views

Checking if first portion of an environment's content is empty

Motivation: I am working on a very personalized Exercise/Answer package for my colleagues. The exercise, exsheets, etc. packages don't do what I need. To accomplish this, I create an exercises ...
3
votes
1answer
78 views

How to expandafter an environment?

I have the following problem: I want to create a beamer presentation and introduced a new environment using xparse. The environment has one optional argument (+ two mandatory). Now I want to create an ...
4
votes
1answer
72 views

Preventing argument expansion

TikZ is able to define parametrized styles using arguments like #1. If used in \newcommand or \newenvironment, they mix up with the arguments of the command. The effect is so severe that the following ...
6
votes
2answers
131 views

Using an expanded macro for optional environment argument

I'd like to open an environment, passing the content of a macro to the optional arguments. Up to now I tried different approaches using \expandafter, however I could not get the expected behaviour. ...
6
votes
2answers
165 views

Delaying command expansion that appears in \begin handler until \end handler executes

I have a custom environment for handling a code interface declaration that is specified as: \begin{decl}{FOO} \param{in}{bar} the bar input parameter \param{out}{baz} the baz input parameter ...
10
votes
5answers
461 views

How to create a “delay expansion” environment?

I don't want to use the following \begingroup \edef\next{\endgroup \noexpand\const{Xp}{\X(tp)} \noexpand\const{Yp}{\Y(tp)} \noexpand\const{Xf}{\X(tf)} \noexpand\const{Yf}{\Y(tf)} ...
10
votes
1answer
123 views

Environment with delayed expansion

I'm trying to define an environment test that stores its contents unexpanded in a macro \testcontents. For example, the code \newcommand{\cmd}{bad} \begin{test} \cmd \end{test} ...
2
votes
1answer
189 views

expandable optional parameter to enumerate environment

The MWE below, by using paralist package, is supposed to allow \begin{enumerate}[...] where ... is flexible in "some way" (inherits from enumerates above). \documentclass[a4paper,10pt]{report} ...
1
vote
0answers
175 views

how to create a fully-expandable environment [closed]

I know DeclareDocumentCommand from the package xparse. I am wondering if there is a version for environment ? I could also imagine a trick based on : declare the environment with ...
3
votes
3answers
407 views

Problem with expansion of \BODY

In the following MWE, the command \testStringNotEmpty tests if the argument is empty. This test is robust in the sense that the argument can contain a command or an environment... The environment ...
8
votes
3answers
459 views

colortbl: new environments and how to apply \expandafter

This is a followup question from one asked by Andrew Howard. After some discussion, it became clear that colortbl has some issues with the names that can be used for a \newcolumntype. The result of ...
5
votes
1answer
612 views

How to expand several arguments in an environment?

I have an environment that I've defined as follows: \newenvironment{regularEnumerateEx}[2][0em] {begin{listSkeleton}[#1]{enumerate}{#2}} {\end{listSkeleton}} The problem is that I need to ...
8
votes
1answer
780 views

Problem with environment expansion and the Tikz external library.

I've created my own environment mytikz, which basically looks like this (full MWE): \documentclass[a4paper]{article} \usepackage{tikz} \usetikzlibrary{external} \newenvironment{mytikz}{%begin code ...
4
votes
2answers
412 views

Strange expansion of a macro inside an environment

I'm, I should confess, a total newbie. I'm trying to generate invoices with LaTeX, so I'm using the fp package. But the strange thing is that calculations occur many times when they should only ...