3

When using a calculator in my school, we have to note it in a specific way. It‘s called the MaGGI-concept, which is made up of four pieces: Mathematical idea, Graphic calculator input, Graphic calculator output, and Interpretation. What‘s special about it, is the intentation. Both Gs have to be offset by „one tab“.

enter image description here

I tried to build something like this with the enumerate package, but I couldn’t get it to work. How can I make a custom macro for this?

For example:

\begin{maggi}
\ma LOREM
\g IPSUM
\g DOLOR
\i SIT
\end{maggi}
5

You could use \@hangfrom, you couldn't use a \par token (or two consecutive new lines) inside this environment this way.

Also you might want to change the definition of \maggicmd (or don't use it at all) if you want to.

\documentclass[]{article}

\usepackage{amsmath}

\makeatletter
\newlength\maggi@indent
\setlength\maggi@indent{1cm}
\newcommand*\MAggi{\PackageError{maggi}{Don't use me outside of the maggi environment}{}}
\newcommand*\maGgi{\PackageError{maggi}{Don't use me outside of the maggi environment}{}}
\newcommand*\magGi{\PackageError{maggi}{Don't use me outside of the maggi environment}{}}
\newcommand*\maggI{\PackageError{maggi}{Don't use me outside of the maggi environment}{}}
\newenvironment{maggi}
  {%
    \def\MAggi{\par\bigskip\@hangfrom{\makebox[\maggi@indent][l]{Ma:}}}%
    \def\maGgi{\par\medskip\@hangfrom{\kern\maggi@indent\makebox[\maggi@indent][l]{G:}}}%
    \let\magGi\maGgi
    \def\maggI{\par\medskip\@hangfrom{\makebox[\maggi@indent][l]{I:}}}%
  }
  {%
    \par\bigskip
    % the following will supress paragraph indentation if you don't put an empty
    % line after \end{maggi}
    \@endpetrue
  }
\makeatother
\newcommand\maggicmd[1]{\operatorname{\mathsf{\MakeUppercase{#1}}}}

\usepackage{duckuments}

\begin{document}
\blindduck[-]
\begin{maggi}
  \MAggi I want to find the intersection between $f$ and $g$
  \maGgi $Y_1 = x^2$\\
         $Y_2 = 4$\\
         $\maggicmd{intersect}(Y_1, Y_2, \text{Guess next to }-2)$\\
         $\maggicmd{intersect}(Y_1, Y_2, \text{Guess next to }2)$
  \magGi $(-2|4)$\\
         $(2|4)$
  \maggI The graphs of $f$ and $g$ have two intersections. One in $(-2|4)$ and
         one in $(2|4)$.
\end{maggi}
\blindduck[-]
\end{document}

enter image description here

2
  • 1
    I became an environment!
    – CarLaTeX
    Sep 26 at 13:01
  • Works like a charm! Thank you very much!
    – timlwsk
    Sep 26 at 19:53

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.