我目前正在输入一些图表。(准确地说是 Dynkin 图表。)我的主要文本采用衬线字体(普通的老式 Computer Modern)。这些图表目前是用 TikZ 制作的,它们给我一种无衬线的感觉,我发现很难做到精确。请参阅下面的 MWE。
问:(柔软的)您能认出无衬线字体的感觉吗?
问:您对如何使图表看起来更“衬线”有什么建议吗?
在 TikZ 中绘制图表不是必需的。我对使用 Metafont、Postscript 或类似“低级”工具的解决方案很满意。
经过一些评论后,我认为如果我给出我正在寻找的想法/方向可能会有所帮助。我引用了评论部分的内容:“我猜可以用锥形笔画圆圈,就像衬线‘o’一样。这样顶部和底部较窄,左右较宽。对于线条,也可以想象它们具有不同的宽度或锥形末端。如果线条没有完全接触节点,这可能会很明显......”
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[full]{textcomp}
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{cd,positioning,shapes}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}
\begin{document}
Let $\Delta$ be a connected Dynkin diagram, and
let $\Delta^+$ be the extended (or affine)
Dynkin diagram associated with~$\Delta$.
Then $\Delta^+ = \Delta \sqcup \{\alpha_0\}$.
Below we depict the connected extended Dynkin diagrams,
in which $\alpha_0$ is depicted by a grey node
\tikz \node[draw,circle,inner sep=2pt,fill=gray] {};.
\[
\begin{tikzpicture}[
yscale=-1.3,
every node/.style={draw,circle,inner sep=2pt},
every label/.append style={rectangle,font=\footnotesize,
inner sep=1ex,text depth=1pt},
decoration={markings},
doubledynkin/.style={double distance=2pt,postaction=decorate},
a0/.style={fill=gray}
]
\node[draw=none] (A1text) [label=right:{\normalsize$A_1^+$:}] at (-.5,0) {};
\node[a0] (A10) at (1,0) {};
\node (A11) at (2,0) {};
\draw[double distance=2pt,
decoration={
mark=at position 0.95 with {\arrow{>}},
mark=at position 0.36 with {\arrow{<}}
},
postaction=decorate] (A10) -- (A11);
\begin{scope}[xshift=5cm]
\node[draw=none] (Antext) [label=right:{\normalsize$A_n^+$ ($n \ge 2$):}] at (-1.5,0) {};
\node[a0] (An0) at (3,-0.7) {};
\node (An1) at (1,0) {};
\node (An2) at (2,0) {};
\node (Annm1) at (4,0) {};
\node (Ann) at (5,0) {};
\draw (Annm1) -- (Ann) -- (An0) -- (An1) -- (An2);
\draw[dashed] (An2) -- (Annm1);
\end{scope}
\end{tikzpicture}
\]
\end{document}
答案1
我当然不知道衬线是如何工作的,但如果我看一下它的外观,\Delta
似乎有些线宽比其他线宽大。类似地,Dynkin 节点的轮廓可能希望向东南方向变粗一点。在给定的设置中,实现这一点的最简单方法可能是为每个节点添加一个微小的黑色伪阴影。
编辑:反馈后提出建议。
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[full]{textcomp}
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{cd,positioning,shapes}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}
\usetikzlibrary{backgrounds}
\begin{document}
Let $\Delta$ be a connected Dynkin diagram, and
let $\Delta^+$ be the extended (or affine)
Dynkin diagram associated with~$\Delta$.
Then $\Delta^+ = \Delta \sqcup \{\alpha_0\}$.
Below we depict the connected extended Dynkin diagrams,
in which $\alpha_0$ is depicted by a grey node
\tikz \node[draw,circle,inner sep=2pt,fill=gray] {};.
\[
\begin{tikzpicture}[
Dynkin/.style={yscale=1.2,draw,circle,fill=white,minimum width=8pt,inner sep=0pt,
append after command={\pgfextra{\begin{pgfonlayer}{background}
\draw[yscale=1.2,fill=black] ([xshift=0.18pt,yshift=-0.15pt]\tikzlastnode) circle (4.2pt);
\end{pgfonlayer}
}}},
every label/.append style={rectangle,font=\footnotesize,
inner sep=1ex,text depth=1pt},
decoration={markings},
doubledynkin/.style={double distance=2pt,postaction=decorate},
a0/.style={fill=gray},
every shadow/.style={fill=black,opacity=1,shadow xshift=0.5pt,
shadow yshift=-0.2pt},
Dynkin line/.style={preaction={transform canvas={shift={(0.2pt,-0.2pt)}},draw,
#1}},
]
\node[draw=none] (A1text) [label=right:{\normalsize$A_1^+$:}] at (-.5,0) {};
\node[Dynkin,a0] (A10) at (1,0) {};
\node[Dynkin] (A11) at (2,0) {};
\draw[double distance=2pt,
decoration={
mark=at position 0.95 with {\arrow{>}},
mark=at position 0.36 with {\arrow{<}}
},
postaction=decorate] (A10) -- (A11);
\begin{scope}[xshift=5cm]
\node[draw=none] (Antext) [label=right:{\normalsize$A_n^+$ ($n \ge 2$):}] at (-1.5,0) {};
\node[Dynkin,a0] (An0) at (3,1) {};
\node[Dynkin] (An1) at (1,0) {};
\node[Dynkin] (An2) at (2,0) {};
\node[Dynkin] (Annm1) at (4,0) {};
\node[Dynkin] (Ann) at (5,0) {};
\begin{scope}[on background layer]
\draw[Dynkin line] (Annm1.center) -- (Ann.center) -- (An0.center) -- (An1.center) -- (An2.center);
\draw[Dynkin line=dashed,dashed] (An2.center) -- (Annm1.center);
\end{scope}
\end{scope}
\end{tikzpicture}
\]
\end{document}
答案2
我也不明白“更有衬线”的体验是什么意思。使用的字体是“衬线”......对于节点,我怀疑你喜欢用椭圆(通过缩放获得,这也会影响字体大小)而不是圆形:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[full]{textcomp}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,
decorations.markings,
positioning,
shapes.geometric}
\begin{document}
Let $\Delta$ be a connected Dynkin diagram, and let $\Delta^+$ be the extended (or affine) Dynkin diagram associated with~$\Delta$. Then $\Delta^+ = \Delta \sqcup \{\alpha_0\}$. Below we depict the connected extended Dynkin diagrams, in which $\alpha_0$ is depicted by a grey node \tikz\node[ellipse,draw,semithick,fill=gray,inner xsep=2pt,inner ysep=3pt] {};.
\[
\begin{tikzpicture}[
node distance = 10mm and 10mm,
every node/.style = {ellipse, draw, semithick, inner xsep=3pt, inner ysep=4pt},
every label/.append style = {label distance=1em, rectangle, draw=none},
a0/.style = {fill=gray},
doubledynkin/.style={double distance=2pt,
decoration={markings,
mark=at position 0.9 with {\arrow[semithick]{Straight Barb[length=5pt]}},
mark=at position 0.1 with {\arrowreversed[semithick]{Straight Barb[length=5pt]}}
},
postaction={decorate},
}
]
\node[label=left:{$A_1^+$:}] (A10) {};
\node[right=of A10] (A11) {};
\draw[doubledynkin] (A10) -- (A11);
%
\begin{scope}[xshift=5cm]
\node[label=left:{$A_n^+ (n\ge 2)$:}] (A1) {};
\node[right=of A1] (A2) {};
\node[a0,above right=of A2] (A3) {};
\node[below right=of A3] (A4) {};
\node[right=of A4] (A5) {};
%
\draw (A2) -- (A1) -- (A3) -- (A5) -- (A4);
\draw[dashed] (A2) -- (A4);
\end{scope}
\end{tikzpicture}
\]
\end{document}
在上面的代码中,我使用positioning
库来相对放置节点。通过这个,你可以node distance
简单地改变节点之间的所有距离。除此之外,我还通过删除所有不必要的节点来简化图像代码。
附录 为了乐趣和锻炼:-)
添加了一些花哨的东西copy shadow
,如在“三角形”节点形成中最左边和顶部节点之间添加一条强调(较粗)的线,通过在文档前言中移动样式定义,整体代码略短...
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[full]{textcomp}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,
decorations.markings,
positioning,
shadows,
shapes.geometric}
\tikzset{Dynkin/.style =
{
every node/.style = {ellipse, draw, semithick, inner xsep=3pt, inner ysep=4pt,
fill=white,
copy shadow={fill=black,
shadow xshift=0.6pt, shadow yshift=-0.2pt},
},
every label/.append style = {label distance=1ex, rectangle, draw=none,
every shadow/.style={opacity=0}
},
a0/.style = {fill=gray!50},
doubledynkin/.style={double distance=2pt,
decoration={markings,
mark=at position 0.9 with {\arrow[semithick]{Straight Barb[length=5pt]}},
mark=at position 0.1 with {\arrowreversed[semithick]{Straight Barb[length=5pt]}}
},
postaction={decorate},
}
}% end of Dynkin style
}% end of tikzset
\begin{document}
Let $\Delta$ be a connected Dynkin diagram, and let $\Delta^+$ be the extended (or affine) Dynkin diagram associated with~$\Delta$. Then $\Delta^+ = \Delta \sqcup \{\alpha_0\}$. Below we depict the connected extended Dynkin diagrams, in which $\alpha_0$ is depicted by a grey node \tikz[Dynkin]\node[a0,scale=0.75] {};.
\[
\begin{tikzpicture}[Dynkin,
node distance = 12mm and 12mm,
]
\node[label=left:{$A_1^+$:}] (A10) {};
\node[right=of A10] (A11) {};
\draw[doubledynkin] (A10) -- (A11);
%
\begin{scope}[xshift=48mm]
\node[label=left:{$A_n^+ (n\ge 2)$:}] (A1) {};
\node[right=of A1] (A2) {};
\node[a0,above right=of A2] (A3) {};
\node[below right=of A3] (A4) {};
\node[right=of A4] (A5) {};
%
\draw[semithick] (A1) -- (A2)
(A4) -- (A5) -- (A3);
\draw[very thick] (A1) -- (A3);
\draw[semithick, dashed] (A2) -- (A4);
\end{scope}
\end{tikzpicture}
\]
\end{document}
答案3
我想它需要更多的牛铃。
\documentclass{article}
\usepackage{tikz}
\tikzset{cowbell/.style={
path picture={\draw[line width=\the\pgflinewidth+1pt]
(path picture bounding box.north east) |- (path picture bounding box.south west);},
draw,minimum size=3mm, inner sep=0
}
}
\begin{document}
Let $\Delta$ be a connected Dynkin diagram, and let $\Delta^+$ be the extended (or affine)
Dynkin diagram associated with~$\Delta$. Then $\Delta^+ = \Delta \sqcup \{\alpha_0\}$.
Below we depict the connected extended Dynkin diagrams, in which $\alpha_0$ is depicted by a
grey node \tikz \node[cowbell, fill=gray] {};.
\begin{tikzpicture}
\node[draw=none] (A1text) at (-.5,0) {$\displaystyle A_1^+ (n\geq2)$:};
\begin{scope}[shift={(A1text.east)}]
\foreach\x in {1,2,4,5}{\node[cowbell] (n-\x) at (\x,0) {};}
\node[cowbell, fill=gray] at (3,1) (n-3) {};
\draw (n-4) --(n-5) -- (n-3) -- (n-1) -- (n-2);
\draw[dashed] (n-2) -- (n-4);
\end{scope}
\end{tikzpicture}
\end{document}
我理解这种诱惑,但衬线并不意味着严谨。这是一种职业危害。
答案4
dynkin-diagrams
CTAN 上的包具有一种样式(ceref
一种古老的拼写serif
,旨在避免与 Dynkin 图表标签中的字体样式混淆),基于 marmot 的解决方案。
\documentclass{article}
\usepackage[ceref,mark=o,affine-mark=*]{dynkin-diagrams}
\begin{document}
Let $\Delta$ be a connected Dynkin diagram, and let $\Delta^+$ be the extended
(or affine) Dynkin diagram associated with~$\Delta$. Then $\Delta^+ = \Delta
\sqcup \{\alpha_0\}$. Below we depict the connected extended Dynkin diagrams,
in which $\alpha_0$ is depicted by a grey node \dynkin{A}{*}.
\[
A_1^+: \dynkin{A}[1]{1} \qquad A_{n\ge 2}^+: \dynkin{A}[1]{}
\]
\end{document}