All Questions
Tagged with grouping environments
26
questions
2
votes
1
answer
64
views
Why does loading `newenviron` cause compilation to fail?
To avoid unnecessary effort, please note that I'm asking specifically about the error's cause, as opposed to how to avoid it. Furthermore, I'm aware that \NewDocumentEnvironment now offers the b ...
13
votes
2
answers
1k
views
Is this the right way to understand \let \def \edef \gdef \xdef \newcommand \renewcommand \providecommand?
I've already looked at at least ten different q&as explaining the differences of a subset of the commands listed above. While experimenting with them and trying to understand the subtle ...
2
votes
1
answer
164
views
Construct new environment with \bgroup...\egroup
The following code is just for experiment It would result in a framed box(seem like \fbox{\parbox{2in}{...}}). But it fails. What's wrong with my code?
Yet framed box in this example is not my root ...
1
vote
0
answers
25
views
Creating matrix newenvironment with arraystretch [duplicate]
I want to create a new matrix environment with different spacing for a matrix instead of manually typing arraystretch locally for each matrix. I am new to more advanced LaTeX coding, and have not ...
0
votes
2
answers
194
views
LaTex macro not properly executed in tabular environment
I want to use a macro to set the separators (&,\\) in a tabular environment. The macro should thereby act as a Boolean switch with three states. Unfortunately I keep getting a result like this:
...
3
votes
3
answers
568
views
How to define an environment that defines a macro, maybe a brace-parenthesis issue?
I know how to define a macro as follows
\newcommand{\mycommand}{ here my macro commands }
But I would like to create an environment that defines macro, as follows
\begin{definemycommand}{\...
2
votes
2
answers
281
views
Locally redefine cleveref’s reference name for chapters
Consider the following MWE:
\documentclass{scrbook}
\usepackage{appendix}
\usepackage{cleveref}
\usepackage{etoolbox}
\BeforeBeginEnvironment{appendices}{%
\crefname{chapter}{appendix}{...
6
votes
3
answers
1k
views
How to perform a \global\renewenvironment
I need to execute a \renewenvironment within a group. Using \global\renewenvironment is not sufficient.
What changes do I need to make to the \DisableMyEnvironment macro in the MWE below so as to ...
4
votes
1
answer
161
views
Environment that treats words or groups as command arguments
How can I define an environment that would treat each word or group as an argument of a function?
I am writing a handbook that contains calculator entries, which I would like to typeset as buttons. ...
2
votes
2
answers
144
views
Environment that conditionally shows it's contents is not working. Missing \endgroup
I tried to make an environment that shows its contents if @showtrue and doesn't otherwise. When I try to run the MWE below, I get an error message:
! Extra }, or forgotten \endgroup.
\...
3
votes
1
answer
465
views
Open group in environment beginning and close it at its end
I'm trying to call a program from within LaTeX via the \input command. The call itself works just fine however I want to pack everything inside an environment in order to make the call more readable. ...
6
votes
1
answer
141
views
Should additional groups be avoided?
Should additional groups like \begin{algorithm} ... \end{algorithm} be generally avoided and the use of \algorithm...\endalgorithm be preferred?
By additional is meant, that there is at least one ...
5
votes
4
answers
774
views
Equivalent for \bgroup \egroup in LaTeX3
I am trying to apply a expl3 function to the contents of an environment. In LaTeX2e this can be achieved by using \bgroup and \egroup.
In expl3, something does not work.
I would expect the following ...
9
votes
5
answers
522
views
Environment as local namespaces
I wish for something quite simple to describe but maybe impossible to have.
I would like to give multiple definitions to a macro (\U in my case) such that depending on the environment it can have ...
1
vote
0
answers
28
views
Why do I get an "extra }" error when using a default argument in a theorem name? [duplicate]
Consider the following latex code:
\documentclass{article}
\usepackage{amssymb}
\usepackage{amsthm}
\newtheorem{thm}{Theorem}
\newcommand{\Zn}[1][n]{\mathbb{Z}_{#1}}
\begin{document}
$\Zn[p]$
\...