我想将内联方程式对齐到文本的右侧
\documentclass[12pt, A4]{article}
\begin{document}
Text: $a+b=c$
Longer Text: $x+y=z$
\end{document}
我可以使用哪个环境来执行此操作?
答案1
您可以使用tabular
取决于您的文本的长度,您可以使用l
或p
作为您的第一列,我在这里显示两者
%\documentclass[12pt, A4]{article} article has no A4 option
\documentclass[12pt, a4paper]{article}
\usepackage{array}
\begin{document}
\begin{flushleft}
\begin{tabular}{@{}ll}
Text: & $a+b=c$\\
Longer Text:& $x+y=z$
\end{tabular}
\end{flushleft}
\begin{flushleft}
\begin{tabular}{@{}ll}
Text: & $a+b=c$\\
Longer Text:& $x+y=z$ \\
Much much much longer Text Text Text Text:& $w+x+y=z$
\end{tabular}
\end{flushleft}
\begin{flushleft}
\begin{tabular}{@{}>{\raggedright}p{7cm}l}
Text: & $a+b=c$\\
Longer Text:& $x+y=z$ \\
Much much much longer Text Text Text Text:& $w+x+y=z$
\end{tabular}
\end{flushleft}
\end{document}