# How to change these formulas?

I would like to modify 2 of formulas like the figure below. Could you help me?

\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}

\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}


Here is how to do it with pstricks and mathtools (for the \underbracket command).

Unrelated: the epsfighas been obsolete for more than 20 years, and should be replaced with graphicx. Also, since version 3.10 the language options of babel should be loaded with the document class, so language-dependent packages be aware of the language of the document.

\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}}

\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}


• thank you for your answer! How can I enable "shell escape" (or "write18") in order to run the code? thanks a lot.
– ryuk
Feb 11 '18 at 21:17
• @ryuk: What are your distribution and editor? Feb 11 '18 at 21:22
• Sure. Go to the Options -> Configure TeXmaker menu; click on the Commands icon (it should be opened by default) and in the second line (for pdflatex), type pdflatex -synctex=1 -shell-escape -interaction=nonstopmode %.tex and validate. ( I guess it works the same way for all platforms). Feb 11 '18 at 21:55
• I guess this is because the two groups are in different paragraphs (there's a blank line). Doy you want to group the groups ;o) ? Feb 11 '18 at 22:44
• @ryuk: I'll try to see that tomorrow to find a solution – I also have problems with standalone and these two equations grouped. Feb 11 '18 at 23:31