如何更改 TikZ 中的背景颜色?

如何更改 TikZ 中的背景颜色?

如何在 tikz 类中更改纸张颜色(背景颜色)请帮助我更改颜色

在此处输入图片描述

\documentclass{scrartcl}
\usepackage[usenames,x11names,dvipsnames,svgnames]{xcolor}
\usepackage{graphicx,amsmath,latexsym,amssymb,amsthm,geometry}
\usepackage{tikz}
\usepackage{pagecolor}% http://ctan.org/pkg/{pagecolor,lipsum}
\usetikzlibrary{decorations, decorations.text}
% tight page
\usepackage[active,tightpage]{preview}
\PreviewEnvironment{tikzpicture}
%
\begin{document}%

\begin{tikzpicture}
        % outer circle
            \draw[line width=2 mm,color=black,fill=white!10] circle[radius=7cm];
        % outer text
            \path[
                postaction={
                    decoration={raise=.1ex,
                        text along path,
                        text format delimiters={|}{|},
                        text={%
                            |\Huge\bfseries\color{black}|
                          name name {\textbullet} name {\textbullet} name name name name name
                        },
                        text align=fit to path,
                        reverse path
                    },
                    decorate
                }
            ]
             (0:6.2cm) arc (0:360:6.2cm);
\draw[line width=2 mm,color=black,fill=white!10] circle[radius=5.8cm];
% central text
\node[color=Brown3] at (0, 1){\includegraphics[width=4.5cm]{14}};
\end{tikzpicture}%
\end{document} 

答案1

添加\usetikzlibrary{backgrounds}

\begin{tikzpicture}[background rectangle/.style={fill=olive!45}, show background rectangle]

代码:

\documentclass{scrartcl}
\usepackage[usenames,x11names,dvipsnames,svgnames]{xcolor}
\usepackage{graphicx,amsmath,latexsym,amssymb,amsthm,geometry}
\usepackage{tikz}
\usepackage{pagecolor}% http://ctan.org/pkg/{pagecolor,lipsum}
\usetikzlibrary{decorations, decorations.text,backgrounds}
% tight page
\usepackage[active,tightpage]{preview}
\PreviewEnvironment{tikzpicture}
%
\begin{document}%

\begin{tikzpicture}[background rectangle/.style={fill=olive!45}, show background rectangle]
        % outer circle
            \draw[line width=2 mm,color=black,fill=white!10] circle[radius=7cm];
        % outer text
            \path[
                postaction={
                    decoration={raise=.1ex,
                        text along path,
                        text format delimiters={|}{|},
                        text={%
                            |\Huge\bfseries\color{black}|
                          name name {\textbullet} name {\textbullet} name name name name name
                        },
                        text align=fit to path,
                        reverse path
                    },
                    decorate
                }
            ]
             (0:6.2cm) arc (0:360:6.2cm);
\draw[line width=2 mm,color=black,fill=white!10] circle[radius=5.8cm];
% central text
\node[color=Brown3] at (0, 1){\includegraphics[width=4.5cm]{example-image}};
\end{tikzpicture}%
\end{document} 

在此处输入图片描述

相关内容