Questions tagged [grouping]
{grouping} is about the grouping mechanism in TeX, and about local and global assignments.
281
questions
2
votes
1
answer
323
views
How to make `\cref` after expansion stand at the same group of surrounding text?
I would like to make \cref after expansion stand at the same group of surrounding text.
With \crefname{figure}{图}{图}, I need to use 如\cref{...} 所示 to make typesetting correct, if the counter of figure ...
4
votes
1
answer
87
views
Can this code be more compact?
I have a number of commands with the same structure as this one and I'm wondering whether or not the code can be compacted to avoid having to type the E_{K and K_{\symup{trans} twice each. I don't see ...
3
votes
1
answer
2k
views
"Paragraph ended before ..." error in TeX
While playing around with TeX, I came across a strange error. This is my input file:
\def\twice#1{#1#1}
\def\hello{Hello World.\par}
\twice{\hello} % works
\twice{Hello World. } % works
\twice{Hello ...
1
vote
4
answers
118
views
Suppress all typesetting within a group
I have a macro that is purely functional (e.g. only defines other macros), and I want to be able to invoke this inline without any new paragraphs or blank spaces being typeset.
\documentclass{article}
...
1
vote
1
answer
109
views
Why does \endgroup not work inside \uline?
I want underlined text (or math) where the color of the underline is different from the color of the text (e.g. black text underlined by a red line). Therefore I tried the following code using the \...
6
votes
2
answers
701
views
Why do I have to put braces around my macro for subscripts / indices?
I want to define a macro \ind which let's me set in math mode a subscript in upright letters and when starred (\ind*) in italic letters. Additionally, an optional argument allows me to adjust the ...
0
votes
0
answers
137
views
How to make brackets work like group separators?
I know that the following is not something you are usually supposed to do, but I ask anyway: I am getting quite tired of the fact that TeX does not treat the content of brackets [...] as groups like {....
1
vote
1
answer
1k
views
How to change the global font size of align?
I'd like to change the font size of align blocks. I've tried to change it by using \large, but this also changes the equation numbering. The second approach was to use \declaremathsizes in combination ...
4
votes
1
answer
212
views
Declaration commands of setspace have no effect inside groups
According to this answer of the question change space to only a part of the document (about 8 years ago), the effect of setspace' declaration commands (\singlespacing, \onehalfspacing, \doublespacing) ...
4
votes
0
answers
300
views
SIUnitx Unit Grouping
Is there any siunitx options to manage grouping of units when per-mode=symbol is active? Or, is there a better way to handle this?
Manually inserting parenthesis works fine (second line).
But, when I ...
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}{\...
6
votes
4
answers
530
views
What LaTeX macros cannot accept a group as an argument?
I am working on a LaTeX pretty printer that parses a LaTeX document and then re-renders the source. (I know that this is not possible in all cases, but it should be possible a lot of the time.)
In ...
5
votes
1
answer
1k
views
Formating Maxwell's Equations
Hey y'all I am trying to format Maxwell's equations like the image below but without the box. I also want to be able to reference the labels, thanks!
4
votes
2
answers
414
views
Text variant vs font switch - bfseries
I stumbled into the following sample
\documentclass[a4paper,11pt]{article}
\usepackage[english, ngerman]{babel}
\begin{document}
Quick test - not yet bold
"\textbf{Bold text for test - part 2}
...
2
votes
1
answer
77
views
When do curly braces disappear in macro definitions? (e.g. \documentclass expansion)
I've been looking into how \documentclass and friends are actually defined, and I noticed something peculiar which I'd like to understand.
Let's say I have \documentclass[11pt, titlepage]{article}. ...