LaTeX(TeXpad)上不显示颜色

LaTeX(TeXpad)上不显示颜色

我尝试在 TeXpad(iPad 上的 LaTeX 应用程序)上对方程式的各个部分进行颜色编码,但出于某种原因,方程式中所需的部分没有显示颜色。以下是代码:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[letterpaper, portrait, margin=0.5in]{geometry} 
\usepackage{multicol}
\usepackage{ dsfont }
\usepackage{ mathrsfs }
\usepackage{amssymb, graphicx}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{float}
\usepackage{enumitem}
\usepackage{amsfonts, bm}
\usepackage{diagbox}
\usepackage[makeroom]{cancel}
\usepackage{pgfplots}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows}
\usepackage{verbatim}
\usepackage[american,siunitx]{circuitikz}
\usepackage[export]{adjustbox}
\usepackage{mathtools}
\DeclarePairedDelimiter\ceil{\lceil}{\rceil}
\DeclarePairedDelimiter\floor{\lfloor}{\rfloor}
\DeclarePairedDelimiter\norm{\lvert}{\rvert}
\usepackage{units}
\usepackage{relsize}
\usepackage{xcolor}
\let\DeclareUSUnit\DeclareSIUnit
\let\US\SI
\DeclareUSUnit\mile{mi}
\usepackage{optidef}
\begin{document}
\begin{multicols*}{2}
\noindent
PM: $J = \phi\left(\mathbf{x}\left(t_f\right),t_f\right) + \int_{t_0}^{t_f}\mathcal{L}\left(\mathbf{x},\mathbf{u},t\right)dt$ \newline
General problem: $\min J = \textcolor{red}{\phi\left(\mathbf{x}\left(t_f\right)\right)} + \int_{t_0}^{t_f}\mathcal{L}\left(\mathbf{x},\mathbf{u},t\right)dt $
    \begin{mini*}|s|
            {\substack{\mathbf{x},\mathbf{u}}}{J = \phi\left(\mathbf{x}\left(t_f\right),t_f\right) + \int_{t_0}^{t_f}\mathcal{L}\left(\mathbf{x},\mathbf{u},t\right)dt}{}{}
            \addConstraint{\dot{\mathbf{x}} =}{\mathbf{f}\left(\mathbf{x},\mathbf{u},t\right)}
            \addConstraint{\mathbf{x}\left(0\right)}{= \mathbf{x}_0,}{\quad\text{(Initial condition)}}
            \addConstraint{\Psi\left(\mathbf{x}_f,t_f\right) }{= 0,} {\quad\text{(Terminal constraints)}}
    \end{mini*}
\end{multicols*}
\end{document} `

以下是我得到的结果:

在此处输入图片描述

有人能解释一下 TeXpad 或代码本身发生了什么吗?

相关内容