TransWikia.com

Three stacked lines not evenly distributed

TeX - LaTeX Asked on December 31, 2021

I’m having some small spacing glitches with this stack, and I’m wondering about the best way to do this:

documentclass[11pt,letterpaper,twoside]{book}
usepackage[T1]{fontenc}
usepackage{lmodern}
usepackage[total={6in,10in},left=1.5in,top=0.5in,includehead,includefoot]{geometry}
usepackage{microtype}
usepackage{amsmath}
usepackage{amsfonts}
usepackage{mathtools}
usepackage{tensor}

begin{document}

    begin{equation}
        A_{mu nu lambda} +
    left[ : substack{
        mu ; rightarrow ; lambda \
        nu ; rightarrow ; mu \
        lambda ; rightarrow ; nu
    } : right] +
    left[ : substack{
        mathstrut smash{mu ; rightarrow ; nu} \
        mathstrut smash{nu ; rightarrow ; lambda} \
        mathstrut smash{lambda ; rightarrow ; mu}
    } : right]
    end{equation}

end{document}

Preview:

enter image description here

As you can see on the preview, the second part has variable vertical spacings (mostly because of the lambda symbol), which I find very ugly. I hacked it (last part) by smashing everything and added a phantom vertical space (using mathstrut). But is there a better or simpler way of doing this? How can I get a better result?

3 Answers

You can use an array in scriptsize.

documentclass[11pt,letterpaper,twoside]{book}
usepackage[T1]{fontenc}
usepackage{lmodern}
usepackage[total={6in,10in},left=1.5in,top=0.5in,includehead,includefoot]{geometry}
usepackage{microtype}
usepackage{amsmath}
usepackage{amsfonts}
usepackage{mathtools}
usepackage{tensor}

newenvironment{scriptarray}[2][c]
 {%
  mathord{}% just to ensure this is used in math
  hboxbgroupscriptsize$begin{array}[#1]{#2}%
 }
 {%
  end{array}$egroup
 }

begin{document}

begin{equation}
A_{mu nu lambda} +
  left[ begin{scriptarray}{@{}c@{}}
    mu rightarrow lambda \
    nu rightarrow mu \
    lambda rightarrow nu
  end{scriptarray} right]
end{equation}

end{document}

enter image description here

Answered by egreg on December 31, 2021

I think you're abusing the substack machinery by employing it in a situation it clearly wasn't meant to be used in.

I suggest you employ either a bmatrix environment or a bsmallmatrix environment; if you choose the latter, be sure to employ mathstrut directives in all rows too.

enter image description here

documentclass[11pt,letterpaper,twoside]{book}
usepackage[T1]{fontenc}
usepackage{lmodern}
usepackage[total={6in,10in},
   left=1.5in,top=0.5in,
   includehead,includefoot]{geometry}
usepackage{microtype}
usepackage{amsmath}
usepackage{amsfonts}
usepackage{mathtools}% for 'bsmallmatrix' env.
usepackage{tensor}

begin{document}
begin{gather*}
%% Row 1: left[ substac{ ... } right]
    A_{mu nu lambda} +
    left[ : substack{
        mu ; rightarrow ; lambda \
        nu ; rightarrow ; mu \
        lambda ; rightarrow ; nu
    } : right] +
    left[ : substack{
        mathstrut smash{mu ; rightarrow ; nu} \
        mathstrut smash{nu ; rightarrow ; lambda} \
        mathstrut smash{lambda ; rightarrow ; mu}
    } : right]\ 
%% Row 2: bmatrix environment
    A_{mu nu lambda} +
    begin{bmatrix}
        mu to lambda \
        nu to mu \
        lambda to nu
    end{bmatrix} +
    begin{bmatrix}
        mu to nu \
        nu to lambda \
        lambda to mu
    end{bmatrix}\ 
%% Row 3: bsmallmatrix environment
    A_{mu nu lambda} +
    begin{bsmallmatrix} 
        mu to lambda mathstrut\
        nu to mu mathstrut\
        lambda to numathstrut
    end{bsmallmatrix} +
    begin{bsmallmatrix}
        mu to nu mathstrut\
        nu to lambda mathstrut\
        lambda to mu mathstrut
    end{bsmallmatrix}
end{gather*}

end{document}

Answered by Mico on December 31, 2021

You could use an array where the entries are in scriptstyle.

documentclass[11pt]{article}
usepackage{lmodern}
usepackage{mathtools}
usepackage{array}
begin{document}
[
renewcommand{arraystretch}{0.55}
A_{mu nu lambda} +
biggl[ begin{array}{@{,}>{scriptstyle}c@{,}}
    mu ; rightarrow ; lambda \
    nu ; rightarrow ; mu \
    lambda ; rightarrow ; nu
end{array} biggr]
]
end{document}

Answered by Vincent on December 31, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP