
\documentclass[12pt,a4paper]{report}
\usepackage{mathtools, nccmath}
\usepackage{amssymb, amsthm, mathrsfs}
\begin{document}
\begin{align*}
h\colon S(0,1)& \rightarrow S^A(0,1)\\
x&\mapsto \frac{x}{\|x\|_A},
\end{align*}
and
\begin{align*}
g\colon S^A(0,1)& \rightarrow S(0,1)\\
y&\mapsto \frac{y}{\|y\|},
\end{align*}
\end{document}
我想讓這兩個方程式在同一行
答案1
使用aligned
:
\documentclass[12pt,a4paper]{report}
\usepackage{mathtools}
\begin{document}
\begin{equation*}
\begin{aligned}[t]
h\colon S(0,1) &\rightarrow S^A(0,1)\\
x &\mapsto \frac{x}{\|x\|_A},
\end{aligned}
\quad\text{and}\quad
\begin{aligned}[t]
g\colon S^A(0,1) &\rightarrow S(0,1)\\
y &\mapsto \frac{y}{\|y\|},
\end{aligned}
\end{equation*}
\end{document}
我曾經很喜歡這種函數表示法,但後來我開始不喜歡它:它很重,佔空間,而且沒有什麼好處。在黑板上它可能有用,但在紙上則不然。
答案2
使用你可以在數學模式aligned
下完成這項工作。inline
我想您希望結果居中,因此,我將程式碼放置在center
環境中,最後,我添加了一些\hspace
命令以獲得更好的間距:
\documentclass[12pt,a4paper]{report}
\usepackage{mathtools, nccmath}
\usepackage{amssymb, amsthm, mathrsfs}
\begin{document}
\begin{center}
\(\begin{aligned}
h\colon S(0,1)& \rightarrow S^A(0,1)\\
x&\mapsto \frac{x}{\|x\|_A},
\end{aligned}
\hspace{20pt}\text{ and }\hspace{20pt}
\begin{aligned}
g\colon S^A(0,1)& \rightarrow S(0,1)\\
y&\mapsto \frac{y}{\|y\|},
\end{aligned}\)
\end{center}
\end{document}
答案3
像其中之一嗎?
\documentclass[12pt,a4paper]{report}
\usepackage{mathtools, nccmath}
\usepackage{amssymb, amsthm, mathrsfs}
\begin{document}
\[ \begin{aligned}
h\colon S(0,1)& \longrightarrow S^A(0,1)\\
x&\longmapsto \frac{x}{\|x\|_A},
\end{aligned}
\qquad\text{ and }\qquad
\begin{aligned}
g\colon S^A(0,1)& \longrightarrow S(0,1)\\
y&\longmapsto \frac{y}{\|y\|},
\end{aligned} \]\bigskip
\[ \begin{rcases} \begin{aligned}
h\colon S(0,1)& \longrightarrow S^A(0,1)\\
x&\longmapsto \frac{x}{\|x\|_A},
\end{aligned}\end{rcases}
\quad\text{ and }\quad
\begin{dcases} \begin{aligned}
g\colon S^A(0,1)& \longrightarrow S(0,1)\\
y&\longmapsto \frac{y}{\|y\|},
\end{aligned}\end{dcases} \]
\end{document}