Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [grouping]

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

0
votes
1answer
35 views

Diagnosing “\end inside a group” in a multi-file document

I am getting the following message in the log file of a very long document (>700-page book) with many \included files: (\end occurred inside a group at level 2) ### simple group (level 2) entered at ...
6
votes
1answer
115 views

Grouping enumerated list with different width?

I found this nice answer regarding grouping of enumerated list. But it does not work for lists with different width. For instance \documentclass{article} \usepackage{tikz} \usetikzlibrary{...
2
votes
1answer
28 views

verbatim-environment inside group implies unwanted paragraph-break. Why? How to avoid?

When I wrap a verbatim-environment into an additional group, a new paragraph will be started after that group. (In the example below, \parindent-glue is inserted before the YYY when \begingroup and \...
1
vote
1answer
55 views

With Tikz, how can you center a scope that varies in size below or next to a node?

I'm looking for a way to center the scope local bounding box=Node4-0 below Node3-0. Also I'd like to put a fixed distance between the scopes surrounded by a red outlined box, like what happens with ...
0
votes
1answer
28 views

Grouping lines in cases and aligning them

I am reading an article, where I faced the following: I want to write such a thing in LaTeX. Basically, this whole thing is in a bracket, every two lines are grouped and labeled together, and there ...
1
vote
1answer
71 views

Keep sorting local to groups for symbols in glossaries-extra with bib2gls

Consider this example: \documentclass{article} \usepackage[record,style=alttreegroup,nomain,symbols]{glossaries-extra} \begin{filecontents}{symbols.bib} @symbol{alpha, name = {\ensuremath{\alpha}}, ...
5
votes
1answer
141 views

How to generate a xy diagram with multiple grouped data sets?

Based on the answer of Stefan Pinnow in 'How to group several charts into one chart?', I tried to generate a diagram with multiple grouped data. Therefore, I modified the diagram but I have some ...
1
vote
0answers
60 views

Double subscript [duplicate]

I have some macros whose expansion generates something like: \documentclass{amsart} \begin{document} \({T_2}_k\) \end{document} This compiles fine; technically there's a double subscript, but the ...
0
votes
1answer
33 views

Create a group to disallow display breaks?

I have an \allowdisplaybreaks command in my document, but I want to create a section where there aren't any. Is any any command that does that?
14
votes
1answer
557 views

A curious dependency between \newcommand and curly braces

An example is a bit artificial, but the point is that I do not understand why {} influence the outcome of \newcommand in the way described below. Consider the following definition: \newcommand\...
3
votes
1answer
63 views

Lost global definition after \ifthenelse using package xifthen

I created my MWE with the help of this Q&A. MWE: \documentclass{article} \usepackage{xifthen}% provides \isempty test \newcommand{\GlobalDef}[1][]{ % \ifthenelse{\isempty{#1}} % {} % ...
2
votes
1answer
65 views

Why does additional brace group cause \settominwidth to complain about missing }

I'm using the pbox package's \settominwidth command to measure the typeset width of text that includes explicit line breaks (which is a case in which standard LaTeX's settowidth doesn't work). In the ...
2
votes
1answer
44 views

Some minor question about grouping in TeX

In relation to the size of fonts I used to regard something like \Huge as a switch, \Huge{<some text>} as restricted to <some text>. Apparently not so. It turns out that proper grouping ...
3
votes
0answers
37 views

How to issue a \cr within a group in amsmath `align` and friends

I would like to enclose multiple lines in an align in a group. Because of the group, the \\ delimiting the rows generates a mistake (if I'm guessing right the group is broken at \\ and latex complains ...
8
votes
2answers
338 views

Detecting if inside a tikzpicture

I would like to define the \DrawLine macro below so that it can be invoked from within a {tikzpicture} environment or from outside: \newcommand*{\DrawLine}[1]{% \IfInTikzPic{}{\tikzpicture[remember ...
4
votes
2answers
233 views

Linebreak in centerline

I am using plain TeX. I would like to define a macro \cpar that makes \centerline{A\cpar B} expand to \centerline{A}\centerline{B} I have experiemented with things like \def\cpar{\egroup\...
5
votes
3answers
196 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 ...
0
votes
1answer
25 views

Defining a global variable inside environment for page-specific header

Here is what I would like to achieve: I would like to be able to set the header content for individual pages at the start of the respective pages in the source code. My thinking was to place the ...
1
vote
3answers
406 views

positions groups of nodes to each other in tikz

I would like to position nodes in groups a and b in the following way: Group b of tikz nodes is positioned in some symmetric way relative to group a. The following script creates nodes corresponding ...
1
vote
0answers
41 views

Dynamic datatool group by

I found this code in datatool group by? \documentclass{article} \usepackage{filecontents} \begin{filecontents*}{ff14.txt} ClassID; Schueler_Name; Schueler_Vorname; Subject 5a; Stiner; Markus; Big ...
1
vote
1answer
216 views

Beamer: Make logo from headline overlap into frametitle

Goal I'm trying to create a beamer theme where in the top we have the following layout: ________________________________________ | | | | Author & Insitute ...
4
votes
1answer
110 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
2answers
66 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. \...
1
vote
2answers
812 views

How do you change the font size globally for the \texttt environment?

How do you change the font size globally for the \texttt environment? I can do it for the verbatim environment with the following pair of commands \newcommand{\verbatimfont}[1]{\renewcommand{\...
1
vote
1answer
52 views

grouped multiple line equation?

\begin{align*} \langle H'_2 \rangle &= \int_{0}^{b} |A|^2 sin^2(kr) \frac{-V_0r^4}{2b^4} dr\\ &= \frac{(-V_0)}{2b^4}\int_{0}^{b} \frac{1-cos(2kr)}{2} r^4 dr \\ &= \frac{(-V_0)}{2b^4}...
4
votes
2answers
359 views

Defining macro \gsetlength as global setlength, reliable?

As is noted in other questions, such as Global scope or permanent length or savebox, the \setlength command does not always have global effect. In many cases, that is desirable. But when the effect ...
6
votes
2answers
349 views

alignment and groups in LaTeX: how to explain the behavior?

I am currently writing LaTeX.js to translate LaTeX to HTML in the browser. So I want it to be as exact as possible. However, TeX's alignment implementation together with LaTeX's \\ make that hard. ...
2
votes
1answer
213 views

Chess: Problem with notation style

This is a follow-up question to the one here. Using Ulrike's code from here, \documentclass{article} \usepackage{xskak} \usepackage{expl3} \makeatletter \ExplSyntaxOn \clist_const:Nn \...
1
vote
1answer
54 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. ...
0
votes
1answer
70 views

How to cumulate computed durations?

My current code generates a result as shown in the image below. My problem is: how to cumulate the "Car" durations?. When the line 95 % \global\let\routeCarTotalDuration\tempd% is uncommented, ...
0
votes
1answer
260 views

local temporary variable assignment

I am sure this has been asked many times already in many different ways, but can't get any of what I found so far to work. So here we go: I am using the following code (that I once found on here ...
1
vote
1answer
174 views

TeX warnings about non closed groups and LaTeX editors (that not warning)

Here is a MWE: \documentclass{article} \begin{document} \bgroup Test 1 { \bfseries Test 2 \begingroup Test 3 { Test 4 \end{document} After running pdflatex through my kile editor, I don't get ...
7
votes
1answer
141 views

Parshape has no effect inside group

In the MWE below the \parshape command behaves as expected. However if you add grouping (by uncommenting the two lines marked with a (*)) then it seems to have no effect! How do I make it behave like ...
0
votes
0answers
127 views

Change font locally in Beamer [duplicate]

How do I change the font locally for one word in Beamer? I want to type the Greek letter Phi in uppercase and lowercase. The uppercase in Beamer show but I want to have it looks like the varPhi which ...
3
votes
2answers
179 views

imakeidx - grouping under italic term

I am using the imakeidx package to create an index. I want my index to be completely in abecedarian sequence, so I use the @-command for terms that are in math-mode or italic. However, if I now want ...
1
vote
1answer
54 views

How to disable grouping for \includestandalone

I redefine the default macros for real and imaginary part according to \let\Re\relax \DeclareMathOperator{\Re}{Re} \let\Im\relax \DeclareMathOperator{\Im}{Im} Besides the main document, I'd also ...
5
votes
1answer
249 views

Does LaTeX3 address the subject of scope (i.e. grouping)?

TeX scope is an overwhelmingly convoluted and opaque subject. It is impossible to tell by sight when a scope starts and ends, and what exactly is being affected by it. Since scope is one of the ...
3
votes
2answers
367 views

Is a left brace implicit or explicit in assignments, and what should its category code be?

I'm trying to understand what exactly a TeX assignment is according to the TeXbook (Addison-Wesley 1996), as specified on pp. 275-278. On p. 275 it is stated that an assignment is one of two ...
5
votes
1answer
108 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 ...
6
votes
1answer
389 views

Underbracing on a set of points in a plot with pgfplots

I have two sets of points graphed in the same plot. I want to mark them grouped with an under- or overbrazing with a large curly bracket, as I have illustrated by hand here: I am looking for the same ...
0
votes
1answer
178 views

List of tables does not appear when a longtable style glossary is included in the document… I think?

\documentclass[12pt,twoside,openright,a4paper]{report} %All packages included as I am not sure what the problem is. \usepackage{tgbonum,dcolumn,graphicx,epsfig,caption,psfrag,lineno,amsmath,setspace,...
-1
votes
1answer
79 views

Command disabled Fusing up lines of code, maths mode

I appear to often accidentally hit the wrong keys when type code within sentences with ordinary lines of text. I accidentally do this too much, it will fuse the entire line together making it almost ...
0
votes
1answer
419 views

\uppercase-style commands: Line breaks AND within braces

This link describes how to make all capital commands which can handle newlines, using the \uppercase command. This link describes how to make all capital commands which can handle curly braces. How ...
3
votes
1answer
142 views

Can I limit the scope of a ToC depth change for a local ToC? (\etocsettocdepth)

I'd like to create local table of contents that list the subsections within a section as an itemized list. To do this, I used etoc and defined a style \etocsetstyle accordingly. The problem is that ...
3
votes
2answers
139 views

Remove extra curly braces for def'ed argument

I am trying to combine the answers of Remove extra curly braces and \def'ed plain-text argument behaves differently from plain text, and I am failing. Here's an MWE: \documentclass{article} \...
5
votes
4answers
448 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 ...
2
votes
1answer
143 views

Create a fake label ref using list

Hello everyone once again, after having resolved my doubt regarding the use of \label and \ref. Reading the comments, I have noticed that in many occasions do not need to use the referencing system, ...
9
votes
5answers
403 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 ...
6
votes
3answers
324 views

How to make \NewDocumentCommand global?

I'm using a custom macros as suggested by Christian Hupfer here to create characters for typesetting a drama script: \makeatletter \NewDocumentCommand{\NewPerson}{m}{% \expandafter\...
3
votes
3answers
422 views

How to delimit when writing with $$something$$?

I'm writing a mathematical (linear optimization) problem in Latex and I'm having trouble delimiting all the lines (I'm using $$something$$) so that the formulation looks balanced. which I've written ...