Questions tagged [grouping]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
21 views

grouped bar chart only showing one variable

My code for the bar chart I want, only shows 1 x group of 4 x bars. It's meant to have 3 x 4 groups/bars and i don't know what to do to get the others to show. I also want to add a line across the ...
0
votes
0answers
21 views

Error: Missing \endgroup inserted (dmath)

I have the problem with the error shown in the following screenshot. I cannot figure out what the problem is as this identical syntax has worked in other files... Thanks in advance for your help!
0
votes
0answers
18 views

How can I create Local commands definitions in equations?

I would like to use small local macro expansion similar to how \newcommand works but on a per environment basis. Something that would expand \[ \begin{local} \local{\poly}[2][x]{#1^2 - #1^#2} \...
1
vote
0answers
39 views

How can I use a minted listing inside a tcolorbox's top half *and* bottom half?

I'm creating reference documentation for a intro-to-programming class. As part of this, I'm going to have syntax definitions and examples of the syntax. To write this, I'd like to have LaTeX syntax ...
2
votes
1answer
80 views

How to make a simple macro from this grouping?

I'm frequently using the following group code to reduce vertical space between some equations (with the equation, align, gather and other maths environment) and the text above it: \begingroup\...
1
vote
1answer
72 views

Writing expanded macro with space to file

I'm trying to write an expanded macro to a file without the expansion eating the space after it. I could replace the {} empty group with an explicit \space, but I want this to be fairly robust. Is ...
2
votes
1answer
58 views

Why does the \centering command affect prior text?

Usually commands of the form: {\command <text>} affect only <text> and nothing else. In other words, the scope of such commands is limited to the group they are nested in. In the case of ...
0
votes
1answer
52 views

How to properly style only some chapter headings differently with KOMA

This is a follow-up to my previous question with more details. In my document there are some chapters with a number and some chapters without a number (like introduction or acknowledgements). I have ...
2
votes
1answer
58 views

Wrong spacing when formatting single chapter title with KOMA

I would like to format only the first chapter heading in my document differently using KOMA script. I want to change both the font and the presence of the chapter prefix. As apparently KOMA does not ...
6
votes
3answers
246 views

Questions about `\cs_new:…` and friends and their TeX relatives regarding global, local, long, nopar, protected, expandable and naming

This question is two-fold. Unfortunately, one side is opinionated, i.e. something to close-vote, so I put that part at the end and hope no one notices... The other side (coming first) are serious ...
2
votes
1answer
35 views

Parse standard balanced group within verbatim context

Say I want to write a custom parser which reads characters in a verbatim context, where the parser argument should be split into several kinds of tokens: Ordinary characters, i.e. all characters ...
3
votes
1answer
54 views

Bug when creating boxplot groups

I need to create a boxplot chart where the boxes are grouped. Based on the answer to this question . Create a graph which contains 4 groups where each group is composed of 4 boxes. \documentclass{...
9
votes
1answer
109 views

Semantic differences of global definitions in local group relating to save-stack entries

This is a follow-up question on \global variant of \csname…\endcsname, which asks for a solutions to the problem explained there, but doesn't ask for an explanation. The gist of the problem is that {...
17
votes
2answers
489 views

\global variant of \csname…\endcsname

Please consider the following minimal example: \documentclass{article} \tracingrestores=1 \def\foo{\bar\foobar} \def\bar{\gdef\testA{blabb}} \def\foobar{\expandafter\gdef\csname testB\endcsname{...
0
votes
1answer
19 views

Loading images disaligns document

I do not know whether the question has already been asked, Since I'm a rookie writing in latex, I'd like to know what I'm missing when i upload an image on my document, because it disaligns ...
1
vote
2answers
26 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}{...
1
vote
1answer
46 views

Improper first paragraph indentation after grouped sections

I have a KOMA-based document where section footnotes and text footnotes are formatted differently: \documentclass{scrartcl} \setlength\parindent{24pt} \usepackage[symbol]{footmisc} \usepackage{...
1
vote
1answer
44 views

Defining command part by part 2

This question is an extension to Defining command part by part thread. Let's say we have a command \foo with 1 argument. Can we produce a command \setfoo{aaa}{<some stuff>} which redefines \foo ...
0
votes
1answer
56 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 ...
5
votes
1answer
128 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
39 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 \...
2
votes
1answer
88 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
37 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 ...
2
votes
1answer
178 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
162 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
84 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 ...
1
vote
1answer
59 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?
15
votes
1answer
657 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
113 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
70 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
46 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 ...
2
votes
1answer
59 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
362 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
541 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
348 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
33 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
593 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
47 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
335 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
128 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
77 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
2answers
1k 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
66 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}...
5
votes
2answers
508 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
397 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
223 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 \...
2
votes
1answer
75 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
86 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
403 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
319 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 ...

1 2 3 4 5