Skip to main content

All Questions

Tagged with
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\...
Kellen Brosnahan's user avatar
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 ...
Bubaya's user avatar
  • 2,549
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 ...
GarretW's user avatar
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. ...
Pa Dalton's user avatar
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 ...
mbly82553's user avatar
  • 131
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 ...
jiwopene's user avatar
  • 189
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 ...
user avatar
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 ...
AvidSeeker's user avatar
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: ...
Gedlex's user avatar
  • 3
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 ...
Eklavya Sharma's user avatar
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} ...
rish987's user avatar
  • 155
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 ...
Marc Krass's user avatar
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}{\...
user126154's user avatar
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 ...
Jason Siefken's user avatar
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} \...
afiori's user avatar
  • 445

15 30 50 per page