아래와 같이 라텍스 출력을 생성하려고합니다.
그러나 유형이 제대로 정렬되지 않습니다. 이전 어레이 환경을 구독하고 있는 것으로 보입니다. 오류를 지적해 주실 수 있나요?
내 코드는 다음과 같습니다 -
\documentclass{article}
\usepackage{amssymb,amsmath}
\def \R {\mathbb{R}}
\begin{document}
\begin{equation}
M_2=\left\{
\begin{array}{r}
variables : \left\{ \begin{array}{r}
inputs : x \\
outputs : y
\end{array}
\right.\\
types : x,y \in \R \\
behaviors : y = e^x \\
\end{array}
\right.
\end{equation}
\end{document}
답변1
필요한 것은 다음과 같습니다.
\documentclass{article}
\usepackage{amssymb,amsmath}
\def\R{\mathbb{R}}
\begin{document}
\begin{equation}
M_2=\left\{
\begin{array}{rl}
\text{variables :} & \left\{
\begin{array}{r}
\text{inputs :} x \\
\text{outputs :} y
\end{array}
\right.\\
\text{types :} & x,y \in \R \\
\text{behaviors :} & y = e^x \\
\end{array}
\right.
\end{equation}
\end{document}
출력은 다음과 같습니다.
환경 과 마찬가지로 tabular
에서 여러 열을 정의 array
하고 로 구분할 수 있습니다 &
.
\text{}
또한 로마자로 조판하기 위해 일부 텍스트를 넣을 수도 있습니다 .
답변2
여기서는 다음을 사용합니다 cases
.
% arara: pdflatex
\documentclass{article}
\usepackage{amssymb,mathtools}
\newcommand*\R{\mathbb{R}}
\begin{document}
\begin{equation}
M_2 = \begin{cases}
\text{variables:} &\begin{cases}
\text{inputs:} &x\\
\text{outputs:} &y
\end{cases}\\
\text{types:} &x,y \in \R\\
\text{behaviors:} &y = e^x
\end{cases}
\end{equation}
\end{document}