TikZ — 文本节点中的点填充

TikZ — 文本节点中的点填充

我正在尝试使用 TikZ 重新绘制在 InDesign 中创建的简单 A2 海报,并且需要一些点填充符来填充某种“目录”:

在此处输入图片描述

什么\dotfill也不做(好吧,没有“线”)。

\documentclass[landscape]{article}
\usepackage[a2paper]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[sfdefault]{noto}
\usepackage[T1]{fontenc}
\usepackage{fullpage}           
\usepackage{pgf,tikz}
\setlength\parindent{0pt}
\pagestyle{empty}

\begin{document}
    \begin{center}
        \vspace*{25mm}
        \begin{tikzpicture}[x=1mm, y=1mm]
        \clip[] (-2, 2) rectangle (452, -302);

        %\node[anchor=north] at (226, -5) {\includegraphics[height=90mm]{logo}};
        \draw[] (0, 0) rectangle (450, -300);

        \node[anchor=west, font=\fontsize{33}{35}\selectfont] at (30, -110) {A \dotfill 1};
        \node[anchor=west, font=\fontsize{33}{35}\selectfont] at (30, -128) {Abc \dotfill 10};
        \node[anchor=west, font=\fontsize{33}{35}\selectfont] at (30, -146) {Abcd \dotfill 100};
        \end{tikzpicture}
    \end{center}
\end{document}

有没有办法避免手动调整字母和数字之间的点?

答案1

您可以给节点一些宽度来填充点

\documentclass[landscape]{article}
\usepackage[a2paper]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[sfdefault]{noto}
\usepackage[T1]{fontenc}
\usepackage{fullpage}           
\usepackage{pgf,tikz}
\setlength\parindent{0pt}
\pagestyle{empty}

\begin{document}
    \begin{center}
        \vspace*{25mm}
        \begin{tikzpicture}[x=1mm, y=1mm]
        \clip[] (-2, 2) rectangle (452, -302);

        %\node[anchor=north] at (226, -5) {\includegraphics[height=90mm]{logo}};
        \draw[] (0, 0) rectangle (450, -300);

        \node[anchor=west, text width=300mm, font=\fontsize{33}{35}\selectfont] at (30, -110) {A \dotfill 1};
        \node[anchor=west, text width=300mm, font=\fontsize{33}{35}\selectfont] at (30, -128) {Abc \dotfill 10};
        \node[anchor=west, text width=300mm, font=\fontsize{33}{35}\selectfont] at (30, -146) {Abcd \dotfill 100};
        \end{tikzpicture}
    \end{center}
\end{document}

相关内容