General ⇒ physics in LaTeX
physics in LaTeX
I'm new on this forum. I have a problem with special symbols in LaTeX. I need to use \overbracket command quite a lot (for physicists: contraction symbol in QFT) and usually the brackets are overlapping each other. Is there a simple way to do it? Maybe some other command that works similarly?
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
physics in LaTeX
Best regards
Thorsten¹
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
physics in LaTeX
Code: Select all
\makeatletter
\def\overbracket{\@ifnextchar [ {\@overbracket} {\@overbracket
[\@bracketheight]}}
\def\@overbracket[#1]{\@ifnextchar [ {\@over@bracket[#1]}
{\@over@bracket[#1][0.3em]}}
\def\@over@bracket[#1][#2]#3{%\message {Overbracket: #1,#2,#3}
\mathop {\vbox {\m@th \ialign {##\crcr \noalign {\kern 3\p@
\nointerlineskip }\downbracketfill {#1}{#2}
\crcr \noalign {\kern 3\p@ }
\crcr $\hfil \displaystyle {#3}\hfil $%
\crcr} }}\limits}
\def\downbracketfill#1#2{$\m@th \setbox \z@ \hbox {$\braceld$}
\edef\@bracketheight{\the\ht\z@}\downbracketend{#1}{#2}
\leaders \vrule \@height #1 \@depth \z@ \hfill
\leaders \vrule \@height #1 \@depth \z@ \hfill
\downbracketend{#1}{#2}$}
\def\downbracketend#1#2{\vrule depth #2 width #1\relax}
http://www.texnik.de/cgi-bin/mainFAQ.cg ... et/bracket
The above code works good (similar to \overbrace), but when I have to make many intersecting brackets it starts to be painful. I didn't try the mathtools package. Perhaps I will.
Greets,
Karin
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Re: physics in LaTeX
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10