2

The ibrackets package doesn't seem to work when I use \underset or \overset.

\[
]-\infty\underset{\substack{\uparrow \\ \frac{\pi}{2n}}}{,} a] \text { oppure } [a\underset{\substack{\uparrow \\ \frac{\pi}{2n}}}{,} \!+\infty[
\]

I would like your opinion on how to adjust the spacing in this case as well, when I have a long text that should remain in normal style.

\[
-\infty<\underset{\substack{\uparrow \\ punto \\di \\massimo}}{\frac{\pi}{2n}}<a
\]

I would prefer not to write the \text command three times.

Here a MWE

enter image description here

\documentclass[12pt,a4paper]{article}
\usepackage{amsmath,amssymb,ibrackets}
\begin{document}
\[
]-\infty\underset{\substack{\uparrow \\ \frac{\pi}{2n}}}{,}  a] \text { oppure } [a\underset{\substack{\uparrow \\ \frac{\pi}{2n}}}{,} \!+\infty[
\]
Ora in $x\in]-\infty,a]$, la funzione $f_n(x)$ è crescente ($k=0$) in $]-\pi/2n,\pi/2n[$, decrescente altrove, se 
\[
-\infty<\underset{\substack{\uparrow \\ punto \\di \\massimo}}{\frac{\pi}{2n}}<a
\]
allora 
\[
\sup_{\substack{]-\infty,a]\\ \frac {\pi}{2n}<a}} f_n(x)=f_n(c_n)=1/n^2
\]
e qui si ha uniforme convergenza 

\end{document}
2
  • 2
    I see nothing wrong: the words occupy space; you might use \mathclap from mathtools to hide them. Commented Dec 10 at 22:27
  • @egreg I have thought to use \mathclap, \raisebox, \rlap. Is there a fast mode to avoid to write 3 times \text? Commented Dec 10 at 22:30

2 Answers 2

4

You could define a custom macro -- called \mytab in the code given below -- to typeset the text-only portion of a longer \substack directive. The use of a tabular environment inside the \mytab macro assures consistent line spacing -- something that's not guaranteed to occur if you use \substack all by itself. Observe the use of \mathpunct in the code below; it assures that the comma in the "middle" of the interval is given status math-punct (with a wee bit of space after the comma).

If you feel that the ibrackets package's software is unreliable, it's not really all that much extra work to supply various \mathopen and \mathclose directives to fix the occasional spacing issue. For what it's worth, I've found that if one writes ]-\infty,a], then ibrackets correctly treats ] as having status math-open and - being treated as a unary operator; in contrast, ibrackets doesn't do a good job if one writes ] -\infty,a], i.e., if one provides whitespace between ] and -, as it doesn't judge that ] should have status math-open and hence also treats - as a binary rather than as a unary operator.

enter image description here

\documentclass{article}
\usepackage{mathtools} % for '\mathclap' macro
\newcommand\mytab[1]{{\scriptsize%
   \begin{tabular}{@{}c@{}}#1\end{tabular}}}
   
\begin{document}

\[
\mathopen{]} -\infty 
\mathpunct{\underset{\mathclap{\substack{\uparrow \\ \frac{\pi}{2n}}}}{,}} a] 
\quad\text{oppure}\quad
[ a
\mathpunct{\underset{\mathclap{\substack{\uparrow \\ \frac{\pi}{2n}}}}{,}} +\infty \mathclose{[}
\]

\bigskip
\[
-\infty <
\underset{\mathclap{\substack{\uparrow\\\mytab{punto di\\massimo}}}}{\frac{\pi}{2n}}
< a
\]

\end{document}
0
4

A fairly general facility.

Note the type=\mathpunct for undersetting the comma; try without it and you'll see that the spacing is wrong. The \underset and \overset commands are only able to recognize relations or operators, not other math atoms.

By default, \pointer uses text mode for the annotation, but one can use the key math to turn into math mode (see the examples).

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[italian]{babel}
\usepackage{amsmath,mathtools}

\ExplSyntaxOn
\NewDocumentCommand{\pointer}{O{}mm}
 {% #1 = options, #2 = text of pointer, #3 = symbol
  \sebastiano_pointer:nnn {#1} {#2} {#3}
 }

\keys_define:nn { sebastiano/pointer }
 {
  up    .bool_set:N = \l__sebastiano_pointer_up_bool,
  up    .default:n  = true,
  down  .bool_set_inverse:N = \l__sebastiano_pointer_up_bool,
  down  .default:n  = true,
  width .dim_set:N  = \l__sebastiano_pointer_width_dim,
  width .initial:n  = 0pt,
  type  .tl_set:N   = \l__sebastiano_pointer_type_tl,
  math  .bool_set:N = \l__sebastiano_pointer_math_bool,
  math  .default:n  = true,
 }

\cs_new_protected:Nn \sebastiano_pointer:nnn
 {
  \group_begin:
  \keys_set:nn { sebastiano/pointer } {#1}
  \bool_if:NTF \l__sebastiano_pointer_up_bool
   {
    \__sebastiano_pointer_up:nn {#2} {#3}
   }
   {
    \__sebastiano_pointer_down:nn {#2} {#3}
   }
  \group_end:
 }

\cs_new_protected:Nn \__sebastiano_pointer_up:nn
 {
  \tl_if_blank:VTF \l__sebastiano_pointer_type_tl
   {
    \__sebastiano_pointer_up_aux:nn {#1} {#2}
   }
   {
    \tl_use:N \l__sebastiano_pointer_type_tl { \__sebastiano_pointer_up_aux:nn {#1} {#2} }
   }
 }

\cs_new_protected:Nn \__sebastiano_pointer_up_aux:nn
 {
  \underset
   {
    \mathmakebox[\l__sebastiano_pointer_width_dim][c]
     {
      \substack
       {
        \uparrow \\
        \bool_if:NTF \l__sebastiano_pointer_math_bool
         { #1 }
         { \__sebastiano_pointer_text:n {#1} }
       }
     }
   }{#2}
 }

\cs_new_protected:Nn \__sebastiano_pointer_down:nn
 {
  \tl_if_blank:VTF \l__sebastiano_pointer_type_tl
   {
    \__sebastiano_pointer_down_aux:nn {#1} {#2}
   }
   {
    \tl_use:N \l__sebastiano_pointer_type_tl { \__sebastiano_pointer_down_aux:nn {#1} {#2} }
   }
 }

\cs_new_protected:Nn \__sebastiano_pointer_down_aux:nn
 {
  \overset
   {
    \mathmakebox[\l__sebastiano_pointer_width_dim][c]
     {
      \substack
       {
        \bool_if:NTF \l__sebastiano_pointer_math_bool
         { #1 }
         { \__sebastiano_pointer_text:n {#1} }
        \\
        \downarrow
       }
     }
   }{#2}
 }

\cs_new_protected:Nn \__sebastiano_pointer_text:n
 {
  \fontsize{\use:c{sf@size}}{\fp_eval:n {1.2*\use:c{sf@size}}}\normalfont
  \begin{tabular}{@{}c@{}}#1\end{tabular}
 }

\ExplSyntaxOff

\begin{document}

\[
  (-\infty\pointer[up,type=\mathpunct,math]{\frac{\pi}{2n}}{,}  a]
  \text{ oppure }
  [a\pointer[up,type=\mathpunct]{$\frac{\pi}{2n}$}{,}+\infty)
\]
Ora in $x\in(-\infty,a]$, la funzione $f_n(x)$ è crescente 
($k=0$) in $(-\pi/2n,\pi/2n)$, decrescente altrove, se 
\[
-\infty < \pointer[up]{punto di \\ massimo}{\frac{\pi}{2n}} < a
\]
allora 
\[
  \sup_{\substack{(-\infty,a]\\ \frac {\pi}{2n}<a}} f_n(x)
  \pointer[down,width=2em]{relazione \\ fondamentale}{=} f_n(c_n)=1/n^2
\]
e qui si ha uniforme convergenza 

\end{document}

output

5
  • I thought you had forgotten me. :-) I am studying subjects that I have never studied with the ‘old-fashioned’ professor you know. Commented Dec 11 at 8:49
  • 2
    @Sebastiano You can use the perverse interval notation, if you prefer; I won't. 😉 Commented Dec 11 at 9:55
  • I use the notation of the book of the Prof. De Marco Giuseppe staticmy.zanichelli.it/catalogo/assets/a05.9788808299789.pdf pag. 253 Esempio 10.6.1. An = ]−∞, n[. Commented Dec 11 at 10:02
  • 2
    @Sebastiano Giuseppe is a friend, but I strongly disagree with him on this point about notation. His course on general topology opened my mind! Great teacher! Commented Dec 11 at 10:32
  • I completely agree with you. I know him very well. For me, he is the best mathematician that I know. Commented Dec 11 at 12:49

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.