Advertisement
dvleo

dashed line over text in LaTeX

Aug 8th, 2024
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 1.01 KB | Source Code | 0 0
  1.  
  2. \makeatletter
  3. \newcommand{\dashover}[2][\mathop]{#1{\mathpalette\df@over{{\dashfill}{#2}}}}
  4. \newcommand{\fillover}[2][\mathop]{#1{\mathpalette\df@over{{\solidfill}{#2}}}}
  5. \newcommand{\df@over}[2]{\df@@over#1#2}
  6. \newcommand\df@@over[3]{%
  7.   \vbox{
  8.    \offinterlineskip
  9.    \ialign{##\cr
  10.      #2{#1}\cr
  11.      \noalign{\kern1.2pt}
  12.      $\m@th#1#3$\cr
  13.    }
  14.  }%
  15. }
  16. \newcommand{\dashfill}[1]{%
  17.   \kern-.5pt
  18.   \xleaders\hbox{\kern.5pt\vrule height.4pt width \dash@width{#1}\kern.5pt}\hfill
  19.  \kern-.5pt
  20. }
  21. \newcommand{\dash@width}[1]{%
  22.   \ifx#1\displaystyle
  23.     2pt
  24.   \else
  25.     \ifx#1\textstyle
  26.       1.5pt
  27.     \else
  28.       \ifx#1\scriptstyle
  29.         1.25pt
  30.       \else
  31.         \ifx#1\scriptscriptstyle
  32.           1pt
  33.         \fi
  34.       \fi
  35.     \fi
  36.   \fi
  37. }
  38. \newcommand{\solidfill}[1]{\leaders\hrule\hfill}
  39. \makeatother
  40.  
  41. Then use
  42. $\dashover{\mathcal{A}}$ for example.
  43.  
  44. See https://tex.stackexchange.com/questions/218416/how-to-insert-a-dashed-line-over-a-bigwedge-symbol-so-that-the-dashed-line-behav
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement