All Questions
60
questions
5
votes
1
answer
107
views
How to avoid resetting macro definitions within a group/environment
Here's the question: why does the following code reset the meaning of the \pgPtList control sequence when the group ends?
\documentclass[12pt]{article}
\begin{document}
\begingroup
\gdef\...
0
votes
1
answer
55
views
Saving a math style in beamer
I am trying to build a version of beamer's alt that occupies the space of its larger argument. I do this with some saveboxes and measuring. Because I also want to use it in math, I need to save the ...
0
votes
1
answer
82
views
Exercise 5.7 in TeX - define control sequences with grouping
I want to solve Exercise 5.7 in the TeXBook by Donald E. Knuth.
Define control sequences **\beginthe**<block name> and **\endthe**<block name>
that provide a “named” block structure.
In ...
1
vote
0
answers
25
views
Add content in a global table located in the beginning of the document
I would like to generate a global table with entries that can be added with a command. I based myself on this post. The issue I have is that I can only display the table after I added all its entries. ...
13
votes
2
answers
1k
views
Is this the right way to understand \let \def \edef \gdef \xdef \newcommand \renewcommand \providecommand?
I've already looked at at least ten different q&as explaining the differences of a subset of the commands listed above. While experimenting with them and trying to understand the subtle ...
0
votes
0
answers
78
views
How to execute TeX only for side effects
I need to execute a part of my TEX code without printing the text it produces while making \global macros defined by it available.
For example, when I have this group:
{
foo\global\def\bar{baz}
}
I ...
2
votes
1
answer
218
views
How to globally apply all texts as the argument of a command?
I'm trying to make an entire document to look like handwrote. For that I tried both the Cthulhu and handlatex.
Both of them require the following usage:
\command{here the text to be applied.}
Which ...
1
vote
1
answer
305
views
A group macro from a command
Goal: create a command that works within a group (a scope)
I am using polyglossia package to write bilingual texts. I want to create \eng declaration or switch to behave just like \textenglish:
{\eng ...
0
votes
2
answers
194
views
LaTex macro not properly executed in tabular environment
I want to use a macro to set the separators (&,\\) in a tabular environment. The macro should thereby act as a Boolean switch with three states. Unfortunately I keep getting a result like this:
...
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}
...
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 ...
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 ...
0
votes
0
answers
167
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}
\...