I would like to define a document, in which I define variables at the beginning of the document and use them in the document to define, from which parts of the code, the pdf is created.
This is the code and I write in * * , how I would do it in python.
\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{amssymb}
\title{A test file}
\begin{document}
\maketitle
*Show_first_line = True*
*Show_second_line = False*
\section{Density functional theory}
*if Show_first_line == True: #Now the following formula should be compiled*
$$
i \hbar \frac{\partial \Phi(\mathbf{r}, \mathbf{R} ; t)}{\partial t}=\left(-\frac{\hbar^{2}}{2 M} \frac{\partial^{2}}{\partial \mathbf{R}^{2}}-\frac{\hbar^{2}}{2 m} \frac{\partial^{2}}{\partial \mathbf{r}^{2}}+V(\mathbf{r}, \mathbf{R})\right) \Phi(\mathbf{r}, \mathbf{R} ; t)
$$
*else:*
$$
i \hbar \frac{\partial \Phi(\mathbf{r}, \mathbf{R} ; t)}{\partial t}=\left( -\frac{\hbar^{2}}{2 m} \frac{\partial^{2}}{\partial \mathbf{r}^{2}}+V(\mathbf{r}, \mathbf{R})\right) \Phi(\mathbf{r}, \mathbf{R} ; t)
$$
*if Show_second_line == True # In case it is false, nothing should be compiled*
$$
\mathrm{M} \gg \mathrm{m} \text { the Born-Oppenheimer approximation }
$$
$$
i \hbar \frac{\partial \Phi(\mathbf{r}, \mathbf{R} ; t)}{\partial t}=
\left( -\frac{\hbar^{2}}{2 m} \frac{\partial^{2}}{\partial \mathbf{r}^{2}}+V(\mathbf{r}, \mathbf{R})\right) \Phi(\mathbf{r}, \mathbf{R} ; t)
$$
$$
M \ddot{\mathbf{R}}=-\frac{\partial E(\mathbf{R})}{\partial \mathbf{R}} \\
\left(-\frac{\hbar^{2}}{2 m} \frac{\partial^{2}}{\partial \mathbf{r}^{2}}+V(\mathbf{r}, \mathbf{R})\right) \Psi(\mathbf{r} | \mathbf{R})=E(\mathbf{R}) \Psi(\mathbf{r} | \mathbf{R})
$$
\end{document}
