テキストと数式を同じ行に書く Beamer

テキストと数式を同じ行に書く Beamer

私は、方程式の周りのボックスと色が好きでした。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} 

ここに画像の説明を入力してください

関連情報