tikz 中节点中的文本似乎不是矢量的

tikz 中节点中的文本似乎不是矢量的

我正在尝试在 tikz 中绘制核素图表。但是当我查看不同的元素名称(C、Be 等)时,我注意到我的文本似乎不是矢量的......非常奇怪的是,其中一些是矢量的(例如,查看 n,查看指数),我可以一直缩放,但其他的不是(碳的 C、钙的 Ca 等)。这是为什么?

这是 MWE

\documentclass{standalone}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\usepackage{mathtools}
\usepackage{amssymb}
\usepackage{amsthm}

\usepackage{color}

\usepackage{tikz}   % drawing
\usetikzlibrary
{
    arrows,
    shadings,
    shapes,
}
\tikzset{>=stealth'}

\begin{document}

    \pgfdeclareradialshading{sphereK}{\pgfpoint{-0.4cm}{0.4cm}}% 
    {rgb(0cm)=(0.3,0.3,0.3); rgb(1cm)=(0.05,0.05,0.05); rgb(2cm)=(0,0,0)}
    \pgfdeclareradialshading{sphereR}{\pgfpoint{-0.4cm}{0.4cm}}% 
    {rgb(0cm)=(1,0,0); rgb(1cm)=(0.5,0,0); rgb(2cm)=(0.2,0,0)}
    \pgfdeclareradialshading{sphereB}{\pgfpoint{-0.4cm}{0.4cm}}% 
    {rgb(0cm)=(0,0,1); rgb(1cm)=(0,0,0.5); rgb(2cm)=(0,0,0.2)}
    \pgfdeclareradialshading{sphereG}{\pgfpoint{-0.4cm}{0.4cm}}% 
    {rgb(0cm)=(0,0.7,0); rgb(1cm)=(0,0.4,0); rgb(2cm)=(0,0.3,0)}
    \pgfdeclareradialshading{sphereP}{\pgfpoint{-0.4cm}{0.4cm}}% 
    {rgb(0cm)=(1,0.4,0.4); rgb(1cm)=(0.75,0.35,0.35); rgb(2cm)=(0.5,0.3,0.3)}
    \pgfdeclareradialshading{sphereN}{\pgfpoint{-0.4cm}{0.4cm}}% 
    {rgb(0cm)=(0.4,0.6,1); rgb(1cm)=(0.3,0.45,0.75); rgb(2cm)=(0.2,0.3,0.5)}

    \begin{tikzpicture}
        \tikzstyle{stable}=[draw=black, shape = rectangle,inner sep=0pt, shading = sphereK, minimum size=1cm];
        \tikzstyle{oneP}=[draw=black, shape = rectangle, inner sep=0pt, shading = sphereR, minimum size=1cm];
        \tikzstyle{oneN}=[draw=black,shape = rectangle, inner sep=0pt, shading = sphereB, minimum size=1cm];
        \tikzstyle{twoN}=[draw=black,shape = rectangle, inner sep=0pt, shading = sphereG, minimum size=1cm];
        \tikzstyle{nucP}=[draw=black,shape = rectangle, inner sep=0pt, shading = sphereP, minimum size=1cm];
        \tikzstyle{nucN}=[draw=black,shape = rectangle, inner sep=0pt, shading = sphereN, minimum size=1cm];    %

        \node[nucN, text=white] at (1cm,0cm) {$n$};
        \node[stable, text = white] (H1) at (0cm,1cm) {$^1$H};
        \node[oneN, text = white] (H2) at (1cm,1cm) {$^2$C};
        \node[nucP, text = white] (H3) at (2cm,1cm) {$^3$B};
        \node[twoN, text = white] at (1cm,2cm) {$^3$Ne};
        \node[oneP, text = white] at (2cm,2cm) {$^4$Ca};
        \end{tikzpicture}

\end{document}

下面是我放大 pdf 时呈现的屏幕截图:

在此处输入图片描述

答案1

问题可能是查看器问题,也可能是使用了 Type 3 字体。要确定第二个选项,您可以使用pdffonts列出 pdf 文件中包含的所有字体的命令:

在此处输入图片描述

或者将 pdf 结果打开到可以列出字体的查看器(Adobe Reader、PDF-X Change Viewer 等):

在此处输入图片描述

如果使用 Type 3 字体,如本例所示,则可以使用以下方法解决问题cm-super字体(MikTeX 默认不安装)或者加载其他 Type 1 字体,例如lmodern

\documentclass{standalone}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{lmodern}

\usepackage{mathtools}
\usepackage{amssymb}
\usepackage{amsthm}

\usepackage{color}

\usepackage{tikz}   % drawing
\usetikzlibrary
{
    arrows,
    shadings,
    shapes,
}
\tikzset{>=stealth'}

\begin{document}

    \pgfdeclareradialshading{sphereK}{\pgfpoint{-0.4cm}{0.4cm}}% 
    {rgb(0cm)=(0.3,0.3,0.3); rgb(1cm)=(0.05,0.05,0.05); rgb(2cm)=(0,0,0)}
    \pgfdeclareradialshading{sphereR}{\pgfpoint{-0.4cm}{0.4cm}}% 
    {rgb(0cm)=(1,0,0); rgb(1cm)=(0.5,0,0); rgb(2cm)=(0.2,0,0)}
    \pgfdeclareradialshading{sphereB}{\pgfpoint{-0.4cm}{0.4cm}}% 
    {rgb(0cm)=(0,0,1); rgb(1cm)=(0,0,0.5); rgb(2cm)=(0,0,0.2)}
    \pgfdeclareradialshading{sphereG}{\pgfpoint{-0.4cm}{0.4cm}}% 
    {rgb(0cm)=(0,0.7,0); rgb(1cm)=(0,0.4,0); rgb(2cm)=(0,0.3,0)}
    \pgfdeclareradialshading{sphereP}{\pgfpoint{-0.4cm}{0.4cm}}% 
    {rgb(0cm)=(1,0.4,0.4); rgb(1cm)=(0.75,0.35,0.35); rgb(2cm)=(0.5,0.3,0.3)}
    \pgfdeclareradialshading{sphereN}{\pgfpoint{-0.4cm}{0.4cm}}% 
    {rgb(0cm)=(0.4,0.6,1); rgb(1cm)=(0.3,0.45,0.75); rgb(2cm)=(0.2,0.3,0.5)}

    \begin{tikzpicture}
        \tikzstyle{stable}=[draw=black, shape = rectangle,inner sep=0pt, shading = sphereK, minimum size=1cm];
        \tikzstyle{oneP}=[draw=black, shape = rectangle, inner sep=0pt, shading = sphereR, minimum size=1cm];
        \tikzstyle{oneN}=[draw=black,shape = rectangle, inner sep=0pt, shading = sphereB, minimum size=1cm];
        \tikzstyle{twoN}=[draw=black,shape = rectangle, inner sep=0pt, shading = sphereG, minimum size=1cm];
        \tikzstyle{nucP}=[draw=black,shape = rectangle, inner sep=0pt, shading = sphereP, minimum size=1cm];
        \tikzstyle{nucN}=[draw=black,shape = rectangle, inner sep=0pt, shading = sphereN, minimum size=1cm];    %

        \node[nucN, text=white] at (1cm,0cm) {$n$};
        \node[stable, text = white] (H1) at (0cm,1cm) {$^1$H};
        \node[oneN, text = white] (H2) at (1cm,1cm) {$^2$C};
        \node[nucP, text = white] (H3) at (2cm,1cm) {$^3$B};
        \node[twoN, text = white] at (1cm,2cm) {$^3$Ne};
        \node[oneP, text = white] at (2cm,2cm) {$^4$Ca};
        \end{tikzpicture}

\end{document}

在此处输入图片描述

相关内容