5

Can I make this in LateX? I want do group numbers with these lines. Can someone help me, please?enter image description here

Alan Munn
  • 218,180
Footy
  • 75
  • 4
    Please clarify what you're trying to achieve. E.g., do you wish to replicate the math font shown in the screenshot? Are you looking for advice on how to typeset a math formula? Are the lines below the formula of interest? Some or all of the above? Please be specific. – Mico Jan 11 '20 at 15:31
  • 1
    I made a mistake, so I updated it. – Footy Jan 11 '20 at 15:33
  • 2
    You can use simpler-wick or another package for Wick contractions. –  Jan 11 '20 at 15:34
  • 1
    And what do I need to do then? – Footy Jan 11 '20 at 15:36

3 Answers3

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} 

enter image description here

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:

enter image description here

Zarko
  • 296,517
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}

enter image description here

There are several alternative ways of doing the Wick contractions, see e.g. here.

  • Peraphs the user has taken an image where must be instead of x^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