
두 가지 다른 환경에 두 개의 방정식 세트가 있습니다. 나는 둘 다에 몇 가지 방정식을 색칠하고 싶습니다. 가능합니까?
MWE
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[width=1.00cm, height=1.00cm, left=1.00cm, right=1.00cm, top=1.00cm, bottom=1.00cm]{geometry}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{mathtools}
\usepackage{amsthm}
\usepackage{xcolor}
\begin{document}
\begin{flalign*}
L(1)&=\int\limits_{0}^{\infty} e^{-st}\cdot 1 \;dt&\\[8pt]
&=\left[\frac{e^{-st}}{-s}\right]_0^\infty&\\[8pt]
&=\dfrac{-1}{s}\left[e^{-st}\right]_{0}^{\infty}&\\[8pt]
&=\dfrac{-1}{s}\left[e^{-\infty}-e^{0}\right]&\\[8pt]
&=\dfrac{-1}{s}\left[0-1\right]&\\[8pt]
&=\frac{1}{s}&
\end{flalign*}
\begin{flalign*}
L(1)&=\int\limits_{0}^{\infty} e^{-st}\cdot 1 \;dt\\[8pt]
&=\left[\frac{e^{-st}}{-s}\right]_0^\infty\\[8pt]
&=\dfrac{-1}{s}\left[e^{-st}\right]_{0}^{\infty}\\[8pt]
&=\dfrac{-1}{s}\left[e^{-\infty}-e^{0}\right]\\[8pt]
&=\dfrac{-1}{s}\left[0-1\right]\\[8pt]
&=\frac{1}{s}
\end{flalign*}
\end{document}
답변1
색칠하고 싶다면모든 행빨간색 환경에서는 바로 앞에 및 (또는 기본값인 모든 색상) 바로 뒤에 flalign*
삽입하면 됩니다 .\color{red}
\begin{flalign*}
\color{black}
\end{flalign*
몇 행만 빨간색으로 색칠하고 싶다면 \mathcolor{red}{...}
해당 행에 사용하는 것이 좋습니다.
\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage{mathtools,xcolor}
\begin{document}
\addtolength{\jot}{8pt}% just for this example
\color{red}
\begin{align*}
L(1)&=\int_0^{\infty} e^{-st}\cdot 1 \, dt \\
&=\frac{1}{s}\,.
\end{align*}
\color{black}
\begin{align*}
L(1)&=\int_0^{\infty} e^{-st}\cdot 1 \, dt \\
&=\left[\frac{e^{-st}}{-s}\right]_0^\infty \\
&\mathcolor{red}{%
=\frac{-1}{s}\bigl[e^{-st}\bigr]_0^{\infty}} \\
&=\frac{-1}{s}[e^{-\infty}-e^{0}] \\
&\mathcolor{red}{=\frac{-1}{s}[0-1]} \\
&=\frac{1}{s}\,.
\end{align*}
\end{document}