我想在符號 \bigwedge 和 \bigvee 上插入一條虛線,使其看起來與相同符號上的實線完全相同。我知道如何在這些符號上插入實線(例如,\overline{\bigwedge})。自從我問了一個問題幾年前,關於如何在字母上添加虛線箭頭,我嘗試使用那裡的程式碼。結果代碼:
\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}
結果文件:
我有以下問題:
- 不知何故,在內聯模式下 $\preclosure{\bigwedge}$ 符號比 $\bigwedge$ 更大。
- 虛線不分配垂直空間並進入文本
- 在我看來,當 $\overline{\bigvee}$ 內聯時,上劃線太靠近 V 符號,使其看起來幾乎像三角形。如果我放大,我可以看到事實並非如此,但在 100% 縮放時,它看起來太接近了。如何將上劃線移高一點?或者您認為這不是問題?
沒有必要使用與我編寫的完全相同的程式碼,我只是使用了我已經擁有的程式碼,但沒有成功:)
答案1
我會避免\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}
您可能想要定義
\newcommand{\fbigvee}{\fillover{\bigvee}}
\newcommand{\dbigvee}{\dashover{\bigvee}}
命令\fillover
和\dashover
有一個可選參數,用於設定物件的類型。預設是\mathop
,但也可以是\mathrel
或\mathbin
,所以你可以使用
\newcommand{\dvee}{\dashover[\mathbin]{\vee}}
並$x\dvee y$
會產生
\noalign
您可能需要調整分隔空間,即程式碼中的參數\df@@over
。但是,該巨集並未針對 以外的用途進行最佳化\mathop
,對於其他類型,應該做更多的事情。
答案2
這可能有稍微影響行距的缺點,但是......
我用\Overline
它來代替\overline
,並添加了一些額外的堆疊間隙。
對於,我修改了它,以便它使用包的構造\preclosure
保留參數的數學風格。\ThisStyle{...\SavedStyle...}
scalerel
\preclosure
我並沒有真正解決和上面的線之間間隙不夠的問題。我建議要么使用較小的楔形(如果允許),要么使用較大的行間距。
\documentclass[11pt,a4paper,draft]{amsart}
\pagestyle{plain}
\usepackage[a4paper]{geometry}
\usepackage{scalerel,stackengine}
\stackMath
\usepackage[utf8]{inputenc}
\usepackage{tikz} %for dash
\def\Overline#1{\ThisStyle{\overline{\addstackgap[.4pt]{\SavedStyle#1}}}}
\makeatletter
\newcommand{\preclosure}[1]{%
\ThisStyle{%
\vbox {\m@th\ialign{##\crcr
\preclosurefill \crcr
\noalign{\kern-\p@\nointerlineskip}
$\hfil\SavedStyle{#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}