So schalten Sie \phantom für ein gesamtes Dokument vor dem Kompilieren ein/aus

So schalten Sie \phantom für ein gesamtes Dokument vor dem Kompilieren ein/aus

Ich möchte einen Cloze mit vielen Formeln und vielen phantomLeerzeichen erstellen. Aber am Ende brauche ich zwei Versionen, eine mit Leerzeichen und eine ohne. Alles manuell zu löschen phantomist keine Lösung. Gibt es eine Möglichkeit, alle Phantombefehle beizubehalten, aber die Phantomfunktion (für ein ganzes Dokument) beim Kompilieren zu deaktivieren? Mit anderen Worten, eine Möglichkeit, Phantom für verschiedene Kompilierungen ein-/auszuschalten?

\documentclass{article}

\usepackage{amsmath}                    

\begin{document}

    \begin{align*}
        L(\lambda, x_1, x_2) &= U (x_1, x_2) - \lambda ( \phantom{p_1 x_1 + p_2 x_2 - m} ) \\
        \frac{\partial L}{\partial x_1} &= \frac{ \partial u}{\partial x_1} - \lambda p_1 \stackrel{!}{=} 0 \Rightarrow \phantom { \lambda = \frac{ 1}{p_1} \frac{ \partial u}{\partial x_1} } \tag{I} \\
        \frac{\partial L}{\partial x_2} &= \frac{ \partial u}{\partial x_2} - \lambda p_2 \stackrel{!}{=} 0 \Rightarrow \lambda = \frac{ 1}{p_2} \frac{ \partial u}{\partial x_2} \tag{II} \\
        \frac{\partial L }{\partial \lambda} &= - p_1 x_1 - p_2 x_2 + m \stackrel{!}{=} 0 \tag{III} \\
        \frac{ 1}{p_1} \frac{ \partial u}{\partial x_1} &= \frac{ 1}{p_2} \frac{ \partial u}{\partial x_2} \\
        \frac{ \frac{ \partial u}{\partial x_1}}{\frac{ \partial u}{\partial x_2}} &= \phantom { \frac{ p_1}{p_2}}
    \end{align*}


\end{document}

Bildbeschreibung hier eingeben

verwandte Informationen