[Tex/LaTex] How to insert a dashed line over a bigwedge symbol so that the dashed line behaves like overline would

macrosspacingsymbols

I want to insert a dashed line over symbols \bigwedge and \bigvee in such a way that it looks exactly like a solid line over the same symbols. I know how to insert a solid line over those symbols (for example, \overline{\bigwedge}). Since I asked a question a few years ago about how to add a dashed arrow over a letter, I tried to use the code from there. Resulting code:

\documentclass[11pt,a4paper,draft]{amsart}
\pagestyle{plain}
\usepackage[a4paper]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{tikz} %for dash

\makeatletter

\newcommand{\preclosure}[1]{%
  \vbox {\m@th\ialign{##\crcr
  \preclosurefill \crcr
  \noalign{\kern-\p@\nointerlineskip}
  $\hfil\displaystyle{#1}\hfil$\crcr}}}

%% fill with (short) minus signs
\def\preclosurefill{%
  $\m@th%
  \xleaders\hbox{$\mkern0mu\shortbar\mkern0mu$}\hfill%
  \shortbar%
$}

%% make the minus shorter to fit \dashedleftarrow
\def\shortbar{%
  \smash{\scalebox{0.4}[1.0]{$-$}}}
\makeatother

\begin{document}

In order to distinguish between lattice operations $\bigvee, \bigwedge$ in structure A, we use the following symbols: $\overline{\bigvee}, \overline{\bigwedge}$. Similarly, to distinguish between operations $\bigvee, \bigwedge$ in structure B, we use the following symbols: $\preclosure{\bigvee}, \preclosure{\bigwedge}$.

Inline: $\overline{\bigvee}_{\alpha \in I}$, $\preclosure{\bigvee}_{\alpha \in I}$.

In separate line:
\[
\overline{\bigvee_{\alpha \in I}}, \preclosure{\bigvee_{\alpha \in I}}.
\]
\end{document}

Resulting document:

Resulting document

I have the following problems:

  1. Somehow in inline mode the $\preclosure{\bigwedge}$ symbol is made bigger than just $\bigwedge$.
  2. The dashed line does not allocate vertical space and runs into text
  3. It seems to me that when $\overline{\bigvee}$ is inline, then the overline is too close to the V symbol, making it look almost like triangle. If I zoom in, then I can see that it is not so, but at 100% zoom it looks too close. How to move the overline a bit higher? Or do You think that this is not a problem?

It is not necessary to use exactly the same code I wrote, I just used what I already had, but not successfully 🙂

Best Answer

I'd avoid \overline:

\documentclass{article}
\usepackage{amsmath}

\makeatletter
\newcommand{\dashover}[2][\mathop]{#1{\mathpalette\df@over{{\dashfill}{#2}}}}
\newcommand{\fillover}[2][\mathop]{#1{\mathpalette\df@over{{\solidfill}{#2}}}}
\newcommand{\df@over}[2]{\df@@over#1#2}
\newcommand\df@@over[3]{%
  \vbox{
    \offinterlineskip
    \ialign{##\cr
      #2{#1}\cr
      \noalign{\kern1pt}
      $\m@th#1#3$\cr
    }
  }%
}
\newcommand{\dashfill}[1]{%
  \kern-.5pt
  \xleaders\hbox{\kern.5pt\vrule height.4pt width \dash@width{#1}\kern.5pt}\hfill
  \kern-.5pt
}
\newcommand{\dash@width}[1]{%
  \ifx#1\displaystyle
    2pt
  \else
    \ifx#1\textstyle
      1.5pt
    \else
      \ifx#1\scriptstyle
        1.25pt
      \else
        \ifx#1\scriptscriptstyle
          1pt
        \fi
      \fi
    \fi
  \fi
}
\newcommand{\solidfill}[1]{\leaders\hrule\hfill}
\makeatother

\begin{document}

Text:
$\bigvee_{\alpha\in I}$,
$\fillover{\bigvee}_{\alpha \in I}$,
$\dashover{\bigvee}_{\alpha \in I}$.

Subscript:
$\scriptstyle\bigvee_{\alpha\in I}$,
$\scriptstyle\fillover{\bigvee}_{\alpha \in I}$,
$\scriptstyle\dashover{\bigvee}_{\alpha \in I}$.

Display:
\[
\bigvee_{\alpha \in I}
\fillover{\bigvee}_{\alpha \in I}
\dashover{\bigvee}_{\alpha \in I}.
\]
\end{document}

enter image description here

You probably want to define

\newcommand{\fbigvee}{\fillover{\bigvee}}

    \newcommand{\dbigvee}{\dashover{\bigvee}}

The commands \fillover and \dashover have an optional argument that sets the type of the object. Default is \mathop, but it can be \mathrel or \mathbin, so you could use

\newcommand{\dvee}{\dashover[\mathbin]{\vee}}

and $x\dvee y$ would produce

enter image description here

You may want to adjust the separation space, the argument to \noalign in the code for \df@@over. However, the macro is not optimized for usages other than \mathop, something more should be done in the case of other types.