如何排版屬性值結構 (AVS) 和規則(如此處所示)?
答案1
使用可能方便的語法:avs
環境將第二列的列說明符作為可選參數(預設l
);它應該包含一個或多個\avsline
命令;可選參數用於指定顏色。
定義了一些輔助宏以簡化符號規範。
\documentclass{article}
\usepackage{xparse,array,xcolor}
\NewDocumentCommand{\avsplus}{}{$+$}
\NewDocumentCommand{\avsminus}{}{$-$}
\NewDocumentCommand{\avsto}{}{\unskip${}\to{}$\ignorespaces}
\newenvironment{avs}[1][l]
{$\left\lbrack\renewcommand{\arraystretch}{1.2}%
\begin{tabular}{@{}>{\scshape}l@{${}:{}$}#1@{}}}
{\end{tabular}\right\rbrack$}
\ExplSyntaxOn
\NewDocumentCommand{\avsline}{O{}mm}
{
\keys_set:nn { rafael/avs } { color=black,#1 }
\color{\g_rafael_avs_linecolor_tl} #2 &
\color{\g_rafael_avs_linecolor_tl} #3 \\
}
\keys_define:nn { rafael/avs }
{
color .tl_gset:N = \g_rafael_avs_linecolor_tl,
}
\ExplSyntaxOff
\begin{document}
\begin{center}
\begin{avs}
\avsline{place}{dental}
\avsline{manner}{fricative}
\avsline{voice}{\avsplus}
\end{avs}
\end{center}
\begin{center}
\begin{avs}[r]
\avsline[color=red]{consonantal}{\avsplus}
\avsline[color=red]{voice}{\avsplus}
\avsline{place}{\textit{bilabial}}
\avsline{manner}{\textit{stop}}
\end{avs}
\avsto
\begin{avs}[r]
\avsline[color=blue]{consonantal}{\avsplus}
\avsline[color=blue]{voice}{\avsminus}
\avsline{place}{\textit{bilabial}}
\avsline{manner}{\textit{stop}}
\end{avs}
\end{center}
\end{document}
答案2
使用 amsmath 套件並嘗試以下操作:
\begin{equation}
\left[ \begin{array}{lcl}
\mathrm{PLACE} &:& \mathrm{dental}\\
\mathrm{PLACE} &:& \mathrm{dental}\\
\mathrm{MANNER} &:& \mathrm{fricative}\\
\mathrm{VOICE} &:& +
\end{array}\right]
\qquad
\left[\begin{array}{lcl}
\mathrm{PLACE} &:&\mathrm{dental}\\
\mathrm{PLACE} &:&\mathrm{uvular}\\
\mathrm{VOICE} &: &+\end{array}\right]
\end{equation}
如果您需要粗體,請將 mathrm 替換為 mathbf!
答案3
\documentclass{article}
\usepackage{array}
\newcolumntype{I}{!{:}}
\begin{document}
\begin{equation}
\left[\begin{tabular}{lIl}
PLACE & dental \\
PLACE & dental \\
MANNER & fricative \\
VOICE & + \\
\end{tabular}\right]
\quad
\left[\begin{tabular}{lIl}
PLACE & dental \\
PLACE & uvular \\
VOICE & + \\
\end{tabular}\right]
\end{equation}
\begin{equation}
\left[\begin{tabular}{lIl}
CONSONANTAL & + \\
VOICE & + \\
\end{tabular}\right]
\rightarrow
\left[\begin{tabular}{lIl}
CONSONANTAL & dental \\
VOICE & - \\
\end{tabular}\right] / \_ \#
\end{equation}
\end{document}