I am new to latex and I am having trouble typing the function range before I define the function. So I am trying to define a piecewise function, and how would I have something like this?
Asked
Active
Viewed 1,107 times
1 Answers
2
Thanks, Mico!
\documentclass{article}
\usepackage{amsmath,amssymb}
\begin{document}
$f\colon\mathbb{Z}\to\mathbb{N}$ is more correct than
$f\colon\mathbb{Z}\mapsto\mathbb{N}$.
\begin{align}
f\colon\mathbb{Z}&\to\mathbb{N}\notag\\
n&\mapsto \left( n\mod 3\right)^2
\end{align}
\end{document}
-
Please change all three instances of
:to\colon. (The former is a relational operator.) – Mico Jan 26 '18 at 05:30 -

$f:\mathbb{N}\mapsto\mathbb{N}$, but you should really use\toinstead of\mapstohere. – Jan 26 '18 at 04:59\usepackage{amssymb}to your preamble – koleygr Jan 26 '18 at 05:04