我已经提交了代码供参考
\documentclass[11pt,a4paper,oneside]{article}
\usepackage{latexsym}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{amssymb,gensymb}
\usepackage{tikz}
%\usepackage{subfig}
%\usepackage{graphicx}
%\usepackage[dvips]{graphicx}
%\usepackage{subfigure}
% % % % % % % % % % % % % % % % % % % % % % % %added package
\usepackage{multirow,array, amsmath, caption, booktabs,amssymb}
\usepackage{epstopdf}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{url, lipsum}
\usepackage{hhline}
\usepackage[colorlinks=true,backref=true,linkcolor={black},anchorcolor={black},citecolor={black},urlcolor={blue},breaklinks=true]{hyperref}
\usepackage{blindtext}
% % % % % % % % % % % % % % % % % % % % % % %
\usepackage[boxed,lined,linesnumbered]{algorithm2e}
\graphicspath{ {Images/} }
\linespread{1.1}
\usepackage[top=.8in, bottom=.8in, left=0.8in, right=0.8in]{geometry}
\newcolumntype{C}[1]{>{\centering\arraybackslash}m{#1}}
\newcolumntype{L}[1]{>{\raggedright\arraybackslash}m{#1}}
\newcolumntype{R}[1]{>{\raggedleft\arraybackslash}m{#1}}
\newcommand\myrule{\par\smallskip\hrule\medskip}
\usetikzlibrary{decorations.pathmorphing,trees, decorations.markings, arrows, arrows.meta,positioning, shapes.arrows,shadows.blur}
\def\etal{\textit{et~al.}}
\def\eg{\textit{e.g.}}
\def\ie{\textit{i.e.}}
\def\etc{\textit{etc.}}
%%%%%%%%%%%%%Road Map%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{tikz,pgfgantt}
\usepackage[inline]{enumitem}
\usepackage{xcolor}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewenvironment{abstract}
{\par\noindent\textbf{\abstractname \newline}\ \ignorespaces}
{\par\medskip}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\nodetextx}[2]{$i_{#2}$}
\newcommand{\nodetextz}[2]{$o_#2$}
\newcommand{\nodetexth}[2]{$h_{#1,#2}$}
\makeatletter
\define@key{layer}{layercolor} {\def\nnlayercolor{#1}}
\makeatother
\tikzstyle{hiddencl}=[neuron, fill=\nnlayercolor, draw=black]
\newcommand{\hiddenlayercolor}[1][] { \layer[bias=true,nodeclass={hiddencl},#1] }
\tikzstyle{inputcl}=[neuron, fill=\nnlayercolor, draw=black]
\newcommand{\inputlayercolor}[1][] { \layer[bias=true,nodeclass={inputcl},#1] }
\tikzstyle{outputcl}=[neuron, fill=\nnlayercolor, draw=black]
\newcommand{\outputlayercolor}[1][] { \layer[bias=true,nodeclass={outputcl},#1] }
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\pagestyle{plain}
\sloppy
\begin{figure}
\centering
\usetikzlibrary{arrows.meta, calc, fit, positioning}
\tikzset{block11/.style={fill=yellow!20,draw, thick, text width=11cm,align=justify,inner sep=0.6cm}, font={\fontsize{45pt}{12}\selectfont}, line/.style={-latex}}
\tikzset{block1/.style={fill=yellow!20,draw, thick, text width=9cm,align=center,inner sep=0.6cm}, font={\fontsize{45pt}{12}\selectfont}, line/.style={-latex}}
\tikzset{block2/.style={fill=yellow!20,draw, thick, text width=9cm,align=left,inner sep=0.4cm}, font={\fontsize{45pt}{12}\selectfont}, line/.style={-latex}}
\tikzset{block/.style={fill=blue!15,draw, thick, text width=10cm,align=center,minimum width=11cm,minimum height = 4cm},font={\fontsize{45pt}{12}\selectfont},
line/.style={-latex}}
\tikzset{blocks/.style={fill=yellow!20,draw, thick, text width=11cm,align=center,inner sep=0.8cm}, font={\fontsize{45pt}{12}\selectfont}, line/.style={-latex}}
%\newcommand{\midarrow}{\tikz \draw[-triangle 90] (0,0) -- +(-.1,0);}
\resizebox{\columnwidth}{!}{
\begin{tikzpicture}
\node[ellipse, draw,text width=15cm,fill=red!15,text centered,font={\fontsize{45pt}{12}\selectfont}] (w1) at (-3,9) {\textbf{XYZ} \\ \vspace{0.6cm} \textit{``qwerty werwe \\[0.4cm] quiet Guard?"} };
\node[ellipse, draw,minimum width = 30cm, minimum height = 15cm,fill=red!15,font={\fontsize{45pt}{12}\selectfont}] (w2) at (-3,-15) {};
\node[minimum width = 1cm, minimum height = 0.5cm,text centered,font={\fontsize{45pt}{12}}] (p) at (-3,-9) {\textbf{Output}};
\node[block1] (q) at (-9,-12) {\textit{Bran}, \textbf{\textt{wrerw}}};
\node[block1,right=of q] (r) {\textit{haue}, \textbf{\textt{dfs}}};
\node[block1,below=of r]at (-9,-13) (s) {\textit{you}, \textbf{\textt{sdf}}};
\node[block1,right= of s] (t) {\textit{bad}, \textbf{\textt{vdxv}}};
\node[block1,below= of t] at (-9,-16) (u) {\textit{quiet}, \textbf{\textt{dsf}}};
\node[block1,right=of u] (v) {\textit{Guard}, \textbf{\textt{sdf}}};
\node[rectangle, draw,minimum width =15cm, minimum height =14cm] (ik) at (30,8) {};
\node[minimum width = 1cm, minimum height = 0.5cm,text centered,font={\fontsize{100pt}{12}\selectfont}] (a) at (30,14) { \textbf{Process}};
\node[blocks] (b) at (30,10) {\textit{fsdfsde \\[0.4cm] you sdf \\[0.2cm] sdf?}};
\node[blocks] (c) at (30,4) {\textit{wsd sdf u \\[0.4cm] dsfsdfsd sdfsd}};
\node[rectangle, draw,minimum width =27cm, minimum height =22cm] (jk) at (31.14,-16) {};
\node[minimum width = 1cm, minimum height = 0.5cm,text centered,font={\fontsize{45pt}{12}\selectfont}] (d) at (30,-6.4) {\textbf{Word egdf}};
\node[block11] (d) at (24.5,-10.28) {\textit{df} = [-0.106,\\[0.4cm] 0.789, -0.130]};
\node[block11,right=of d] (e) {\textit{fdf} = [-0.211, \\[0.4cm]-0.094, -0.246]};
\node[block11,below=of e]at (24.5,-13) (f) {\textit{you} = [0.277, \\[0.4cm]-0.049,-0.477]};
\node[block11,right= of f] (g) {\textit{df} = [-0.014, \\[0.4cm]0.387, -0.348]};
\node[block11,below= of g] at (24.5,-19.5) (h) {\textit{dfd} = [0.184, \\[0.3cm]-0.025, -0.600]};
\node[block11,right=of h] (i) {\textit{Guardfd} = [0.211, \\[0.3cm]-0.324, -0.230]};
\node[rectangle, draw,minimum width =15cm, minimum height =35cm] (lk) at (60,-5) {};
\node[minimum width = 5cm, minimum height = 0.5cm,text centered,font={\fontsize{45pt}{12}\selectfont}] (j) at (60,11) {\textbf{dfgh}};
\node[block] (k) at (60,7) {fgh};
\node[block] (l) at (60, 1) {Bi-hjhn};
\node[block] (m) at (60,-5) {uyi};
\node[block] (n) at (60,-11) {yuir};
\node[block] (o) at (60,-17) {tyui};
\node[rectangle, draw,minimum width =52cm, minimum height =45cm] (oo) at (43,-5) {};
\draw[->, arrowhead=0.3in, line width=6pt] (w1) -- (17,9);
\draw[->, arrowhead=0.3in, line width=6pt] (30,1) -- (30,-5);
\draw[->, arrowhead=0.3in, line width=6pt] (jk) -- (52.5,-15.7);
\begin{scope}[very thick, every node/.style={sloped,allow upside down}]
\draw [-, arrowhead=0.3in, line width=6pt](-3.5,-30)-- node {\midarrow} (60,-30);
\draw[-, arrowhead=0.3in, line width=6pt] (60,-30)-- node {\midarrow} (60,-22.5);
%\draw (4,2)-- node {\midarrow} (-4,2);
\draw[<-, arrowhead=0.3in, line width=6pt] (-3.5,-22.5)-- node {\midarrow} (-3.5,-30);
\end{scope}
\end{tikzpicture}}
\caption{\textcolor{blue}{Drawere}}
\label{fig:Draweer}
\end{figure}
\end{document}
答案1
您面临的问题在于您使用 Ti 定义的图片钾Z 很大,您尝试使用缩小它,\resizebox
这也会减小字体大小。您尝试通过增加字体大小来抵消此行为。但是,LaTeX 不允许您任意增加字体大小。
解决这个问题的最好方法是用 Ti 创建绘图钾Z 使用相对(无单位)尺寸,因此是可扩展的。可惜的是,由于tikzpicture
您提供的已经以使用绝对尺寸的方式定义,因此这肯定会花费大量工作。
为了提供快速的解决方案,您应该加载anyfontsize
允许您使用\fontsize
任何您想要的字体大小的包,即使那些不是由您使用的字体官方提供的字体。
除此之外,你的代码中还有很多奇怪的事情。
- 该
\fontsize
宏采用两个参数,这两个参数已解析为 pt。因此,您在这里只需使用整数即可。 - 相反
\textt{}
,您可能想写\texttt[}
。 - 选项
arrowhead
是该软件包的弃用选项arrows.meta
。您应该使用-{>[width=0.3in]}
而不是->, arrowhead=0.3in
。 - 该宏
\midarrow
未定义,因为您在代码中将其注释掉了。
我修正了上述内容,删除了本示例不需要的所有包,并添加了 Ti钾Z 库shapes
,但其他方面代码保持不变:
\documentclass[11pt,a4paper,oneside]{article}
\usepackage{anyfontsize}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing,trees, decorations.markings, arrows, arrows.meta,positioning, shapes.arrows,shadows.blur, shapes}
\tikzstyle{hiddencl}=[neuron, fill=\nnlayercolor, draw=black]
\newcommand{\hiddenlayercolor}[1][] { \layer[bias=true,nodeclass={hiddencl},#1] }
\tikzstyle{inputcl}=[neuron, fill=\nnlayercolor, draw=black]
\newcommand{\inputlayercolor}[1][] { \layer[bias=true,nodeclass={inputcl},#1] }
\tikzstyle{outputcl}=[neuron, fill=\nnlayercolor, draw=black]
\newcommand{\outputlayercolor}[1][] { \layer[bias=true,nodeclass={outputcl},#1] }
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\pagestyle{plain}
\sloppy
\begin{figure}
\centering
\usetikzlibrary{arrows.meta, calc, fit, positioning}
\tikzset{block11/.style={fill=yellow!20,draw, thick, text width=11cm,align=justify,inner sep=0.6cm}, font={\fontsize{45}{12}\selectfont}, line/.style={-latex}}
\tikzset{block1/.style={fill=yellow!20,draw, thick, text width=9cm,align=center,inner sep=0.6cm}, font={\fontsize{45}{12}\selectfont}, line/.style={-latex}}
\tikzset{block2/.style={fill=yellow!20,draw, thick, text width=9cm,align=left,inner sep=0.4cm}, font={\fontsize{45}{12}\selectfont}, line/.style={-latex}}
\tikzset{block/.style={fill=blue!15,draw, thick, text width=10cm,align=center,minimum width=11cm,minimum height = 4cm},font={\fontsize{45}{12}\selectfont},
line/.style={-latex}}
\tikzset{blocks/.style={fill=yellow!20,draw, thick, text width=11cm,align=center,inner sep=0.8cm}, font={\fontsize{45}{12}\selectfont}, line/.style={-latex}}
\newcommand{\midarrow}{\tikz \draw[-triangle 90] (0,0) -- +(-.1,0);}
\resizebox{\columnwidth}{!}{
\begin{tikzpicture}
\node[ellipse, draw,text width=15cm,fill=red!15,text centered,font={\fontsize{45}{12}\selectfont}] (w1) at (-3,9) {\textbf{XYZ} \\ \vspace{0.6cm} \textit{``qwerty werwe \\[0.4cm] quiet Guard?"} };
\node[ellipse, draw,minimum width = 30cm, minimum height = 15cm,fill=red!15,font={\fontsize{45}{12}\selectfont}] (w2) at (-3,-15) {};
\node[minimum width = 1cm, minimum height = 0.5cm,text centered,font={\fontsize{45}{12}}] (p) at (-3,-9) {\textbf{Output}};
\node[block1] (q) at (-9,-12) {\textit{Bran}, \textbf{\texttt{wrerw}}};
\node[block1,right=of q] (r) {\textit{haue}, \textbf{\texttt{dfs}}};
\node[block1,below=of r]at (-9,-13) (s) {\textit{you}, \textbf{\texttt{sdf}}};
\node[block1,right= of s] (t) {\textit{bad}, \textbf{\texttt{vdxv}}};
\node[block1,below= of t] at (-9,-16) (u) {\textit{quiet}, \textbf{\texttt{dsf}}};
\node[block1,right=of u] (v) {\textit{Guard}, \textbf{\texttt{sdf}}};
\node[rectangle, draw,minimum width =15cm, minimum height =14cm] (ik) at (30,8) {};
\node[minimum width = 1cm, minimum height = 0.5cm,text centered,font={\fontsize{100}{12}\selectfont}] (a) at (30,14) { \textbf{Process}};
\node[blocks] (b) at (30,10) {\textit{fsdfsde \\[0.4cm] you sdf \\[0.2cm] sdf?}};
\node[blocks] (c) at (30,4) {\textit{wsd sdf u \\[0.4cm] dsfsdfsd sdfsd}};
\node[rectangle, draw,minimum width =27cm, minimum height =22cm] (jk) at (31.14,-16) {};
\node[minimum width = 1cm, minimum height = 0.5cm,text centered,font={\fontsize{45}{12}\selectfont}] (d) at (30,-6.4) {\textbf{Word egdf}};
\node[block11] (d) at (24.5,-10.28) {\textit{df} = [-0.106,\\[0.4cm] 0.789, -0.130]};
\node[block11,right=of d] (e) {\textit{fdf} = [-0.211, \\[0.4cm]-0.094, -0.246]};
\node[block11,below=of e]at (24.5,-13) (f) {\textit{you} = [0.277, \\[0.4cm]-0.049,-0.477]};
\node[block11,right= of f] (g) {\textit{df} = [-0.014, \\[0.4cm]0.387, -0.348]};
\node[block11,below= of g] at (24.5,-19.5) (h) {\textit{dfd} = [0.184, \\[0.3cm]-0.025, -0.600]};
\node[block11,right=of h] (i) {\textit{Guardfd} = [0.211, \\[0.3cm]-0.324, -0.230]};
\node[rectangle, draw,minimum width =15cm, minimum height =35cm] (lk) at (60,-5) {};
\node[minimum width = 5cm, minimum height = 0.5cm,text centered,font={\fontsize{45}{12}\selectfont}] (j) at (60,11) {\textbf{dfgh}};
\node[block] (k) at (60,7) {fgh};
\node[block] (l) at (60, 1) {Bi-hjhn};
\node[block] (m) at (60,-5) {uyi};
\node[block] (n) at (60,-11) {yuir};
\node[block] (o) at (60,-17) {tyui};
\node[rectangle, draw,minimum width =52cm, minimum height =45cm] (oo) at (43,-5) {};
\draw[-{>[width=0.3in]}, line width=6pt] (w1) -- (17,9);
\draw[-{>[width=0.3in]}, line width=6pt] (30,1) -- (30,-5);
\draw[-{>[width=0.3in]}, line width=6pt] (jk) -- (52.5,-15.7);
\begin{scope}[very thick, every node/.style={sloped,allow upside down}]
\draw [-, line width=6pt](-3.5,-30)-- node {\midarrow} (60,-30);
\draw[-, line width=6pt] (60,-30)-- node {\midarrow} (60,-22.5);
%\draw (4,2)-- node {\midarrow} (-4,2);
\draw[{<[width=0.3in]}-, line width=6pt] (-3.5,-22.5)-- node {\midarrow} (-3.5,-30);
\end{scope}
\end{tikzpicture}}
\caption{\textcolor{blue}{Drawere}}
\label{fig:Draweer}
\end{figure}
\end{document}