3
      \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}

enter image description here

I want to make the two equations in the same line

4

Use 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}

enter image description here

I used to be fond of this function notation, but then I started to dislike it: it's heavy, uses up space and doesn't really do anything good. On the blackboard it can be useful, not in papers.

  • Thanks a lot. So what is the best way to define a function? – Schüler Mar 3 '19 at 14:23
  • @Schüler I tend to use the inline form, but that's personal preference. – egreg Mar 3 '19 at 14:24
2

Using aligned you can do the job in inline math mode. I suppose you would like the result centered, so, I placed the code in a center environment and finally, I added some \hspace commands for better spacing:

 \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}

enter image description here

2

Something like one of these?

\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} 

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.