{grouping} is about the grouping mechanism in TeX, and about local and global assignments.
0
votes
0answers
19 views
Why does \tiny in \begingroup \endgroup change the linespread? [duplicate]
\documentclass[10pt]{article}
\usepackage[ngerman]{babel}
\usepackage{blindtext}
\setlength{\parindent}{0pt}
\begin{document}
\begingroup
\tiny \blindtext
\endgroup
\tiny \blindtext
...
7
votes
1answer
52 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}}
...
6
votes
2answers
79 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
91 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 ...
11
votes
2answers
220 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 ...
12
votes
1answer
144 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 ...
18
votes
1answer
303 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
70 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
64 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 ...
3
votes
0answers
143 views
Attempts to manually change \linewidth ignored by LaTeX
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 ...
17
votes
3answers
269 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
162 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
...
14
votes
3answers
218 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
72 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
58 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
72 views
Add a brace on the left side of a group
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
94 views
A way of handling \left and \right brackets
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
190 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
187 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, ...
2
votes
1answer
136 views
Paragraph and subparagraph title inheriting features from TeX group *after* it
I'm getting some strange behaviour when using the color package at paragraph and subparagraph level. See the code snippet below:
\usepackage[usenames,dvips]{color}
\section{A}
{\color{Green} ...
2
votes
1answer
80 views
Why can't I set hyperref's pdfinfo from within a group? (Is it a bug?) [closed]
When I run the following code (using hyperref version 2012/09/27 v6.83g), I do not get any errors or warnings, but the metadata I set using pdfinfo doesn't appear. If I uncomment the \@firstofone ...
8
votes
1answer
96 views
Creating temporary definitions for commands
In the context of writing something like homework solutions for a math class, I often face an awkward situation. Each problem will have some idiomatic functions that are cumbersome and error prone to ...
9
votes
2answers
165 views
How to create *local* labels/refs in LaTeX?
Concise question:
Is there any way to limit the scope in which a \label is visible to a \ref?
Motivation:
My current goal is to create a rather large document, containing many exercises and their ...
8
votes
2answers
282 views
How can I change the text color in such a way that the effect transcends groups?
I'd like to have a command \globalred that makes all subsequent text red, even if the command is issued inside a group. For example, the output of the TeX file
\documentclass{article}
...
2
votes
1answer
71 views
Strange chapter influence on quotation environment
The code below give a strange result when I comment out the \begingroup end \endgroup: the quotation environment has different vertical space to the text before ("Some text").
What is it that chapter ...
3
votes
1answer
407 views
Grouping nodes in tikz
For the MWE below:
\documentclass[a4paper,11pt,twoside]{report}
\usepackage[left=2.5cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage{amsmath, graphicx, tikz, enumerate, ...
5
votes
1answer
69 views
Problem setting lengths in an environment (spilling outside of the environment)
I am having with spacing between paragraphs in my document, and I think I have been able to trace back to a custom environment I have defined.
\makeatletter
\def\remarkname{Remark}
...
12
votes
1answer
83 views
Difference between “hbox group” and “adjusted hbox group”?
eTeX's \currentgrouptype distinguishes two types of \hbox group types
\hbox{\showthe\currentgrouptype} % 3 "adjusted hbox group"
\noindent
\hbox{\showthe\currentgrouptype} % 2 "hbox group"
Looking ...
3
votes
2answers
247 views
How to make a recursive macro in (La)TeX?
The following MWE is the code of my attempt translating my working algorithm in C# to (La)TeX. I don't understand why it does not work. Can you probe the source of problem?
Remarks:
#1 is a list of ...
12
votes
2answers
220 views
necessity of braces for accent commands
Many resources on LaTeX teach that "é" and "ä" are typeset with (respectively) \'{e} and \"{a}; and it is similar for other accent symbols. Are the braces really needed? Aren't \'e and \"a shorter but ...
19
votes
2answers
211 views
global confusion
Simply put, when should I care if something is global or not? What does this really mean?
If my package, for example, provides
\newcommand*{\setfooter}[1]{\def\mypackage@footer{#1}}
And I later ...
7
votes
3answers
342 views
Using execute at begin node with \phantom and \pgfuseimage in TikZ?
Problem
I would like to create several nodes whose text is a placeholder for an image, i.e., \phantom{\pgfuseimage{mypicture}}. This is easily done as, for example:
\matrix {
\node ...
15
votes
1answer
142 views
First occurrence of a command
I'm writing some macros that need to behave differently after first occurrence. I decided to use the etoolbox package's toggle. My MWE is as follows:
\documentclass{article}
\usepackage{etoolbox}
...
15
votes
1answer
209 views
Why is \global\let not always global?
As an LaTeX environment opens a local group, it is normally necessary to use a global definition if changes in the environment should be available after the environment:
\documentclass{minimal}
...
0
votes
0answers
248 views
command definition outside \begingroup \endgroup pair not working [closed]
This MWE is from a real case where an error occurs (with a hint about WSF from suffix package, but below the error is different) with \globaldefs=1\relax in a \begingroup \endgroup pair, in order to ...
11
votes
1answer
224 views
What is the scope of elements of TikZ pictures?
I understand that named elements of a tikzpicture cannot be referenced before they are defined; but I'm confused about how "long" a named element persists. It appears that once named, an element ...
18
votes
4answers
402 views
How do I get a value out of a group?
I've just recovered from my first real foray into LaTeX3 programming. It was ... an experience. Not a completely unpleasant one and once I'd gotten used to the syntax then I found it a lot easier ...
1
vote
1answer
153 views
Unexpected scoping issue using \XeTeXinterchartoks
Minimal example (compile with xetex):
\XeTeXinterchartokenstate = 1
\newXeTeXintercharclass \classa
\XeTeXcharclass `\a \classa
\XeTeXinterchartoks 255 \classa = {\begingroup}
\XeTeXinterchartoks ...
11
votes
3answers
694 views
\global\renewcommand equivalent of \global\def
The following MWE works just fine, but I had to resort to using \global\def (not that there's anything wrong with it). The intent of the MWE is to provide access to the value of macro as set in an ...
10
votes
2answers
4k views
Temporarily increase line spacing
How do I temporarily increase line spacing? I have some text on my title page:
\begin{center}
{ \Large \textbf{The Great Thesis About Some Very Great Things Indeed With
a Pretty Long Title That Will ...
5
votes
1answer
743 views
How to globally tikzset styles
I would like to set a tikzstyle from within a tabular environment, and use it after the table. Adding the usual \global seems to have no effect. The MWE below produces:
but I want the last line ...
11
votes
2answers
381 views
\expandafter within a \begingroup … \endgroup [duplicate]
Possible Duplicate:
What does \begingroup\expandafter…\endgroup do?
In many of Heiko Oberdiek's packages one sees this type of construction:
...
8
votes
2answers
352 views
\newtoks token seems to have local scope
I want to collect the first line of a quotation to use later. I have used \newtoks for a similar purpose so tried it here, this way:
\documentclass[12pt] {article}
\newtoks{\qfirstlineinternal}
...
12
votes
3answers
417 views
Use \bgroup and \egroup to set some pre and post code to a macro
Why isn’t it possible to use \bgroup and \egroup in this way?
\documentclass{article}
\def\precode{\fbox\bgroup}
\def\postcode{\egroup}
\newcommand{\mymacro}[1]{\precode#1\postcode}
...
3
votes
1answer
230 views
How to create groups of table rows with alternating colors?
Problem. When coloring a table, using different colors for even / odd rows is quite usual and can be accomplished with the xcolor package. I, however, don't want to have alternating colors per row, ...
4
votes
1answer
145 views
Measure and retain lengths between tabular rows
I need elements in a tabular environment to set some lengths and be able to access these lengths in another row of this same table. But it appears that adding \global in front of \settoheight and ...
8
votes
3answers
743 views
Drawing a proper shadow for overlapping objects
I draw images that are composed of several overlapping nodes. If I add a drop shadow to each node, the shadow of the second node is drawn over the first node, as seen in the picture below (which ...
9
votes
2answers
398 views
Beamer: content in box register does not survive \end{frame}
Consider the following example (I edited the example to include LaTeX lrbox environment):
\documentclass{beamer}
\newsavebox\mybox
\newsavebox\myboxb
\begin{document}
\frame{
\sbox\mybox{Hello ...
4
votes
2answers
156 views
why aren't the \left and \right before my parentheses changing their size?
I am working on a document, and in only one case have the \left and \right before my parentheses seemed to do anything.
For example, I have this equation:
\begin{equation}
\mathbb{E}(RS_{nd}) = ...
9
votes
1answer
120 views
Emulate TeX's grouping
In TeX, various kinds of groups must match properly, for instance, the following is wrong:
$ \begingroup $ \endgroup
I would like macros which allow such mismatched grouping. They would keep ...


