
그래서 중앙 수치뿐만 아니라 여백 수치에도 배치하려고 합니다. 그리고 마진 수치의 경우 다음과 같이 만들고 싶습니다.
하지만 중앙 그림의 경우 캡션 레이블을 아래 그림과 같이 하고 싶습니다. 숫자는 장에서 가져온 것이고 그림 번호는 1로 갱신됩니다.
각각에 대해 만들어 보았지만 둘 중 하나만이 될 뿐입니다. 두 가지를 모두 시도하면 서문 오류가 발생합니다. 내가 도대체 뭘 잘못하고있는 겁니까? 알려주세요. 아래 MWE:
\documentclass[graybox,envcountchap,sectrefs,12pt]{svmono}
\usepackage[utf8]{inputenc}
\usepackage[labelfont=bf,sf,font=small,figurewithin=chapter]{caption}
\captionsetup{labelformat=empty,skip=1pt,font={bf,sf}}
\usepackage{chngcntr}
\counterwithout{figure}{chapter}
\begin{document}
\chapter{Introduction to Chemistry Laboratory}
\marginpar{
\centering
\includegraphics[width=2cm,height=2.75cm]{Beaker.png}
\captionof{figure}{Beaker}
}
\begin{figure}
\centering
\begin{tikzpicture}
\foreach \x in {0,1,...,2}{
\draw (\x,0) -- (\x,-0.2)node[below,scale=0.4]{\x};
}
\foreach \x in {0.1,0.2,...,1.9}{
\draw (\x,0) -- (\x,-0.075);
}
\foreach \x in {0.5,1,...,1.5}{
\draw (\x,0) -- (\x,-0.15);
};
\draw (0,0)--(2,0);
\draw[fill=lightgray] (0,0.05) rectangle (1.625,0.45);
\end{tikzpicture}
\captionsetup{labelsep=period,labelformat={simple}}
\caption{This}\label{fig:1}
\end{figure}
\end{document}
답변1
위의 의견을 답변으로 요약하면 다음과 같습니다.
여백의 이미지에 텍스트를 추가하려면 를 사용하지 않고 텍스트를 입력하기만 하면 됩니다 \captionof
. 모든 집 텍스트에 통일된 스타일을 적용하려면 다음 MWE에서 했던 것처럼 고유한 명령을 정의할 수 있습니다.
장 번호로 다른 그림에 번호를 매기려면 그림 번호를 제거 \counterwithout{chapter}{figure}
하고 을 제거하세요 \usepackage{chngcntr}
. 수업 svmono
기본값은 장당 그림, 표, 방정식에 번호를 매기는 것입니다.
다음 MWE에서는 패키지와 관련된 모든 항목도 제거했습니다 caption
. 사용하는 문서 클래스는 출판사에서 제공한 것이므로 게시하려면 출판사의 디자인 선택을 고수해야 할 수도 있습니다.
graybox
또한 유효한 클래스 옵션이 아니므로 해당 경고를 표시하므로 제거했습니다 .
마지막으로 이미지 왜곡을 방지하려면 이미지의 너비 또는 높이를 지정하는 것이 좋습니다.
\documentclass[envcountchap,sectrefs,12pt]{svmono}
\usepackage[utf8]{inputenc}
%\usepackage[labelfont=bf,sf,font=small,figurewithin=chapter]{caption}
%\captionsetup{labelformat=empty,skip=1pt,font={bf,sf}}
\usepackage[demo]{graphicx} % Remove demo option in actual document.
\usepackage{tikz}
\newcommand{\unnumberedcaption}[1]{\bfseries \sffamily #1}
\begin{document}
\chapter{Introduction to Chemistry Laboratory}
\marginpar{
\centering
\includegraphics[width=2cm,height=2.75cm]{Beaker.png}
\unnumberedcaption{Beaker}
}
\begin{figure}
\centering
\begin{tikzpicture}
\foreach \x in {0,1,...,2}{
\draw (\x,0) -- (\x,-0.2)node[below,scale=0.4]{\x};
}
\foreach \x in {0.1,0.2,...,1.9}{
\draw (\x,0) -- (\x,-0.075);
}
\foreach \x in {0.5,1,...,1.5}{
\draw (\x,0) -- (\x,-0.15);
};
\draw (0,0)--(2,0);
\draw[fill=lightgray] (0,0.05) rectangle (1.625,0.45);
\end{tikzpicture}
%\captionsetup{labelsep=period,labelformat={simple}}
\caption{This}\label{fig:1}
\end{figure}
\end{document}