我需要修改 TikZ 海报中的图形标题,但每个常见的解决方案都不起作用。
Fig.
我只需要修改图片下方的单词即可Rys.
。我的努力如下,请参见以百分号 (%) 开头的文本:
\documentclass[a1paper,14pt,portrait, margin=0pt, colspace=10pt,subcolspace=0pt,blockverticalspace=24pt,innermargin=50pt]{tikzposter}
\usepackage[latin9,utf8]{inputenc}
\usepackage{graphicx}
\tikzposterlatexaffectionproofoff
\usetikzlibrary{shapes.geometric,arrows.meta,positioning}
% \renewcommand*{\figurename}{Rys.}{} % It does not work :<
% \renewcommand{\figurename}{Rys.} % not work
% \makeatletter
% \renewcommand*{\figurename}{Rys. \thefigure}
% \makeatother % Those three line also not work
% \usepackage[figurename=Rys.]{caption} % Not work
\begin{document}
\begin{center}
\begin{tikzfigure}[Moja geometria]
\includegraphics[width=0.7\linewidth, keepaspectratio]{Figures/Sample.png}
\label{ilu1}
\end{tikzfigure}
\end{center}
\end{document}
我感到非常惊讶,因为例如那一行非常完美:
\renewcommand\refname{Bibliografia}
答案1
图形必须放在块中。如果不想使用tikzfigure
来定义标题,可以使用\captionof{figure}{<text>}
(package captionof
)。这样就\renewcommand{\figurename}{Rys.}
可以了。
% !TeX TS-program = pdflatex
\documentclass[a1paper,14pt,portrait, margin=0pt, colspace=10pt,subcolspace=0pt,blockverticalspace=24pt,innermargin=50pt]{tikzposter}
\usepackage[latin9,utf8]{inputenc}
\usepackage{graphicx}
\tikzposterlatexaffectionproofoff
\usetikzlibrary{shapes.geometric,arrows.meta,positioning}
\renewcommand{\figurename}{Rys.} % it works
\usepackage{capt-of} % added <<<<<<<<<<
\begin{document}
\block{}{%
\begin{center}
\includegraphics[width=0.7\linewidth, keepaspectratio]{example-image}
\captionof{figure}{Moja geometria}\label{ilu1}
\end{center}
}
\end{document}
另外,您可以重新定义tikzfigure
该类使用的环境:
% !TeX TS-program = pdflatex
\documentclass[a1paper,14pt,portrait, margin=0pt, colspace=10pt,subcolspace=0pt,blockverticalspace=24pt,innermargin=50pt]{tikzposter}
\usepackage[latin9,utf8]{inputenc}
\usepackage{graphicx}
\tikzposterlatexaffectionproofoff
\usetikzlibrary{shapes.geometric,arrows.meta,positioning}
\renewenvironment{tikzfigure}[1][]{% like https://tex.stackexchange.com/a/315059/161015
%% #1 Caption
\def \rememberparameter{#1}
\vspace{10pt}
\refstepcounter{figurecounter}
\begin{center}
}{%
\ifx\rememberparameter\@empty
\else %
\\[10pt]
{\small Rys.~\thefigurecounter: \rememberparameter}% changed <<<<
\fi
\end{center}
}
\begin{document}
\block{}{%
\begin{tikzfigure}[Moja geometria]
\label{ilu1}
\includegraphics[width=0.2\linewidth, keepaspectratio]{example-image}
\end{tikzfigure}
}
\end{document}