Can I make this in LateX? I want do group numbers with these lines. Can someone help me, please?
Asked
Active
Viewed 2,438 times
5
3 Answers
19
It is very simple with pstricks – more precisely with pst-node:
\documentclass{article}
\usepackage{mathtools}
\usepackage{pst-node}
\usepackage{auto-pst-pdf}
\begin{document}
\[ \rnode{X1}{x^2}y + \rnode{XY}{3xy} + \rnode{X2}{2x} + \rnode{C}{6} \]%
\ncbar[nodesep=0.5ex, arm=1.5ex, angle=-90]{X1}{X2}
\ncbar[nodesepB=0.5ex, angle=-90]{XY}{C}
\end{document}
Bernard
- 271,350
10
With tikzmark:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{tikzmark}
\begin{document}
\[
\tikzmarknode{A}{x}^2 y
+ 3\tikzmarknode{B}{x}y + 2\tikzmarknode{C}{x} + \tikzmarknode{D}{6}
%
\begin{tikzpicture}[overlay, remember picture,
every path/.style = {shorten <=1pt,shorten >=1pt}
]
\draw (A.south) -- ++ (0,-0.2) -| (C);
\draw (B.south) -- ++ (0,-0.4) -| (D);
\end{tikzpicture}
\]
\vspace{4mm} % space for tikzpicture
text text text text text text text text text text text text
\end{document}
After two compilation you will get:
Zarko
- 296,517
-
-
yes,
every path/.style = {shorten <=1pt,shorten >=1pt}.. I will add this to my answer asap. – Zarko Jan 12 '20 at 12:32
7
With simpler-wick and the below patch you could do
\documentclass[fleqn]{article}
\usepackage[sep=3pt,offset=0.5ex]{simpler-wick}
\newif\ifWickBelow
\WickBelowfalse
\pgfkeys{
/simplerwick/below/.code={\WickBelowtrue},
}
\makeatletter
\def\swick@end#1#2{
\swick@setfalse@#1
\tikzexternaldisable
\begin{tikzpicture}[remember picture, baseline=(swick-close#1.base)]
\node[use as bounding box, inner sep=0pt, outer sep=0pt] (swick-close#1) {$\displaystyle #2$};
\end{tikzpicture}
\tikz[remember picture, overlay]
{
\ifWickBelow
\draw ($(swick-open#1.south) + (0, -3pt)$)
-- ($(swick-open#1.base) + (0, -\swick@offset) + #1*(0, -\swick@sep)$)
-- ($(swick-close#1.base) + (0, -\swick@offset) + #1*(0, -\swick@sep)$)
-- ($(swick-close#1.south) + (0, -3pt)$);
\else
\draw ($(swick-open#1.north) + (0, 3pt)$)
-- ($(swick-open#1.base) + (0, \swick@offset) + #1*(0, \swick@sep)$)
-- ($(swick-close#1.base) + (0, \swick@offset) + #1*(0, \swick@sep)$)
-- ($(swick-close#1.north) + (0, 3pt)$);
\fi}
\tikzexternalenable}
\makeatother
\begin{document}
\[\wick[below]{x\c1{\widehat{~}}2 y+3\c2xy+2\c1 x+\c26}\]
\end{document}
There are several alternative ways of doing the Wick contractions, see e.g. here.
-
Peraphs the user has taken an image where must be
x²instead ofx^2. However very good. – Sebastiano Jan 11 '20 at 15:57 -
4@Sebastiano Mille grazie. Yes, I also wasn't sure what the OP wants precisely. This is the usual problem in questions without an MWE. – Jan 11 '20 at 15:59



simpler-wickor another package for Wick contractions. – Jan 11 '20 at 15:34