% schulmathematik bundle: package schulma
% Version 1.1
% 13. März 2021
\RequirePackage{xparse}
\ProvidesExplPackage {schulma} {2021-03-13} {1.1} {Befehle für die Schulmathematik}

\RequirePackage[intlimits]{mathtools}
\RequirePackage{autoaligne}
\RequirePackage{icomma}
\RequirePackage{pgfplots}

\ExplSyntaxOff
\usetikzlibrary{shapes.misc}
\ExplSyntaxOn

\pgfplotsset
  {
    compat=newest,
    axis~lines=middle,
    label~style=
      {
        font=\small
      },
    ticklabel~style=
      {
        font=\footnotesize,
        /pgf/number~format/use~comma
      },
    tick~style={thick},
    every~axis~plot/.append~style=
      {
        semithick,
        scaled~ticks=false
      }
  }

\NewDocumentEnvironment {Kosy} {o}
  {
    \tl_set:Nn \l_tmpa_tl
      {
        xlabel={$x$},ylabel={$y$},
        minor~tick~num=1,minor~tick~length=0pt,
        grid=both
      }
    \begin{tikzpicture}
    \IfValueTF{#1}
      {
        \begin{axis}[\l_tmpa_tl,#1]
      }
      {
        \begin{axis}[\l_tmpa_tl]
      }
  }
  {
    \end{axis}
    \end{tikzpicture}
  }

\NewDocumentCommand \LGS {m}
  {
    \ensuremath
      {
        \left |
        \,
        \autoaligne {#1}
        \,
        \right |
      }
  }

\NewDocumentCommand \ehoch {m}
  {
    \mathrm{e}^{#1}
  }

\NewDocumentCommand \diff {m}
  {
    \mathrm{d}#1
  }

\NewDocumentCommand \Pkt {o m m}
  {
    \ensuremath
      {
        \IfValueT{#1}{#1}
        \mathopen{} % Zusatzabstand entfernen
        \left( {#2} \, \middle| \, {#3} \right)
      }
  }

\NewDocumentCommand \PktR {o m m m}
  {
    \ensuremath
      {
        \IfValueT{#1}{#1}
        \mathopen{} % Zusatzabstand entfernen
        \left( {#2} \, \middle| \, {#3} \, \middle| \, {#4} \right)
      }
  }

\NewDocumentCommand \Vek {m m m}
  {
    \ensuremath
      {
        \begin{pmatrix}
        #1 \\ #2 \\ #3
        \end{pmatrix}
      }
  }

\NewDocumentCommand \VekBr {m m m}
  {
    \ensuremath
      {
        \begin{pmatrix}
        #1 \\[0,5ex] #2 \\[0,5ex] #3
        \end{pmatrix}
      }
  }

\NewDocumentCommand \GTRY {mo}
  {
    \texttt { Y \textsubscript {#1} }
    \IfValueT {#2} { \texttt {=} \, \ensuremath {#2} }
  }

% Knotentyp zum Setzen von Kreuzen ins Koordinatensystem:
\tikzset
  {
    Kreuz/.style =
      {
        cross~out,
        draw,
        minimum~size = 5pt,
        inner~sep = 0pt,
        outer~sep = 0pt
      }
  }
