悠闲数学娱乐论坛(第2版)'s Archiver

青青子衿 发表于 2021-8-24 14:19

align的行距小问题

\begin{align*}
\left\{\begin{aligned}
x&=\dfrac{1-t^2}{1+t^2}\\[-0.5em]
y&=\dfrac{2t}{1+t^2}
\end{aligned}\right.\quad
\left\{\begin{aligned}
x&=\dfrac{1-t^2}{1+t^2}\\
y&=\dfrac{2t}{1+t^2}
\end{aligned}\right.\quad
\left\{\begin{aligned}
x&=\dfrac{1-t^2}{1+t^2}\\[0.5em]
y&=\dfrac{2t}{1+t^2}
\end{aligned}\right.
\end{align*}
在花括号不变化的情况下,有办法把第一行往上移一点吗?

kuing 发表于 2021-8-24 14:43

为啥要移?

kuing 发表于 2021-8-24 15:50

哦,你是因为 x, y 与左边花括号的相对位置不对称,所以从视觉上感觉有问题是吧?

造成这视觉效果的原因有二:
一、x 与 y 的区别,y 本身就更低。
二、分子有上标,增加了高度,而分母深度小。
[attach]10320[/attach]

因此,假如换个字母,y 改 z,然后加点括号让分母多点深度,这样看起来是不是就对称多了:
[attach]10321[/attach]

abababa 发表于 2021-8-24 16:08

[b]回复 [url=http://kuing.orzweb.net/redirect.php?goto=findpost&pid=40915&ptid=8170]3#[/url] [i]kuing[/i] [/b]
如果用\vphantom{t^2}和\vphantom{y}把两个式子变成一样的,这个高度感觉还是有差别,是不是本来就有区别?

kuing 发表于 2021-8-24 16:16

[b]回复 [url=http://kuing.orzweb.net/redirect.php?goto=findpost&pid=40916&ptid=8170]4#[/url] [i]abababa[/i] [/b]

代码贴一下

abababa 发表于 2021-8-24 16:21

[b]回复 [url=http://kuing.orzweb.net/redirect.php?goto=findpost&pid=40917&ptid=8170]5#[/url] [i]kuing[/i] [/b][code]
\begin{align*}
\left\{
\begin{aligned}
x\vphantom{y}&=\dfrac{1-t^2}{1+t^2}\\
y&=\dfrac{2t\vphantom{t^2}}{1+t^2}
\end{aligned}
\right.
\end{align*}
[/code]但是把$y$变成$z$,感觉确实不同,是不是只是感觉上不一样,看上去那个$y$显得长,但实际上已经一样了?

kuing 发表于 2021-8-24 16:31

[b]回复 [url=http://kuing.orzweb.net/redirect.php?goto=findpost&pid=40918&ptid=8170]6#[/url] [i]abababa[/i] [/b]

分子变成一样有啥用,即便像下面这样同一个式子写两次:
\[\left\{\begin{aligned}x&=\dfrac{\displaystyle\int}{1+t^2}\\x&=\dfrac{\displaystyle\int}{1+t^2}\end{aligned}\right.\]关键是分母(最后一行的)深度不及分子(首行的)高度。
想对称,得把第二个倒过来:
\[\left\{\begin{aligned}x&=\dfrac{\displaystyle\int}{1+t^2}\\x&=\dfrac{1+t^2}{\displaystyle\int}\end{aligned}\right.\]

abababa 发表于 2021-8-24 17:12

[b]回复 [url=http://kuing.orzweb.net/redirect.php?goto=findpost&pid=40919&ptid=8170]7#[/url] [i]kuing[/i] [/b]
原来如此,但实际上那个括号应该就是不对称的吧,这么说可以在y的分母上加上big之类的不可见符号来提升高度吧,比如:[code]
\begin{align*}
\left\{
\begin{aligned}
x&=\dfrac{1-t^2}{1+t^2}\\
y&=\dfrac{2t}{1+t^2\vphantom{\big|}}
\end{aligned}
\right.
\end{align*}
[/code]

kuing 发表于 2021-8-24 23:27

[b]回复 [url=http://kuing.orzweb.net/redirect.php?goto=findpost&pid=40921&ptid=8170]8#[/url] [i]abababa[/i] [/b]

括号怎么会不对称?

abababa 发表于 2021-8-25 09:10

[b]回复 [url=http://kuing.orzweb.net/redirect.php?goto=findpost&pid=40927&ptid=8170]9#[/url] [i]kuing[/i] [/b]

我的意思是,实际上应该就像7楼第一式那样吧,本来就应该是不对称的,这种对称的只是特意调整的吧。

kuing 发表于 2021-8-26 17:30

借用一下前几天的 [url=http://kuing.orzweb.net/viewthread.php?tid=8157]case 套 case[/url] 的代码,就可以实现:
[attach]10322[/attach]
或许楼主更喜欢{:lol:}

用的是那帖 3# 的 lcase 那组[code]\documentclass{article}
\usepackage{mathtools}

\newcommand\smt[1]{\smash[t]{#1}}
\newcommand\smb[1]{\smash[b]{#1}}
\newsavebox\Obox\newsavebox\Bbox\newsavebox\Tbox
\newsavebox\outbox
\newcommand\kkkkk[1]{%
\sbox\Obox{$
\renewcommand\smt[1]{##1}
\renewcommand\smb[1]{##1}
\displaystyle#1$}%
\sbox\Bbox{$
\renewcommand\smt[1]{##1}
\renewcommand\smb[1]{\smash[b]{##1}}
\displaystyle#1$}%
\sbox\Tbox{$
\renewcommand\smt[1]{\smash[t]{##1}}
\renewcommand\smb[1]{##1}
\displaystyle#1$}%
\sbox\outbox{%
\vphantom{\raise\dimexpr
\dp\Obox-\dp\Tbox-\ht\Obox+\ht\Bbox
\relax\box\Obox}%
\renewcommand\smt[1]{\smash[t]{##1}}%
\renewcommand\smb[1]{\smash[b]{##1}}%
$\displaystyle#1$}%
\box\outbox
}

\newcommand\lcase[1]{{}\left\{\begin{aligned}\relax#1\end{aligned}\right.}
\newcommand\lcaseo[1]{\kkkkk{\lcase{#1}}}      %补全距,用于外层及中间
\newcommand\lcaset[1]{\smt{\kkkkk{\lcase{#1}}}}%去高度,用于顶上的
\newcommand\lcaseb[1]{\smb{\kkkkk{\lcase{#1}}}}%去深度,用于底下的
\newcommand\lcasetz[1]{\smt{\lcase{#1}}}       %最后一层专用(为节约资源)
\newcommand\lcasebz[1]{\smb{\lcase{#1}}}       %最后一层专用(为节约资源)

\begin{document}

\fboxsep=0pt
%加 \boxed 只是为了看边界有没有问题,非必要
\[\boxed{
\lcaseo{
x&=\smt{\dfrac{1-t^2}{1+t^2}}\\
y&=\smb{\dfrac{2t}{1+t^2}}
}
}\quad\boxed{
\lcaseo{
x&=\smt{\dfrac{\displaystyle\int}{1+t^2}}\\
y&=\smb{\dfrac{\displaystyle\int}{1+t^2}}
}
}\quad\boxed{
\lcaseo{
x&=\smt{\dfrac{1+t^2}{\displaystyle\int}}\\
y&=\smb{\dfrac{1+t^2}{\displaystyle\int}}
}
}\]

\end{document}
[/code]

页: [1]

Powered by Discuz! Archiver 7.2  © 2001-2009 Comsenz Inc.