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?
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- 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