由于垂直间距不好,mqty 看起来很丑

由于垂直间距不好,mqty 看起来很丑

下面是我的代码片段:

12: We can rewrite $W$ as $s\mqty[1 \\ 1 \\ 2 \\ 0]+t\mqty[3 \\ -1 \\ -1 \\ 4]$. Again we assume that $s$ and $t$ are real numbers. This shows that $W=$ Span$\left\{\mqty[1 \\ 1 \\ 2 \\ 0],\mqty[3 \\ -1 \\ -1 \\ 4]\right\}$. Since both vectors are in $\mathbb{R}^4$ since they have 4 entries each, by theorem 1 the given set is a subspace of $\mathbb{R}^4$.

代码如下:

在此处输入图片描述

我认为它看起来不好有两个原因:

  1. 条目之间的垂直间距过大
  2. 每行的垂直间距完全取决于行的最大高度,而不是行出现的位置。

我怎样才能让它看起来更好一些?

前言:

\documentclass{article}
\renewcommand{\baselinestretch}{2.0} 
\usepackage{amsmath,amssymb}
\usepackage{gensymb}
\usepackage{physics}
\usepackage{graphicx}
\usepackage[a4paper, total={7in, 9in}]{geometry}
\DeclareMathSymbol{\ii}{\mathalpha}{letters}{"10}
\DeclareMathSymbol{\jj}{\mathalpha}{letters}{"11}
\newcommand{\ih}{\mathbf {\hat{\ii}}}
\newcommand{\jh}{\mathbf {\hat{\jj}}}
\newcommand{\kh}{\boldsymbol{\hat{\textbf{k}}}}
%\addtolength{\textheight}{+ .1\textheight}

答案1

我看不出\mqty{1 \\ 1 \\ 2 \\ 0}有什么比

\begin{bmatrix} 1 \\ 1 \\ 2 \\ 0 \end{bmatrix}

我会对保持距离physics,但你来判断是否要听从我的建议。

无论如何,在修复了“Span”问题之后,我排版了以下示例文档:

\documentclass{article}
\usepackage{amsmath,amssymb}
\usepackage{physics}

\DeclareMathOperator{\Span}{Span}

\begin{document}

12: We can rewrite $W$ as $s\mqty[1 \\ 1 \\ 2 \\ 0]+t\mqty[3 \\ -1 \\ -1 \\ 4]$. 
Again we assume that $s$ and $t$ are real numbers. This shows that 
$W=\Span\left\{\mqty[1 \\ 1 \\ 2 \\ 0],\mqty[3 \\ -1 \\ -1 \\ 4]\right\}$. 
Since both vectors are in $\mathbb{R}^4$ since they have 4 entries each, by 
theorem 1 the given set is a subspace of $\mathbb{R}^4$.

\end{document}

并得到

在此处输入图片描述

矩阵中没有间距问题。问题是什么?你可能使用setspace或直接使用一些\linespread指令。事实上,如果我将\usepackage{setspace}和添加\doublespacing到上面的代码中,我会得到

在此处输入图片描述

这是双倍行距的已知问题。修复方法\arraystretch如下:

\documentclass{article}
\usepackage{amsmath,amssymb}
\usepackage{physics}
\usepackage{setspace}

\doublespacing
\renewcommand{\arraystretch}{0.6}% the reciprocal of 1.667

\DeclareMathOperator{\Span}{Span}

\begin{document}

12: We can rewrite $W$ as $s\mqty[1 \\ 1 \\ 2 \\ 0]+t\mqty[3 \\ -1 \\ -1 \\ 4]$.
Again we assume that $s$ and $t$ are real numbers. This shows that
$W=\Span\left\{\mqty[1 \\ 1 \\ 2 \\ 0],\mqty[3 \\ -1 \\ -1 \\ 4]\right\}$.
Since both vectors are in $\mathbb{R}^4$ since they have 4 entries each, by
theorem 1 the given set is a subspace of $\mathbb{R}^4$.

\end{document}

在此处输入图片描述

然而,需要注意以下几点:

  1. 不要使用双倍行距,除非你的机构强制要求;

  2. 不要内联使用大矩阵:转置它们并给出符号名称。

答案2

我建议您 (a) 在内联数学模式下使用向量时对其进行转置,以及 (b) 毫不犹豫地使用显示数学模式。例如:

在此处输入图片描述

\documentclass{article}

\usepackage{mathtools,amssymb,amsthm}
\DeclareMathOperator{\Span}{Span}

\begin{document}

\noindent
12. We can rewrite $W$ as 
$s\begin{bmatrix}1 & 1 & 2 & 0\end{bmatrix}'
+t\begin{bmatrix}3 &-1 &-1 & 4\end{bmatrix}'$,
where $s$ and $t$ are real numbers. This shows that 
\[
W=\Span\left\{
\begin{bmatrix}     1 \\ 1 \\ 2 \\ 0 \end{bmatrix},
\begin{bmatrix*}[r] 3 \\-1 \\-1 \\ 4 \end{bmatrix*}
\right\}. 
\]
Since both vectors are in $\mathbb{R}^4$ (since they have 4 entries each), by Theorem~1 the given set is a subspace of~$\mathbb{R}^4\vphantom{\big]'}$.
 
\end{document}

答案3

TeX 无法计算相对于行中大对象位置的行间距。它不知道大对象是否比第二个大一个,或者(如您的示例所示)如果行之间的空间减小,这些大对象是否不接触。TeX 处理线条就像处理具有高度和深度的盒子一样。高度是行中对象的最大高度,深度是类比的。当 TeX 在线之间插入空间时,它只会查看线条的深度和高度,而不会查看线条内所有对象的深度和高度。

Mico 提出了解决您问题的最佳方法:在内联数学中使用向量转置。或者,您可以在内联数学中使用较小尺寸的矩阵。OpTeX 会自动执行此操作:

\def\mqty[#1]{\left[\matrix{#1}\right]}
\hsize=17cm \parindent=0pt

12: We can rewrite $W$ as $s\mqty[1\cr 1\cr 2\cr 0]+t\mqty[3\cr -1\cr -1\cr 4]$.
Again we assume that $s$ and $t$ are real numbers. This shows that $W=$
Span$\left\{\mqty[1\cr 1\cr 2\cr 0],\mqty[3\cr -1\cr -1\cr 4]\right\}$.
Since both vectors are in ${\bbchar R}^4$ since they have 4 entries each, by
theorem 1 the given set is a subspace of ${\bbchar R}^4$.

\bye

给出

mqty1

您也可以使用 TeX 基元来减少行与行之间的单独间距\vadjust。我们的例子:

\def\mqty[#1]{\left[\matrix{#1}\right]}
\hsize=17cm \parindent=0pt

12: We can rewrite $W$ as $s\mqty[1\cr 1\cr 2\cr 0]+t\mqty[3\cr -1\cr -1\cr 4]$.
\vadjust{\kern-9pt}%
Again we assume that $s$ and $t$ are real numbers. This shows that $W=$
Span$\left\{\mqty[1\cr 1\cr 2\cr 0],\mqty[3\cr -1\cr -1\cr 4]\right\}$.
Since both vectors are in ${\bbchar R}^4$ since they have 4 entries each, by
theorem 1 the given set is a subspace of ${\bbchar R}^4$.

\bye

给出

mqty2

相关内容