Linked Questions

36
votes
2answers
7k views

The mysteries of \mathpalette

I would like to make a macro, \vfrac, which output would look like: $$\displaylines{ \displaystyle\raise.25ex\hbox{$\displaystyle1$}\!/\!\lower.5ex\hbox{$\displaystyle2$} \cr \textstyle\raise....
24
votes
6answers
3k views

Is there a test for the different styles inside maths mode?

Is there a test for the different styles within maths mode? What I really want is to be able to save the current style to reinvoke it later on, but a \if along the lines of \ifmmode would work just ...
25
votes
2answers
1k views

What’s behind \over?

Typically a TeX command have arguments coming after it. But the command \over, which is used to produce fractions, can access the token before it. How exactly is it implemented and can I define a ...
23
votes
2answers
3k views

Proper use of \mathchoice

I am trying to learn how to use \mathchoice. Before the solution was posted for Non-invasive replacement for \fbox?, I attempted to use mathchoice to adjust the size of the parameter before ...
8
votes
4answers
1k views

Custom Math Symbol - Two Sigma Sums

I'd like to be able to set a new math command/macro that is a Sigma shifted slightly (diagonal) on top of another Sigma, but am unsure how to go about it. I'd like it to behave just as a single Sigma ...
12
votes
2answers
343 views

Value of LuaTeX’s \mathstyle in \frac (de)nominator

This was fixed in version from 2017/06/15 (available on CTAN). This is a followup question of How to transfer math style in \hbox_set?. While the code I posted there as an answer using LuaTeX’s \...
8
votes
2answers
530 views

Less aggressive automatic paren stretching with \left

\left and \right are convenient but sometimes they're a bit overeager in stretching the parentheses. In that case we can manually use \bigl, \Bigl, etc. I have defined a new command like this \...
4
votes
4answers
154 views

How to create special math macros which preserve the current style?

The mathtools package provides a number of commands like \mathmbox which preserve the current math style. The process seems to involve a lot of \expandafters, \mathpalette and \m@th. The following ...
7
votes
1answer
444 views

(Nonfatal but Symptomatic) Conflict of amsmath and mathstyle Packages

This was brought to my attention by our colleague, Lover of Structure, but since it affects my scalerel package (which began using the mathstyle package to detect the current math style, as of version ...
2
votes
1answer
2k views

Aligning equality sign with overset text

I'm typing a logic definition within an align environment that uses \overset{def}{=} from the amsmath environment. However, the new sign is aligned vertically based on the equality sign, and not on ...
4
votes
2answers
962 views

Adjusting the position of \dot

I'm writing a paper that uses the symbol \dot{\mathcal{U}} which for me (in PDFLaTeX with Palatino math fonts) looks like this: As you can imagine, from further away, the dot is invisible. Is there ...
2
votes
1answer
151 views

How can I know if I am inside an equation environment if it's nested with others?

I wanted to define some partial derivative commands that would be \partial y/\partial x if it was inside an inline equation and would use \frac{\partial y}{\partial x} if inside an equation ...
4
votes
1answer
187 views

\ThisStyle, \SavedStyle and \bm

I think this is a follow-up to How to capture the current math style?. In this MWE, \bm{\testbox} works when used after \testbox. But it does not work on its own (commented line): \documentclass{...
4
votes
2answers
119 views

How to transfer math style in \hbox_set?

This question is kind of follow up question of the following How to capture the current math style? Is there a test for the different styles inside maths mode? Cache math content in savebox and ...
4
votes
1answer
116 views

\ThisStyle \SavedStyle painfully slow … alternatives?

While working with customised hat glyphs using the first version of this solution, pdflatex started taking a long time compiling a document. That linked answer notes that it's a slower solution, but ...

15 30 50 per page