
私は LaTeX を使い始めたばかりですが、修士論文を LaTeX を使って書こうとしています。pgfplots パッケージを使っていくつかのグラフを作成しています。しかし、これらのグラフを Figure 環境に挿入して参照し、キャプションを追加しようとすると、エラーが発生します。不思議なことに、この環境外ではグラフはまったく問題なく動作します。以下はグラフの 1 つの例です。
\documentclass[a4paper,12pt,oneside,onecolumn,final,fleqn]{repUERJ}
% ---
% Packages
% ---
\usepackage[brazil]{babel}
\usepackage[utf8]{inputenc}
\usepackage{makeidx}
\usepackage{hyperref}
\usepackage{indentfirst}
\usepackage{graphicx}
\usepackage{subfig}
\usepackage{amsmath}
\usepackage{chemformula}
\usepackage{pgfplots}
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{trees}
\pgfplotsset{compat=newest}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{spy}
\usepackage{textcomp} %trademark
% ---
% College model
% ---
\usepackage[frame=no,algline=yes,font=default]{repUERJformat}
\usepackage{repUERJpseudocode}
% ---
% Citations packages
% ---
\usepackage[alf]{abntex2cite}
%newcommands
\newcommand{\inputgraph}[2]{% #1 = file, #2 = graph name %https://tex.stackexchange.com/questions/378607/using-input-to-insert-a-section-of-a-document-into-another
\long\def\GRAPH ##1#2 {}%
\input{#1}
}
\let\ENDGRAPH\endinput
\begin{document}
\begin{figure}
\caption{Caption}
\label{fig:enter-label}
\begin{tikzpicture} %Plot
\begin{axis}[
title={},
xlabel={Time (days)},
ylabel={UFC/g},
xmin=0, xmax=30,
legend pos= outer north east,
legend style={font=\tin},
grid style=dashed,
]
\addplot[
color=cyan,
mark=square,
error bars/.cd, y dir=both, y explicit
]
coordinates {
(7,56400) +- (0,90)
(14,9730) +- (0,90)
(21,1570) +- (0,70)
(28,12500) +- (0,90)
};
\addplot[
color=red,
mark=square,
error bars/.cd, y dir=both, y explicit
]
coordinates {
(7,0)
(14,0)
(21,0)
(28,0)
};
\legend{Blank, \ch{H2SO4}}
\end{axis}
\end{tikzpicture}
\end{figure}
\end{document}
前にも述べたように、私は LaTeX の初心者なので、ここでは最もエレガントなソリューションを使用していない可能性があります。テキストを大学の形式に適合させるために、さまざまなパッケージを使用しています。多少乱雑に見えた場合はお詫び申し上げます。
答え1
参照してください最小限の動作例 (MWE) を書くように求められましたが、それは何ですか?MWE の書き方については、こちらをご覧ください。
と書いた場合legend style={font=\tin},
、おそらく次のことを意味しているでしょう:
legend style={font=\tiny},