TeX - LaTeX Asked on July 25, 2021
I have the following simple code that I thought would output the AMS “gather” equation properly cropped at all sides up to the point where an imaginary straight line drawn at each side would touch the contents of the equation (enclosing it in imaginary box without leaving any spaces). But for some reason there is a big uncropped space on the left and top sides as well as a little one at the right side.
documentclass[fleqn,varwidth]{standalone}
usepackage{amsmath}
begin{document}
begin{gather*}
2^{1}=binom{1}{0}+binom{1}{1}
2^{2}=binom{2}{0}+binom{2}{1}+binom{2}{2}
end{gather*}
end{document}
Here I highlight the spaces I don’t want standalone class to output
Your help with modifying the code to make this unwanted spaces go away is greatly appreciated.
Thanks
I think you need an output that does not span across multiple page then converting displayed equations to inline equations.
documentclass[margin=1pt]{standalone}
usepackage{amsmath}
begin{document}
$!
begin{gathered}
2^{1}=binom{1}{0}+binom{1}{1}
2^{2}=binom{2}{0}+binom{2}{1}+binom{2}{2}
end{gathered}
$
end{document}
Notes:
margin of 1 pt is optionally added, remove it if you do not need it.
!
is important to remove the unnecessary whitespace.
use displayequation
after the opening $
if you need displayed version of "font".
The above is for gathered
, for aligned
see the following.
documentclass[margin=1pt]{standalone}
usepackage{amsmath}
begin{document}
$!
begin{aligned}
2^{1}&=binom{1}{0}+binom{1}{1}
2^{2}&=binom{2}{0}+binom{2}{1}+binom{2}{2}
end{aligned}
$
end{document}
Correct answer by Who Save Me Save Entire World on July 25, 2021
You can do it with a TABstack, using the new and improved tabstackengine
package (2016-10-04).
documentclass[varwidth]{standalone}
usepackage{amsmath}
usepackage{tabstackengine}[2016-10-04]
TABstackMath
TABstackMathstyle{displaystyle}
setstackgap{S}{6pt}
begin{document}
alignShortstack{
2^{1}=&binom{1}{0}+binom{1}{1}
2^{2}=&binom{2}{0}+binom{2}{1}+binom{2}{2}
}!
end{document}
Answered by Steven B. Segletes on July 25, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP