Wikiversity:Semantic templates/Mathematical templates/Latex

\newcommand{\N} {{\mathbb N}} \newcommand{\Z} {{\mathbb Z}} \newcommand{\Q} {{\mathbb Q}} \newcommand{\R} {{\mathbb R}} \newcommand{\C} {{\mathbb C}} \newcommand{\Complex} {{\mathbb C}}


\newcommand{\defeq}{:=}

\newcommand{\defeqr}{=:}


\newcommand{\tensor}{\otimes}


\newcommand{\mathmap}[4]{${\ifthenelse {\equal {#1}{} } {} {#1 \colon }}\, #2 \rightarrow #3 #4 $}

\newcommand{\mathmapelement}[6]{$ {\ifthenelse {\equal {#1}{} } {} {#1 \colon }}\, #2 \rightarrow #3 , \, #4 \mapsto #5 #6 $}

\newcommand{\mathmapdisplay}[4]{\[ {\ifthenelse {\equal {#1}{} } {} {#1 \colon }}\, #2 \longrightarrow #3 #4 \]}

\newcommand{\mathmapelementdisplay}[6]{\[ {\ifthenelse {\equal {#1}{} } {} {#1 \colon }}\, #2 \longrightarrow #3 , \, #4 \longmapsto #5 #6 \]}


%Variant in case of ifequal-problem

\newcommand{\mathmapnamedisplay}[4]{\[ #1 \colon \, #2 \longrightarrow #3 #4 \]}

\newcommand{\mathmapelementdisplayvar}[6]{\[ {\ifthenelse {\equal {#1}{} } {} {#1 \colon }}\, #2 \longrightarrow #3 , \, #4 \longmapsto #5 #6 \]}