我喜欢方程式周围的方框和颜色,它通过使用empheq
我想保留该字符,但能够在同一行上写文本+公式。
\documentclass[10pt,a4paper]{beamer}
\usepackage[utf8]{inputenc}
\usepackage{empheq}
\definecolor{myblue}{rgb}{.8, .8, 1}
\newcommand*\mybluebox[1]{%
\colorbox{myblue}{\hspace{1em}#1\hspace{1em}}}
\usetheme{Warsaw}
\begin{document}
\begin{frame}
the equation of the tangent line is \begin{empheq}[box=\mybluebox]{align*}
y=f^{'}(x_0)(x-x_{0})+f(x_{0})
\end{empheq}
\end{frame}
\end{document}
生成以下图像:
答案1
flalign*`` environment and a small patch for the
您可以使用\Aboxed` 命令获取它:
\documentclass[10pt, a4paper]{beamer}
\usepackage[utf8]{inputenc}
\usepackage{empheq}
\definecolor{myblue}{rgb}{.8, .8, 1}
\newcommand*\mybluebox[1]{%
\colorbox{myblue}{\hspace{1em}#1\hspace{1em}}}
\usetheme{Warsaw}
\usepackage{xpatch}
\makeatletter
\newcommand{\colorboxed}[1]{\colorbox{myblue}{\m@th$\displaystyle#1$}}
\xpatchcmd{\@Aboxed}{\boxed}{\colorboxed}{}{}
\makeatother
\begin{document}
\begin{frame}
\begin{flalign*}
& \text{the equation of the tangent line is} &\Aboxed{\quad y & =f’(x_0)(x-x_{0})+f(x_{0})\quad} &
\end{flalign*}
\end{frame}
\end{document}