使用 LateX 创建符号定义

使用 LateX 创建符号定义

我正在尝试为分数创建图例

some text

\[Y = \frac{X_{A}}{X_{AB}}\]

$\begin{array}{l l}
     X_{A}:         & \text{Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book}  \\ 
     X_{AB}:         & \text{Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old.} \\
  \end{array}$

some other text

结果:

在此处输入图片描述

有什么可能的解决办法吗?这些行没有空格,并且部分在文档之外。

答案1

这是一个采用定制\parbox排版解释材料的解决方案。

在此处输入图片描述

的默认宽度\mybox为 3 英寸;您显然可以自由选择其他值。您还可以根据具体情况覆盖默认宽度,例如,通过写入\mybox[5cm]{...}

\documentclass{article}
\usepackage{mathtools,ragged2e}
%% Default width of \mybox is 3in:
\newcommand\mybox[2][3in]{\parbox[t]{#1}{\RaggedRight #2}}

\begin{document}

\begin{align*}
Y &= \frac{X_{A}}{X_{AB}}\\
\shortintertext{where}
X_{A} &\quad \mybox{Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.}  \\ 
X_{AB} &\quad \mybox{Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old.} 
\end{align*}

\end{document}

答案2

由于您没有提供MWE,我假设下面的代码可能会对您有所帮助:

\documentclass{book}
\usepackage{array}
\begin{document}

\newlength{\tabuserlength}%
\setlength{\tabuserlength}{\textwidth}%
\addtolength{\tabuserlength}{-1.5pc}%

\[
Y = \frac{X_{A}}{X_{AB}}
\]
\begin{tabular}{@{}m{1.5pc}p{\tabuserlength}@{}}
    $ X_{A}$:         & Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book \\ 
    $ X_{AB}$:         & Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old.
\end{tabular}

\end{document}

tabularx建议的另一种方法Mico比前一种方法更好,代码如下:

\documentclass{book}
\usepackage{tabularx}
\begin{document}

\[
Y = \frac{X_{A}}{X_{AB}}
\]
\begin{tabularx}{1\linewidth}{@{}lX@{}}
    $ X_{A}$:         & Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book \\ 
    $ X_{AB}$:         & Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old.
\end{tabularx}

\end{document}

相关内容