3

Lots of questions here about increasing the vertical spacing in underbrace (e.g. Increase vertical space beetwen underbrace bracket and content and Vertical Space between formula and brackets), but none I could find about decreasing it. The following code

% minimal working example (MWE)
\documentclass{article}
\usepackage{amsfonts}
\usepackage{mathrsfs}
\usepackage{mathtools}
\newcommand{\ring}{\text{ring}}
\newcommand{\alg}{\text{alg}}
\newcommand{\ACF}{\text{ACF}}

\begin{document} 
This also helps determine completions of ACF (ACF not complete theory, because $\mathbb C \models \ACF$ and $\mathbb F_p^\alg \models \ACF$, but the $\mathscr L_\ring$-sentence $\smash{\underbracket[0.2pt]{1+\ldots + 1}_{\scriptscriptstyle p\text{ times}}=0}$ is not satisfied by $\mathbb C$ but satisfied by $\mathbb F_p^\alg$). More explicitly: adding the characteristic $p$ sentence produces a complete theory. 
\end{document}

produces

I think if we can move up the underbracket, and move up the text underneath the underbracket it can all fit in the space between the lines (and definitely so if we say increase line spacing to 1.5 or something).

2 Answers 2

4

I copied the \underbracket definition from mathtools.sty and did modifications at two places:

\bgroup \catcode`_=11 \catcode`:=11 \catcode`\@=11
\gdef\MT_underbracket_II:w[#1][#2]#3{%
  \mathop{\vtop{\m@th\ialign{##
    \crcr
      $\hfil\displaystyle{#3}\hfil$%
    \crcr
      \noalign{\kern -.5ex \nointerlineskip}% <<< negative kern here
      \upbracketfill {#1}{#2}%
    \crcr}\kern-.2ex}} % <<< added negative kern here
  \limits}
\egroup

If you want to have equidistant baselineskip in the whole paragraph with underbracket in it, I suggest to set \baselineskip=1.6em.

Edit: If you plan to use your \myunderbracket in the format

\myunderbracket[thickness]{formula}

(like in your example), then you can define:

\def\myunderbracket[#1]#2{%
  \mathop{\vtop{\ialign{##\crcr
      $\hfil\displaystyle{#2}\hfil$%
    \crcr
      \noalign{\kern -.5ex \nointerlineskip}% <<< negative kern here
      \upbracketfill {#1}{.7\fontdimen5\textfont2}%
    \crcr}\kern-.2ex}} % <<< added negative kern here
  \limits}
5
  • is it possible to write a new command like \myunderbracket to contain this modification?
    – D.R
    Sep 18, 2022 at 8:04
  • 1
    @D.R I added the definition of \myunderbracket in my answer.
    – wipet
    Sep 18, 2022 at 9:19
  • apologies for reopening this post, but I notice there's small extra horizontal space that \myunderbracket adds at the end, compared to \underbracket (most visible when one puts parentheses around the expression with the underbracket). Do you know why this happens, and can it be fixed?
    – D.R
    Oct 15, 2022 at 0:57
  • 1
    @D.R OK, I corrected this. The first \crcr must follow the ## immediately. I don't understand why this space is irrelevant in mathtools.sty but I don't want to examine it.
    – wipet
    Oct 15, 2022 at 5:47
  • thank you very much. I suppose LaTeX sometimes baffles even the most experienced of us...
    – D.R
    Oct 15, 2022 at 18:11
2

With TikZ:

\documentclass{article}
\usepackage{amsfonts}
\usepackage{mathrsfs}
\usepackage{mathtools}
\newcommand{\ring}{\text{ring}}
\newcommand{\alg}{\text{alg}}
\newcommand{\ACF}{\text{ACF}}
\usepackage{tikz}
\usetikzlibrary{positioning}
\newcommand{\myunder}[2]{\tikz[baseline]{\node[inner sep=0pt, anchor=base, baseline](A){$#1$};
  \coordinate (startpoint) at ([xshift=-.05em,yshift=-.3ex]A.south west);
  \coordinate (endpoint) at ([xshift=.05em,yshift=-.3ex]A.south east);
  \draw[line width=0.2pt] ([yshift=3pt]startpoint) -- (startpoint) -- (endpoint) -- ++(0,3pt);
  \node[inner sep=0pt, below=3pt of A.south]{$\scriptscriptstyle #2$};}}
\begin{document} 
With Ti\emph{k}Z:

This also helps determine completions of ACF (ACF not complete theory, because $\mathbb C \models \ACF$ and $\mathbb F_p^\alg \models \ACF$, but the $\mathscr L_\ring$-sentence $\myunder{1+\ldots + 1}{p\text{ times}}=0$ is not satisfied by $\mathbb C$ but satisfied by $\mathbb F_p^\alg$). More explicitly: adding the characteristic $p$ sentence produces a complete theory.

Compare with the ordinary way:

This also helps determine completions of ACF (ACF not complete theory, because $\mathbb C \models \ACF$ and $\mathbb F_p^\alg \models \ACF$, but the $\mathscr L_\ring$-sentence $\underbracket[0.2pt]{1+\ldots + 1}_{\scriptscriptstyle p\text{ times}}=0$ is not satisfied by $\mathbb C$ but satisfied by $\mathbb F_p^\alg$). More explicitly: adding the characteristic $p$ sentence produces a complete theory.

\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .