{grouping} is about the grouping mechanism in TeX, and about local and global assignments.

learn more… | top users | synonyms (2)

1
vote
0answers
52 views

tcolorbox vs KOMAoptions: TeX capacity exceed

I tried to put a box around a definition, but got an error. The problem is, I am using a huge template, so I do not really understand most of the settings. If I add this to my file: ...
3
votes
2answers
44 views

Adding \comment or \begin{comment} to \AtBeginDocument?

For Partial compilation commands/environment?, I would like to add \begin{comment} or \comment at the start of the document (so I could turn it off elsewhere in the code). So, even if in the larger ...
2
votes
1answer
50 views

biblatex: how to get rid of abbreviate global option for a local \fullcite citation?

In the following MWE, I'd like the \fullcite citation (but not the bibliography) to be displayed as if abbreviate=false would be passed to biblatex. Is it possible to get rid of the abbreviate global ...
2
votes
1answer
36 views

Manually resize a grouping macro

I know there's a braket package that will probably do all this for me but I've defined my own macro for matrix elements in Dirac notation: \makeatletter \def\me{\@ifstar\@me\@@me} ...
3
votes
2answers
93 views

Automatically clean (numerous) customization macros gathered in an auxiliary file

I have to gather, in a single source file, source files from several authors, each of them with its own (many) \newcommand, \newtheorem, etc. I'd like to limit the scope of each of these ...
7
votes
2answers
91 views

Custom, consecutively numbered group

I'm sure I'm not the first own to ask this question. Sadly, I wasn't able to find an answer just using the search function (probabely I'm using the wrong vocabulary). The story: I want to write a ...
6
votes
1answer
57 views

Grouping of digits with siunitx different when using alignment character (&) or not

Consider the following example: \documentclass{article} \usepackage{mathtools} \usepackage{siunitx} \begin{document} \begin{align*} \sisetup{group-minimum-digits = 6} l &= ...
8
votes
1answer
177 views

Wrapping text with curly braces

This is probably a duplicate, but since Google doesn't allow me to search on the curly braces { or } I cannot find the information. The question: why can I just do {Some text}? How do I call this? ...
1
vote
1answer
60 views

Grouping numbers in a table without using S-column

This is bit different than my previous question. I have a huge tables with 7 to 8 digits. I need to make a small space between groups of three digits in the numbers. I have used the package ...
0
votes
1answer
84 views

Automatic three digit grouping

I have huge numbers in tables (some of them are grouped in three digit groups but some are not). I need to make a small space (or comma) between groups of three digits. I have used two packages, ...
5
votes
1answer
58 views

How can I write a command that defines another macro which may optionally be prefixed by \global?

In various contexts I define a macro such as \makeatletter \newcommand\aedosomething{\ae@do@something} \def\ae@do@something#1#2#3{%% %% do something with arguments #2 and #3 \def#1{<result ...
8
votes
3answers
237 views

Arguments possibly delimited by \bgroup and \egroup

I still don't see (and haven't thought about) pros and cons of making available the arguments as \foo{…} or \foo\bgroup …\egroup (or even unbalanced, \bgroup …} and {…\egroup). But I'm curious about ...
8
votes
3answers
350 views

Macro to close all open environments, groups and argument delimiters

Initial Request I am in search for a macro that would close all curly brackets and all open environments. Ideally, I could write something of the following sort: ...
4
votes
1answer
385 views

pgfplots: “group” legend entries?

Actually, I'm working on a study where I've to plot a lot of temperature data etc. Therefore, I use "pgfplots". Everything works pretty well, so that I get the result as shown in the attached picture ...
4
votes
1answer
50 views

How do you define a command to select nested groups?

Assuming a pair structure (2-tuple) is defined using groups {{<tokens1>}{<tokens2>}} is it possible to define a command \first#1{...} (and \last#1{...}) taking the surrounding group as ...
3
votes
2answers
97 views

grouping enumerated list

I am trying to generate a numbered list with a bracket to the right of the list to group the list items into additional categories. I am trying to get something like: I have fiddled around with ...
4
votes
1answer
97 views

Convert a latex command with parameter into a two begin end commands without parameter

I have defined a command \newcommand{\CV}[1]{\parbox[c]{0.2\textwidth}{\begin{flushleft}#1\end{flushleft}}} which I obviously have to call like \CV{My text} However I rather would like to use ...
9
votes
2answers
125 views

Error when using defs inside a macro to write a row in a table

For the following MWE \documentclass{article} \newcommand{\cmd}[5]{% \def\tA{#1}% \def\tB{#2}% \def\tC{#3}% \def\tD{#4}% \def\tE{#5}% \tA & \tB & \tC & \tD & \tE \\ } ...
10
votes
1answer
281 views

Restore kerning across empty groups

Context In my document, I attach a tooltip to the middle part of a word. To demonstrate this behavior, try mousing over just the letter V in the word AVA. Here is the implementation and usage of my ...
4
votes
1answer
131 views

\AfterGroup sorcery and choking tex/pgf

In the following code, the line \AfterGroup* (from theetextools package) causes the pdfLatex compiler to 'choke', i.e it produces only this output and the process is stuck forever, consuming 13% of ...
4
votes
0answers
328 views

Multiple ternary plots and pie charts in pgfplots

I'm trying to plot lots of ternary plots and pie charts. Ideally it should look smth like this: The pie-chart (ternary plot) on the left-hand side serves as an explanation of what is happening, ...
8
votes
1answer
68 views

Missing bullet when itemize \item content is empty and buried within a group

When writing my question about various approaches to creating loops, I stumbled across the following anomaly \documentclass{article} \usepackage{pgffor} \begin{document} \begin{itemize} \foreach \x ...
2
votes
0answers
22 views

Behavior of \global when used with xifthen package [duplicate]

I'm trying to calculate the sum of some numbers in my document. I want to allow non-integer values, so I'm using lengths, which works just fine. In my document it's often necessary to specify the ...
3
votes
1answer
128 views

mdframed: setting up a global environment

How do I set up a global mdframed environment? Would I add something like this in the preamble: \newtheorem{laws} \mdfsetup{% background = blue!30,% roundcorner = 5pt } } but then I want to be ...
5
votes
2answers
178 views

Variable persist outside environment

I am using the ifthen package for some conditional formatting. I am storing state in some booleans, but it seems that there is an issue with lexical scope. In particular, when a boolean is set within ...
5
votes
1answer
584 views

Splitting a command syntax across a \newenvironment definition

This question is a direct follow-up to the question Can a \newcommand Definition Contain Braces as Substitution Text? I asked yesterday. The following example is once again a counter-intuitive one, ...
5
votes
1answer
319 views

Can a \newcommand Definition Contain Braces as Substitution Text?

The following example is completely counter-intuitive, but I need this in a bigger definition I'm not including here. \newcommand{\openbrace}{{} I need this to start a nested scope. Is this ...
14
votes
1answer
384 views

Global scope or permanent length or savebox

I am trying to save a minipage width and height in one environment, and use these dimensions in a subsequent environment of mine, to make a picture environment. The idea is to create a picture on the ...
4
votes
2answers
343 views

How to redefine \label, \ref and \pageref in a way compatible with varioref?

In order to prevent conflicts with labels when gathering exercices from a database, I need to redefine the commands \label, \ref and \pageref to add a local prefix to labels. Unfortunately, the ...
2
votes
1answer
126 views

Modifying section, subsection based on scope?

Using MS Word 2013 I mocked up what I would like to create using LaTeX: I tried exporting it in LibreOffice using its writer2latex; but that didn't work. So starting from the sectionbox LaTeX ...
7
votes
2answers
184 views

Coordinate system along line

I would like to draw a coordinate system along some lines in a framework for a structural course. This little coordinate system is called local coordinate system. At the moment the framework looks ...
3
votes
2answers
179 views

Using before as a Global setting in enumitem

I am working on a small project and am using the enumitem package reasons for beyond this example. I read the docs and managed to produce this example. Currently, I am using the before argument on the ...
7
votes
1answer
171 views

Grouping items onto the same line to avoid wrapping

I am authoring a poker-related document and am using the following commands to allow me to display cards: % Suit image adjustments: \newcommand{\suit}[1]{\includegraphics[width=8pt, height=8pt]{#1}} ...
8
votes
2answers
1k views

Limit macro/newcommand scope to section

How can I limit the scope of a \newcommand to a \section? This is what I'd like to have: The command is defined only inside the \section, not globally; The command scope is that \section and cannot ...
8
votes
2answers
189 views

Defining TeX count in a group

I thought that TeX counts were local definitions, but that is not what I am seeing. I was expecting that if I used \newcount within a group, that the etoolbox \ifdefcounter would say that the counter ...
12
votes
2answers
336 views

Is there a way to limit the scope of \usepackage?

When I tried to use the breqn package suggested by an answer to the question How do I break a long equation over lines It managed to break a whole bunch of unrelated equations (equations that did ...
15
votes
1answer
533 views

Is there a way to have an “empty” environment to merely limit scope of declarations?

I am fairly new to LaTeX, so I apologize if this is a beginner question, but I have not found a good way to query for it otherwise. I have observed that when I use an environment like ...
21
votes
1answer
760 views

] inside an optional argument

I accidentally discovered (here) that a closing square bracket within an optional argument delimited by [ ] can cause problems. Here is example code illustrating the issue: \documentclass{article} ...
4
votes
2answers
171 views

Disable chapter separation in \listoffigures and \listoftables

I use \listoffigures and \listoftables. Both commands create line breaks for items from different chapters. How can you stop that? Screenshot:
2
votes
1answer
258 views

How do I set group headings for an index in Lyx?

I want to set group headings, in form of a corresponding letter, for an index in lyx. I have one main lyx file, containing links (with include) to other lyx files, placed in a subfolder. I tried ...
5
votes
0answers
1k views

Attempts to manually change \linewidth ignored by LaTeX [closed]

I was going to try to answer the question: How can I change the geometry of a page on the chapter header page only, and return to normal on the next page? It didn't seem like it should be too ...
19
votes
3answers
371 views

What are the effects of an empty group, {}?

In order to have a syntactic space after a no-argument command, one is taught to delimit the command token with an empty group ({}), like this: \somecommand{} more LaTeX material. However an empty ...
7
votes
3answers
229 views

When to use or avoid grouping?

For writing my own TeX code, grouping (\begingroup, \endgroup) helps on automatically saving and restoring TeX "variables". (La)TeX "variables" are either macros or registers. The registers can ...
18
votes
3answers
430 views

What is the difference between local and global in a TeX meaning?

In tikz declare function and babel french option it came to the question about the difference between local and global in a TeX meaning. In the liked question the babel shorthand ; should be ...
2
votes
2answers
190 views

Why does defining a new command inside a framed block not work?

Why does the following 'minimal working example' work \documentclass[a4,german]{book} \usepackage{framed} \begin{document} \newcommand{\myText}{Bliblibli!} \begin{framed} Blabla \end{framed} ...
4
votes
1answer
133 views

Grouping Negates Effect of \centering

Why does the use of \begingroup, \endgroup negate the effect of centering in the MWE? The MWE below yields a left aligned figure (not desired), with subsequent text on the left (desired): But if ...
2
votes
1answer
112 views

Add a brace on the left side of a group [duplicate]

I can't figure out how to place the brace on the opposite side, that is on the left of the group of equations, when following the answer in this link: How to put a brace on the right, not left, to ...
0
votes
1answer
127 views

A way of handling \left and \right brackets [duplicate]

I'm looking a way of making something like this: \underbrace{ \left[\nabla\times \left[\nabla\times \left[\ldots\nabla\times }_{ \infty\text{-times taking curl operator} } ...
4
votes
1answer
773 views

How to reset \renewcommand\l{\lambda} locally

I have a large document with a lot of equation, the author overwritten the original \l (used to get polish letter ł) with \renewcommand\l{{\lambda}}. It would be to much work to find all the \l in all ...
1
vote
1answer
969 views

Single paragraph with styling and larger \parskip

I'd like to use something like this: {\bfseries\small Some text here...\setlength{\parskip}{1em}} More text here in the next paragraph... In order to increase the spacing after a single paragraph, ...