tikzpicture 图形之外的文本有些不同/更粗 - 如何更改它?

tikzpicture 图形之外的文本有些不同/更粗 - 如何更改它?

我设法用 tikzpicture 构建了这个图形,这正是我想要的,但我不明白为什么金字塔外面的文本看起来与里面的文本不同并且更粗。我想实现图形外部和内部的文本看起来相同。有什么办法可以实现这个吗?这真的会帮助我,我不知何故无法自己弄清楚或找到类似的问题......这是 MWE

% arara: pdflatex

\documentclass[fontsize=9pt,
]{scrbook}
\usepackage[utf8]{inputenc}
\usepackage[english,main=ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage{libertine}
\usepackage[xindy]{imakeidx}
\usepackage{float}
\usepackage{lscape}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usetikzlibrary{intersections}
\usepackage{amsmath}
\usepackage{pgfplots}
\pgfplotsset{compat=1.8}

\begin{document}

\begin{figure}[h!]
    \centering
    \resizebox{1.00\linewidth}{!}{
        \begin{tikzpicture}
            \coordinate (A) at (-3,0) {};
            \coordinate (B) at ( 3,0) {};
            \coordinate (C) at (0,4) {};
            \draw[name path=AC] (A) -- (C);
            \draw[name path=BC] (B) -- (C);
            \foreach \y/\A in {
                0/TextText,
                1/TextText TextText,
                2/TextText \\ Text,
            } {
                \path[name path=horiz] (A|-0,\y) -- (B|-0,\y);
                \draw[name intersections={of=AC and horiz,by=P},
                name intersections={of=BC and horiz,by=Q}] (P) -- (Q)           node[midway,above,align=center,] {\A}
                ;
                \draw[decorate, decoration={brace},thick] (-2.4,0.9) -- 
                node[left=2mm, pos=0.55] {\normalsize \text{Text Text Text}} 
                (-1.2,2.5);
                \draw[<-] (2.4,1) -- 
                node[right=3mm, pos=0.5] {Level 1}
                (3,1);
                \draw[<-] (2,1.5) -- 
                node[right=4.8mm, pos=0.5] {Level 2}
                (3,1.5);
                \draw[<-] (1.4,2.3) -- 
                node[right=7.5mm, pos=0.5] {Level 3}
                (3,2.3);
            }
        \end{tikzpicture}
    }
\end{figure}

\end{document}

在此处输入图片描述

答案1

您将在三角形外绘制 3 次文本(每次循环迭代一次)。这将使文本看起来更粗。

您应该将静态文本移出循环:

% arara: pdflatex

\documentclass[fontsize=9pt,
]{scrbook}
\usepackage[utf8]{inputenc}
\usepackage[english,main=ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage{libertine}
\usepackage[xindy]{imakeidx}
\usepackage{float}
\usepackage{lscape}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usetikzlibrary{intersections}
\usepackage{amsmath}
\usepackage{pgfplots}
\pgfplotsset{compat=1.8}

\begin{document}

\begin{figure}[h!]
    \centering
%    \resizebox{1.00\linewidth}{!}{
        \begin{tikzpicture}
            \coordinate (A) at (-3,0) {};
            \coordinate (B) at ( 3,0) {};
            \coordinate (C) at (0,4) {};
            \draw[name path=AC] (A) -- (C);
            \draw[name path=BC] (B) -- (C);
            \foreach \y/\A in {
                0/TextText,
                1/TextText TextText,
                2/TextText \\ Text,
            } {
                \path[name path=horiz] (A|-0,\y) -- (B|-0,\y);
                \draw[name intersections={of=AC and horiz,by=P},
                name intersections={of=BC and horiz,by=Q}] (P) -- (Q)           node[midway,above,align=center,] {\A}
                ;
            }
            \draw[decorate, decoration={brace},thick] (-2.4,0.9) -- 
            node[left=2mm, pos=0.55] {\normalsize {Text Text Text}} 
            (-1.2,2.5);
            \draw[<-] (2.4,1) -- 
            node[right=3mm, pos=0.5] {Level 1}
            (3,1);
            \draw[<-] (2,1.5) -- 
            node[right=4.8mm, pos=0.5] {Level 2}
            (3,1.5);
            \draw[<-] (1.4,2.3) -- 
            node[right=7.5mm, pos=0.5] {Level 3}
            (3,2.3);
        \end{tikzpicture}
%    }
\end{figure}

\end{document}

在此处输入图片描述

相关内容