我想修改下图中的两个公式。你能帮我吗?
\documentclass[a4paper,12pt]{article}[12pt]
\usepackage[italian]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{anysize}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{mathrsfs}
\usepackage{textcomp}
\linespread{1.5}
\frenchspacing
\newcommand{\abs}[1]{\lvert#1\rvert}
\usepackage{floatflt,epsfig}
\usepackage{multicol}
\usepackage[a4paper,top=1.0cm,bottom=1.0cm,left=1.0cm,right=1.0cm]{geometry}
\begin{document}
$ a^2 = 16 \rightarrow a = \pm 4 = $
\newpage
$ x \cdot \left( x+3\right) = 0 \rightarrow $
\end{document}
答案1
以下是如何使用pstricks
和mathtools
(对于\underbracket
命令)执行此操作。
无关:epsfig
已经过时 20 多年了,应该用 代替graphicx
。此外,从 3.10 版开始, 的语言选项babel
应该与文档类一起加载,因此语言相关的包应该知道文档的语言。
\documentclass[a4paper,12pt, italian, svgnames]{article}[12pt]
\usepackage{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{anysize}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{mathrsfs}
\usepackage{textcomp}
\usepackage{mathtools}
\usepackage{pst-node}
\usepackage{auto-pst-pdf} %% to compile with pdflatex --enable-write18 (MiKTeX) or pdflatex --shell-escape (TeX Live, MacTeX))
\newcommand\mathpnode[1]{\pnode[0,\fontdimen22\textfont2]{#1}}
\linespread{1.5}
\frenchspacing
\DeclarePairedDelimiter{\abs}{\lvert}{\rvert}
\usepackage{floatflt}%
\usepackage{multicol}
\usepackage[a4paper, margin=1.0cm]{geometry}
\begin{document}
\begin{pspicture}
$ a^2 = 16 \rightarrow a = \pm 4 = \mathpnode{M}\qquad\begin{aligned}
\mathpnode{R1} & \mathbf{ + 4} \\[1ex]
\mathpnode{R2} & \mathbf{ - 4}
\psset{nodesep = 3pt}
\ncline{M}{R1}
\ncline{M}{R2}
\end{aligned} $
\end{pspicture}
\bigskip
$\psset{fillstyle = solid} \underbracket[0.8pt]{\,x\vphantom{)}\,}_{{\substack{\vert\\\pscirclebox[fillcolor = BlanchedAlmond]{1}}}}\! \cdot \underbracket[1pt]{( x+3) }_{\substack{\vert\\\pscirclebox[fillcolor = Aqua!40]{2}}}= 0 \rightarrow \quad\begin{aligned}
& \raisebox{-0.3\height}{\pscirclebox[fillcolor = BlanchedAlmond]{1}}\quad\mathbf{x = 0}
\\[1ex]
& \raisebox{-0.3\height}{\pscirclebox[fillcolor = Aqua!40]{2}}\quad\mathbf{x + 3\rightarrow x = -3}
\end{aligned}$
\end{document}