如何调整 tikz 节点中的文本?

如何调整 tikz 节点中的文本?

节点中的文本左对齐。如何才能使其对齐?

\documentclass[20pt]{extarticle}
\usepackage[utf8]{inputenc}
\usepackage{geometry}
\geometry{paperheight=50cm,paperwidth=50cm,margin=3mm}
\usepackage{tikz, pgfornament, tikzrput}
\usetikzlibrary{shapes,positioning,decorations.markings}
\usepackage{bookman}
\PassOptionsToPackage{dvipsnames,svgnames}{xcolor} 
\usepackage{pdfrender}
\usepackage{pdfpages}
\makeatletter
\DeclareRobustCommand{\regmark}{\raisebox{1.13ex}{%
\fontsize{.4\dimexpr\f@size pt}\z@\selectfont\textregistered}%
 }
 \makeatother
\begin{document}
\centering
{
\begin{tikzpicture}
\begin{scope}[color=black,
                every node/.style={inner sep=0pt}]
\node[minimum size=12cm](vecbox){}; 
 \node[anchor=north west, yshift=10cm, xshift=-18.2cm] at (vecbox.north west)
  {\pgfornament[width=5cm]{61}};
  \node[anchor=north east, yshift=10cm, xshift=18.5cm] at (vecbox.north east)
  {\pgfornament[width=5cm,symmetry=v]{61}};
  \node[anchor=south west, yshift=-27cm, xshift=-18.2cm] at (vecbox.south west)
  {\pgfornament[width=5cm, symmetry=h]{61}};
  \node[anchor=south east, yshift=-27cm, xshift=18.5cm] at (vecbox.south east)
  {\pgfornament[width=5cm,symmetry=c]{61}};
  \end{scope}
  \node (example-textwidth-2) [text width=42cm, font=\fontsize{40pt}{40pt}  \selectfont] at (0.4,-7) {%
  {\textbf{INGREDIENTS:} WATER, SODIUM LAURETH SULFATE, SODIUM LAURYL SULFATE, COCAMIDOPROPYL BETANE, SODIUM CHLORIDE, DECYL GLUCOSIDE, FRAGRANCE, DMDM HYDANTION, PEG-120 METHYLGLUCOSE DIOLEATE, COCAMIDE MEA, POLYQUARTERNIUM-7 TETRASODIUM EDTA, PEG-7 GLYCERYL COCATE, CITRIC ACID, DC RED NO.33, FDC BLUE}
 };
 \draw [line width=3mm,   black] (-14,-14) -- (14,-14) node [right] {};
 \draw [line width=3mm,   black] (-14,0) -- (14,0) node [right] {};
 \begin{scope}
  \newcommand{\CloudDist}{1.8}
   \tikzstyle {cloudkeys} = [cloud puffs=15, cloud puff arc=150, aspect=4, inner sep=.01cm] 
   \tikzstyle {mycloud}   = [draw, cloud, cloudkeys, fill=white, opaque, xshift=0cm, yshift=10cm] 
    \coordinate (cloud 0);
    \foreach \x in {0} {
   \node [mycloud, scale=1] at (cloud \x) (local map cloud shape \x){\textcolor{black}{\Huge\textbf{The Miracle}}};
    }
   \end{scope}
   \end{tikzpicture}
    }
    \end{document}

证明合法

答案1

我很乐意删除它。此外,align=justify您可能希望删除空格并用相应的结构font=\fontsize{40pt}{40pt} \selectfont替换。\tikzstyle\tikzset

\documentclass[20pt]{extarticle}
\usepackage[utf8]{inputenc}
\usepackage{geometry}
\geometry{paperheight=50cm,paperwidth=50cm,margin=3mm}
\usepackage{tikz, pgfornament, tikzrput}
\usetikzlibrary{shapes,positioning,decorations.markings}
\usepackage{bookman}
\PassOptionsToPackage{dvipsnames,svgnames}{xcolor} 
\usepackage{pdfrender}
\usepackage{pdfpages}
\makeatletter
\DeclareRobustCommand{\regmark}{\raisebox{1.13ex}{%
\fontsize{.4\dimexpr\f@size pt}\z@\selectfont\textregistered}%
 }
 \makeatother
\begin{document}
\centering
{
\begin{tikzpicture}
\begin{scope}[color=black,
                every node/.style={inner sep=0pt}]
\node[minimum size=12cm](vecbox){}; 
 \node[anchor=north west, yshift=10cm, xshift=-18.2cm] at (vecbox.north west)
  {\pgfornament[width=5cm]{61}};
  \node[anchor=north east, yshift=10cm, xshift=18.5cm] at (vecbox.north east)
  {\pgfornament[width=5cm,symmetry=v]{61}};
  \node[anchor=south west, yshift=-27cm, xshift=-18.2cm] at (vecbox.south west)
  {\pgfornament[width=5cm, symmetry=h]{61}};
  \node[anchor=south east, yshift=-27cm, xshift=18.5cm] at (vecbox.south east)
  {\pgfornament[width=5cm,symmetry=c]{61}};
  \end{scope}
  \node (example-textwidth-2) [text width=42cm, font=\fontsize{40pt}{40pt}\selectfont,
  align=justify] at (0.4,-7) {%
  \textbf{INGREDIENTS:} WATER, SODIUM LAURETH SULFATE, SODIUM LAURYL SULFATE, COCAMIDOPROPYL BETANE, SODIUM CHLORIDE, DECYL GLUCOSIDE, FRAGRANCE, DMDM HYDANTION, PEG-120 METHYLGLUCOSE DIOLEATE, COCAMIDE MEA, POLYQUARTERNIUM-7 TETRASODIUM EDTA, PEG-7 GLYCERYL COCATE, CITRIC ACID, DC RED NO.33, FDC BLUE
 };
 \draw [line width=3mm,   black] (-14,-14) -- (14,-14) node [right] {};
 \draw [line width=3mm,   black] (-14,0) -- (14,0) node [right] {};
 \begin{scope}
  \newcommand{\CloudDist}{1.8}
   \tikzset{cloudkeys/.style={cloud puffs=15, cloud puff arc=150, aspect=4,
   inner sep=.01cm},
   mycloud/.style={draw, cloud, cloudkeys, fill=white, opaque, xshift=0cm,
   yshift=10cm}}
    \coordinate (cloud 0);
    \foreach \x in {0} {
   \node [mycloud, scale=1] at (cloud \x) (local map cloud shape \x){\textcolor{black}{\Huge\textbf{The Miracle}}};
    }
 \end{scope}
\end{tikzpicture}
}
\end{document}

在此处输入图片描述

相关内容