
저는 LaTeX를 처음 접했지만 LaTeX를 사용하여 석사 논문을 작성하려고 시도했습니다. 나는 pgfplots 패키지를 사용하여 여러 플롯을 만들어 왔습니다. 그러나 이러한 그래프를 그림 환경에 삽입하여 참조하고 캡션을 추가하려고 하면 오류가 발생합니다. 이상하게도 이 환경 밖에서는 완벽하게 작동합니다. 다음은 플롯 중 하나의 예입니다.
\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},