자신의 and fancy sub 명령을 만드는 방법
문제
패키지를 사용하고 있습니다 subfigure
그리고 float
내가 만들고 싶은 그림과 테이블을 만들고 내 자신의 환경을 만들려고 노력하고 있습니다. graph
자체 카운터와 캡션으로 (거기에서 해결되었습니다, DMCKEE에 감사합니다). 이제 만들고 싶습니다 \subgraph
정확히 동일하게 수행하는 명령 \subfigure
명령.
Propreate 카운터로 내 명령을 만들려고했습니다.여기에 도움이되었습니다, Alexey에게 감사합니다). 그러나 사용하면 문제가 나타납니다 \ref
명령. 참조 \subfigure
보고 2.1 (a) 그러나 참조 \subgraph
보고 1.
내가 이것을 해결하는 방법을 찾으려고 노력했을 때 나는 읽었다 subfig
내가 찾은 곳 \newsubfloat
예제와 함께 명령. 첫 번째 오류가 사용 중입니다 subfig
의 명령 subfigure
그리고 나는 거기에 갇혔다. 내가 사용하는 경우 subfigure
액세스 할 수 있습니다 \subfigure
그러나 강요 할 수 없습니다 \subgraph
내가 사용할 때 일합니다 subfig
나는 갈 수있다 \subfloat
안에 graph
그러나 그렇지 않습니다 figure
그리고 \ref
보고 1.0A 대신에 1.1 (a).
의 정의 subfig
패키지:
\newfloat{graph2}{tbph}{lom}[chapter]
\restylefloat*{graph2}
\floatstyle{plain}
\floatname{grap2}{Graph2}
\captionsetup[graph2]{position=top}
\newcommand{\listofGraphs}{\listof{Graph2}{List of Graphs}}
\newsubfloat[position=bottom,listofformat=subsimple]{graph2}
내 자신의 정의 \subgraph
\newfloat{graph1}{H}{lop}[chapter]
\floatname{graph1}{Graph1}
\newcounter{GraphOne}[graph1]
\def\theGraphOne{\alph{GraphOne}}
\newcommand{\subgraph}[2][]{
\captionof{subGraph}{#1} #2
}
\newfloat{subGraph}{H}{lop}[graph1]
\floatname{subGraph}{}
방법을 이해하도록 도와주세요 \label
그리고 \ref
명령은 작동합니다 (내 솔루션이 무너지기 때문에 \label
전입니다 \caption
) 및/또는 강제력 subfig
내가 원하는대로 작동하는 패키지.
어떤 아이디어에 감사하고 내 영어에 자비 롭습니다.
크로울리
개선:
사용하여 caption
패키지 새 카운터를 만들 수 있습니다 (subGraph
) 그리고 환경 밖에서 사용하십시오. 카운터 (서브 그래프 및 그래프)를 모두 사용하는 방법 유일한 방법은 사용 중입니다. \captionof{graph}
~ 전에 \subgraph
.
그래서 내 새로운 질문은 다음과 같습니다. \captionof{graph}
아래의 하위 그래프와 조판 전에? 그리고 강요하는 방법 \ref
1.1.1 대신 1.1-A를 표시합니다
ATACTEMENTS :
코드 subfigure
: (반환 <chapter>
.<figure>
(<subfigure>
) 옳은.
\begin{figure}
\subfigure[sub-caption]{\includegraphics{fig1}\label{fig:1}}
\caption{main caption}
\end{figure}
\ref{fig:1}
코드 subfig
: (반환 <chapter>
.<graph2>-1<subfigure>
) 잘못된.
\begin{graph2}
\subfloat[sub-caption]{\includegraphics{fig1}\label{fig:2}}
\caption{main caption}
\end{graph2}
\ref{fig:2}
내 코드 : (반환 <chapter>
.<graph1>
.<subgraph>
그러나 캡션은 동일한 "주소"를 보여줍니다)
\begin{graph1}
\captionof{graph1}{main caption}
\subgraph[sub-caption]{\includegraphics{fig1}\label{fig:3}}
\end{graph1}
\ref{fig:3}
해결책
나는 당신을 생각합니다 subfig
해결책은 작동해야합니다 (subfigure
어쨌든 더 이상 사용되지 않습니다). 잘못된 참조 문제는 귀하와 관련이있을 수 있습니다. 사용 \label
틀리게. 당신은 있어야합니다 \label
명령 ~ 후에 그만큼 \caption
, 또는 그것의 일부로 :
\begin{figure}
\caption{A Figure}
\label{fig}
\end{figure}
또는
\begin{figure}
\caption{A Figure%
\label{fig}}
\end{figure}
편집하다: 다음은 "나를 위해 일한다". 내가 말했듯이 \label
후에 \caption
:
\documentclass{report}
\usepackage{float}
\usepackage{subfig}
\newfloat{graph2}{tbph}{lom}[chapter]
\restylefloat*{graph2}
\floatstyle{plain}
\floatname{grap2}{Graph2}
\captionsetup[graph2]{position=top}
\newcommand{\listofGraphs}{\listof{Graph2}{List of Graphs}}
\newsubfloat[position=bottom,listofformat=subsimple]{graph2}
\begin{document}
\chapter{Test}
\section{Test s}
\begin{graph2}
\subfloat[sub-caption]{\fbox{Fig 1}}
\caption{main caption}
\label{fig:1}
\end{graph2}
\begin{graph2}
\subfloat[sub-caption]{\fbox{Fig 2}}
\caption{main caption}
\label{fig:2}
\end{graph2}
Graph~\ref{fig:1} is the first graph, and~\ref{fig:2} is the second.
\end{document}
이것은 생성됩니다 :
Graph 1.1 is the first graph, and 1.2 is the second.
다른 팁
지금은 정교 할 수는 없지만 addTocounter 대신 refstepcounter를 사용하고 싶습니다.