数学环境中的 innermargin 不起作用

数学环境中的 innermargin 不起作用

我无法让innermargin(left and right)命令正常工作。方程式可能不允许它工作。但是,它可以很好地处理简单的文本(在代码中取消注释即可看到)。所以,我的问题是,我如何在数学模式下使用该命令。

这是我的代码:

\documentclass[12pt]{article}
\usepackage[fleqn]{amsmath}
\usepackage{mathtools,lipsum}
\usepackage{enumitem,physics,xcolor}
\usepackage[framemethod=tikz]{mdframed}
\newcommand{\tani}{\mathrm{tan^{-1}}}
\newcommand{\nonitalic}[1]{\mathrm{#1}}
%the command in upper line can be replaced by the following command
%\newcommand{\nit}{\mathrm{d}x}
\setlist[enumerate,1]{leftmargin=.9cm}
\newcommand{\s}{\hspace{2pt}=\hspace{2pt}}
\begin{document}
\section*{Basic Integrals}
\mdfdefinestyle{MyFrame}{
    linecolor=red,
    linewidth=5,
    innerlinecolor=white,
    innerlinewidth=4,
    topline=false,
    bottomline=false,
    innerrightmargin=.5cm,
    innerleftmargin=.1cm,
    rightmargin=4cm,
    leftmargin=.1cm,
    backgroundcolor=yellow!50!white,
    roundcorner=20pt}
\begin{mdframed}[style=MyFrame]
\begin{enumerate}
\item 
    $\begin{aligned}
    \int \frac{1}{x^2+a^2}  \nonitalic{d}x  
    %\nit 
    \s \frac{1}{a} \tani(\frac{x}{a}) + \text{C}
    \end{aligned}$
\item
    $\begin{aligned}
    \int \frac{1}{x^2-a^2} \nonitalic{d}x \s \frac{1}{2a} \log \abs{\frac{x-a}{x+a}}  + 
    \text{C}
    \end{aligned}$
\item
    $\begin{aligned}
    \int \frac{1}{a^2-x^2} \nonitalic{d}x \s \frac{1}{2a} \log \abs{\frac{a+x}{a-x}}  + 
    \text{C}
    \end{aligned}$
\end{enumerate}
\end{mdframed}
\iffalse
\mdfdefinestyle{MyFrame}{
    linecolor=red,
    linewidth=5,
    innerlinecolor=white,
    innerlinewidth=4,
    topline=false,
    bottomline=false,
    innerrightmargin=1cm,
    innerleftmargin=1cm,
    skipabove=.8cm,
    rightmargin=.4cm,
    leftmargin=.1cm,
    backgroundcolor=yellow!50!white,
    roundcorner=20pt}
\begin{mdframed}[style=MyFrame,align=left]
\lipsum
\end{mdframed}
\fi
\end{document}

输出:

实现的代码图片

相关内容