We will test out writing equations in RMD + revealjs
Here is some text that is in red, in between the b symbols mean put this text in bold but this text is not bold
This is smaller italisized text, font size 50 percent.
\[ \begin{equation} \label{eq:targetcost} Z\left(\tau,\delta\right) = \sum\limits_{ \substack{ \mathrm{cohort} \\ \in{\left\{70,72,74,76\right\}}} } \left\{\delta\cdot \int_{\epsilon} \int_{Y_{min}}^{F_{Y}^{-1}\left(\tau\right)} \int_{X} N\Big( \substack{ Y,X,\epsilon; \\ \delta, \Gamma_{\mathrm{cohort}} } \Big)f\left(X|Y\right)f\left(Y\right)f\left(\epsilon\right)\mathrm{d}X\mathrm{d}Y\mathrm{d}\epsilon\right\} \end{equation} \]
The paper latex file already contains various newcommands pre-defined, want to share those latex files with RMD.
Define long newcommand in RMD and show equation multiple times.
Equation defined as new command with different zoom:
\[ \begin{equation} Z\left(\tau,\delta\right) = \sum\limits_{ \substack{ \mathrm{cohort} \\ \in{\left\{70,72,74,76\right\}}} } \left\{\delta\cdot \int_{\epsilon} \int_{Y_{min}}^{F_{Y}^{-1}\left(\tau\right)} \int_{X} N\Big( \substack{ Y,X,\epsilon; \\ \delta, \Gamma_{\mathrm{cohort}} } \Big)f\left(X|Y\right)f\left(Y\right)f\left(\epsilon\right)\mathrm{d}X\mathrm{d}Y\mathrm{d}\epsilon\right\} \end{equation} \] \[ \begin{equation} Z\left(\tau,\delta\right) = \sum\limits_{ \substack{ \mathrm{cohort} \\ \in{\left\{70,72,74,76\right\}}} } \left\{\delta\cdot \int_{\epsilon} \int_{Y_{min}}^{F_{Y}^{-1}\left(\tau\right)} \int_{X} N\Big( \substack{ Y,X,\epsilon; \\ \delta, \Gamma_{\mathrm{cohort}} } \Big)f\left(X|Y\right)f\left(Y\right)f\left(\epsilon\right)\mathrm{d}X\mathrm{d}Y\mathrm{d}\epsilon\right\} \end{equation} \] \[ \begin{equation} Z\left(\tau,\delta\right) = \sum\limits_{ \substack{ \mathrm{cohort} \\ \in{\left\{70,72,74,76\right\}}} } \left\{\delta\cdot \int_{\epsilon} \int_{Y_{min}}^{F_{Y}^{-1}\left(\tau\right)} \int_{X} N\Big( \substack{ Y,X,\epsilon; \\ \delta, \Gamma_{\mathrm{cohort}} } \Big)f\left(X|Y\right)f\left(Y\right)f\left(\epsilon\right)\mathrm{d}X\mathrm{d}Y\mathrm{d}\epsilon\right\} \end{equation} \] \[ \begin{equation} Z\left(\tau,\delta\right) = \sum\limits_{ \substack{ \mathrm{cohort} \\ \in{\left\{70,72,74,76\right\}}} } \left\{\delta\cdot \int_{\epsilon} \int_{Y_{min}}^{F_{Y}^{-1}\left(\tau\right)} \int_{X} N\Big( \substack{ Y,X,\epsilon; \\ \delta, \Gamma_{\mathrm{cohort}} } \Big)f\left(X|Y\right)f\left(Y\right)f\left(\epsilon\right)\mathrm{d}X\mathrm{d}Y\mathrm{d}\epsilon\right\} \end{equation} \] \[ \begin{equation} Z\left(\tau,\delta\right) = \sum\limits_{ \substack{ \mathrm{cohort} \\ \in{\left\{70,72,74,76\right\}}} } \left\{\delta\cdot \int_{\epsilon} \int_{Y_{min}}^{F_{Y}^{-1}\left(\tau\right)} \int_{X} N\Big( \substack{ Y,X,\epsilon; \\ \delta, \Gamma_{\mathrm{cohort}} } \Big)f\left(X|Y\right)f\left(Y\right)f\left(\epsilon\right)\mathrm{d}X\mathrm{d}Y\mathrm{d}\epsilon\right\} \end{equation} \]
Reuse tex preamble from paper, load as child, and clean comments.
# This loads the tex preamble with predefined formula, reuseable symbols etc.
test_tex_define_out = knitr::knit_child('test_tex_define.tex')
# Delete all comment lines, which starts with percent, and end with carriage return
# This deletes all but the last line
test_tex_define_out = gsub("\\%.*?\\\n", "", test_tex_define_out)
# Delete last comment if on final line
test_tex_define_out = gsub("\\\n%.*","", test_tex_define_out)
\[\text{from external file: } \alpha + \beta\] \[\text{from external file: } \sigma_{i=1}^{N} X_i\] \[ \begin{equation} \text{EXTERNAL: } Z\left(\tau,\delta\right) = \sum\limits_{ \substack{ \mathrm{cohort} \\ \in{\left\{70,72,74,76\right\}}} } \left\{\delta\cdot \int_{\epsilon} \int_{Y_{min}}^{F_{Y}^{-1}\left(\tau\right)} \int_{X} N\Big( \substack{ Y,X,\epsilon; \\ \delta, \Gamma_{\mathrm{cohort}} } \Big)f\left(X|Y\right)f\left(Y\right)f\left(\epsilon\right)\mathrm{d}X\mathrm{d}Y\mathrm{d}\epsilon\right\} \end{equation} \]