Q&A 마당은 텍 관련 질문/답변을 위해 만들었습니다.
- 로그인 없이 자유롭게 글을 읽고 쓸 수 있는 철학은 처음과 같이 계속됩니다.
- 질문 전에 아래를 읽어 보세요. 좋은 질문이 좋은 답을 받을 수 있는 좋은 방법입니다.
- 질문에 맞는 제목을 붙이세요. 질문의 내용과 관련없는 "고수님", "긴급질문", "도와주세요"와 같은 제목은 답이 잘 올라오지 않습니다. 이 게시판에 올라오는 모든 글은 질문입니다. 굳이 [질문], [Q]를 적으실 필요도 없습니다.
- 내용을 충실히 적어 주시고, 같은 상황을 재현할 수 있는 최소한의 예제가 같이 있어야 합니다.
- 최소 예제는 "Minimal working example"을 읽어 보세요.
- 파일을 첨부하실 때에는 가능한 압축하여 파일 크기를 줄여서 올려주시길 바랍니다.
- 개인적으로 사용하신 글꼴이 들어 있는 경우, preparefont.sty에 관한 답변을 참조하세요.
- 스팸 글을 막기 위하여 짧은 시간 내에 다시 글이 등록되는 IP를 막거나, 광고 글을 막기 위하여 금지어로 .com, .net 등을 설정하고 있습니다. 다소간의 불편함이 있으시더라도 양해 바랍니다.
- 금지어에서 stackexchange, stackoverflow, ctan, overleaf, , github, google.com, gmail.com, .org, .io, sil.org, wiki.com, tistory.com등은 해제하였습니다.
- MathJax를 이용한 수식조판을 사용하실 수 있습니다. 여기를 참조하세요.
- 사용하는 편집기는 CKeditor입니다.
- 편집기에서 [enter]를 누르면 <p> 태그가 들어가고, 문단으로 생각하고 한 줄을 비웁니다.
- 글줄만 바꾸려면 [shift-enter]를 누르면 <BR> 태그가 들어가므로 용도에 맞게 나누어 쓸 수 있습니다.
- 수식를 문서내에 삽입하시려면 에디터를 툴바에서 [소스]를 눌러 HTML로 입력할 수 있게 바꾸신 후 <pre> </pre> tag를 사용하셔서 <pre> 여러 줄의 수식 </pre>처럼 입력하시면 좋습니다.
테이블과 그림 번호에 대하여 질문합니다.
2015.06.16 09:02
안녕하세요,
현재 레이텍으로 학위 논문을 쓰려고 합니다.
어려운 점이 많지만 문제를 하나 해결하면 또 다른 문제가 생기네요.ㅠㅠ
본론을 말씀드리자면,
제2장에서는 표 혹은 그림 목차가 2.1, 2.2, 2.3.... 이렇게 차례로 나옵니다. (chapter내에서는 순번으로 매겨집니다)
그런데 제3장에서는 표 혹은 그림 번호가 3.1, 3.2, 3.1, 3.1..... 이렇게 나옵니다. (section별로 순번이 다시 매겨집니다.)
왜 이런 현상이 나타나는지 모르겠네요.
혹시 논문이 길어서 그런가요? 아니면 다른 문제인가요?
자세한 파일은 논문내용과 관련된거라서 올리기는 힘듭니다. (죄송합니다.)
그래서 간추려서 올리려고 했더니 또 작동이 되는 것 같습니다.(ㅠㅠ)
아마 논문 내용이 길어서 중간에 어느 부분이 꼬였는지 모르겠습니다.
대신, 제가 사용한 *.cls 파일의 일부 내용과 제가 정의한 머리말 부분의 내용을 알려 드리오니 알려주시기 바랍니다.
감사합니다.
dissertation.cls 파일 내용:
% load default class and set default paper size and font size
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}}
\ProcessOptions\relax
\LoadClass[11pt,b5paper]{book}
% set default paper margin
\usepackage[margin=3cm]{geometry}
% packages for spacing
\usepackage{setspace}
% set default font and hangul packages
\usepackage{times}
\usepackage[hangul]{kotex}
\usepackage{ifpdf}
\ifpdf
\input{glyphtounicode} \pdfgentounicode=1
\fi
% set chapter, section presentation
% 제 1 장, 1.1, 1.1.1, 1.1.1.1 형식으로 연결되도록 함.
\usepackage[ensec]{dhucs-sectsty}
%\renewcommand\thesection{\thechapter.\arabic{section}}
\sectionfont{\fontsize{16}{16}\selectfont}
\subsectionfont{\fontsize{14}{14}\selectfont}
\subsubsectionfont{\fontsize{14}{14}\selectfont}
% redefine chapter inorder to remove vertical space between items in list of tables and figures.
\def\@chapter[#1]#2{
\ifnum \c@secnumdepth >\m@ne
\refstepcounter{chapter}%
\typeout{\@chapapp\space\thechapter.}%
\addcontentsline{toc}{chapter}{\protect\numberline{\Roman{chapter}}#2}%
\else
\addcontentsline{toc}{chapter}{#2}%
\fi
\chaptermark{#1}%
\addtocontents{lof}{\protect\addvspace{0\p@}}%
\addtocontents{lot}{\protect\addvspace{0\p@}}%
\if@twocolumn
\@topnewpage[\@makechapterhead{#2}]%
\else
\@makechapterhead{#2}%
\@afterheading
\fi}
% table and figure numbering for toc, lof, lot
\usepackage{chngcntr}
\counterwithout{figure}{section}%그림 순서 연속달기 섹션에 이
\counterwithout{table}{section} %%표 순서 연속달기 섹션에 이
\@removefromreset{figure}{chapter}
\renewcommand{\thefigure}{\arabic{chapter}.\arabic{figure}}
\@removefromreset{table}{chapter}
\renewcommand{\thetable}{\arabic{chapter}.\arabic{table}}
\usepackage[titles,subfigure]{tocloft}
\setlength{\cftchapnumwidth}{25pt}
\renewcommand{\cftchapaftersnum}{.}
\setlength{\cftbeforechapskip}{10pt}
\renewcommand{\cftchapleader}{\cftdotfill{\cftdotsep}}
\setlength{\cftfignumwidth}{50pt}
\renewcommand{\cftfigpresnum}{그림 }
\renewcommand{\cftfigaftersnum}{.}
\setlength{\cfttabnumwidth}{40pt}
\renewcommand{\cfttabpresnum}{표 }
\renewcommand{\cfttabaftersnum}{.}
% chage chapter header style
%\usepackage{titlesec}
\makeatletter
\renewcommand{\@makechapterhead}[1]{%
%\vspace*{30pt}
{\setlength{\parindent}{0pt} \raggedright \normalfont
\bfseries\fontsize{18}{18}\selectfont
\ifnum \value{secnumdepth}>1
\if@mainmatter제\ \thechapter\ 장\par \fi%
\fi
\vspace*{15pt}%
\bfseries\fontsize{20}{20}\selectfont
#1\par\nobreak\vspace{40pt}}}
\makeatother
\makeatletter
\renewcommand{\@makeschapterhead}[1]{%
%\vspace*{0pt}
{\setlength{\parindent}{0pt} \center \normalfont
\bfseries\fontsize{20}{20}\selectfont
#1\par\nobreak\vspace{40pt}}}
\makeatother
\newcommand{\clearpagebefore}{
\if@oneside
\clearpage
\else
\cleardoublepage
\fi
}
% customize column numbers for index section
\usepackage{makeidx}
\usepackage{multicol}
\makeatletter
\renewenvironment{theindex}
{\if@twocolumn
\@restonecolfalse
\else
\@restonecoltrue
\fi
\setlength{\columnseprule}{0pt}
\setlength{\columnsep}{35pt}
\begin{multicols}{2}[\chapter*{\indexname}] %Adjust the 2 for more columns
\markboth{\MakeUppercase\indexname}%
{\MakeUppercase\indexname}%
\thispagestyle{plain}
\setlength{\parindent}{0pt}
\setlength{\parskip}{0pt plus 0.3pt}
\relax
\let\item\@idxitem}%
{\end{multicols}\if@restonecol\onecolumn\else\clearpage\fi}
\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%여기까지는 *.cls파일 내용입니다
아래는 *.tex파일의 머리글입니다.
\documentclass[11pt,b5paper]{dissertation}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Too many packages, load this after \documentclass line.
\usepackage{etex}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% include additional packages you need to use
\usepackage{dhucs-trivcj}
%\usepackage{dhucs-enumerate}%한글식 카운터 형식 패키지
%%\begin{enumerate}[항목(가,ㄱ,㉠,㉮,(ㄱ),(가),①,(1),(a),ⓐ,i,I)]
\usepackage{dhucs-enumitem}%한글힉 카운터 패키지, 위에보다 더 많은 설정 가능.
\usepackage{here}
%use [H] option in figure and table environments to positioning them
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% 각 장에 부록을 절 형식으로 넣기,
\usepackage{appendix}
\usepackage{etoolbox}
\usepackage{lipsum}
\AtBeginEnvironment{subappendices}{%
\section*{부록}% 부록을 section 단계로 설정. {} 안에 원하는 이름 넣기
\addcontentsline{toc}{section}{부록}% 부록은 section 단계로 목차에 표기
%부록의 subsection counting에서 점이 2개 나오는 것을 1개로 바꾸고 숫자 대신 알파벳을 넣
%는것.
\renewcommand\thesubsection{\thesection\Alph{subsection}}
\counterwithin{figure}{subsection}% 부록 안에 내용은 subsection 단계
\counterwithin{table}{subsection}
}
%\newenvironment{subappendices}{%
% \@resets@ppsub
%}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% graphic, float package
\usepackage{graphicx} % for setting images
\usepackage{float} % for float objects
\usepackage{subfloat}
\usepackage{subfigure} % for adding several figures in a figure environment
\usepackage{lscape} % for landscape type images or tables
% mathmetical presentation
\usepackage{gensymb}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{mathptm}
\usepackage{exscale}
\usepackage{textcomp} % extra symbols
\usepackage{amsfonts}
% package for using algorithmic presentation
\usepackage{algorithmic}
\usepackage{algorithm}
% customize algorithmic environment
\renewcommand{\algorithmicrequire}{\makebox[40px]{\hfill\textbf{Input :}}}
\renewcommand{\algorithmicensure}{\makebox[40px]{\hfill\textbf{Output :}}}
% array and table presentation
\usepackage{array}
\usepackage{multirow}
\usepackage{multicol}
\usepackage[table]{xcolor}
\usepackage{ctable}
\usepackage{booktabs} % for typesetting tables at the level of publication
% do not use vertical rule
\usepackage{caption}
\captionsetup[table]{justification=centering} %표제목 중앙위치
\captionsetup[table]{labelsep=space} %표레이블과 제목사이 두점을 공백으로 대체
\captionsetup[figure]{justification=centering}%그림제목 중앙위치
\captionsetup[figure]{labelsep=space} %그림레이블과 제목사이 두점을 공백으로 대체
\usepackage{threeparttable}
\usepackage{longtable,supertabular}
\usepackage{dcolumn}
\newcolumntype{d}[1]{D{.}{.}{-1}}
%Horizontal and vertical dashed lines in arrays and tabulars. Horizontal lines are drawn by \hdashline and \cdashline while vertical ones can be specified as a part of preamble using
\usepackage{arydshln} %for
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{tikz}
% Optional PGF libraries
\usepackage{pgflibraryarrows}
\usepackage{pgflibrarysnakes}
\usetikzlibrary{intersections}
\usetikzlibrary{arrows} %incompatible with \usepackage{pgflibraryarrows}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{backgrounds}
\usetikzlibrary{positioning}
\usetikzlibrary{fit}
\usetikzlibrary{petri}
\usetikzlibrary{shapes.geometric}
\usetikzlibrary{calc}
\usetikzlibrary[positioning]
\usetikzlibrary{patterns}
\usetikzlibrary{circuits.ee.IEC}
\usetikzlibrary{circuits}
%%% draw symbol of generator
\tikzset{generator/.style={
circle,
draw,
append after command={
\pgfextra{
\draw
($(\tikzlastnode.center)!0.5!(\tikzlastnode.west)$)
arc[start angle=180,end angle=0,radius=0.705mm]
(\tikzlastnode.center)
arc[start angle=180,end angle=360,radius=0.705mm]
($(\tikzlastnode.center)!0.5!(\tikzlastnode.east)$)
;
}
},
scale=1.5,
}
}
%%% define new command, number with circled.
\newcommand*\circled[1]{\tikz[baseline=(char.base)]{
\node[shape=circle,draw,inner sep=.5pt] (char) {#1};}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% 표 셀 내용 줄 바꾸기 \tabincell{c}{}
\newcommand{\tabincell}[2]{\begin{tabular}{@{}#1@{}}#2\end{tabular}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% set document layout and default look and feel such spacings and indentations
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% set page layout, default margin is 3cm
\geometry{margin=3cm}
% set double spacing
\doublespacing
% set indentation
\setlength{\parindent}{2em}
% if you do not want indent first paragraph in each chapter, section, and sub sections
% remove below line
\usepackage{indentfirst}
% if you want to make vertical spaces between paragraphs,
% removfe comments the below line and change dime '10pt' as what you want
\setlength{\parskip}{10pt}
% adjust spacing below the caption
\setlength{\belowcaptionskip}{5pt}
% if you want to make index,
% use \makeindex in preamble,
% use \index at the word you want to index,
% and use \printindex where you want to print the index
\makeindex
% hyperref package can generate pdf references
% must be loaded at last
\usepackage[unicode]{hyperref}
% define new theorem like entities you need
\newtheorem{lemma}{Lemma}
\newtheorem{definition}{Definition}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% start thesis
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
% set page style as not generating page numbers
\pagestyle{empty}
% set page style as generating roman page numbers
\newpage
\pagestyle{plain}
\pagenumbering{roman}
\setcounter{page}{1}
%abstract page
\begin{abstract}
나의 논문 요약입니다.
\end{abstract}
% table of contents, list of figures and tables
% rename toc, lof, lot, and ref
\renewcommand{\contentsname}{목 차}
\renewcommand{\listfigurename}{그 림 목 차}
\renewcommand{\listtablename}{표 목 차}
\renewcommand{\refname}{참 고 문 헌}
\tableofcontents
\addcontentsline{toc}{chapter}{목차}
\listoffigures
\addcontentsline{toc}{chapter}{그림 목차}
\listoftables
\addcontentsline{toc}{chapter}{표 목차}
% set page style as generating arabic page numbers
\clearpagebefore
\pagenumbering{arabic}
\setcounter{page}{1}
\chapter{1장}
...............
댓글 5
-
yihoze
2015.06.16 09:33
\counterwithout{figure}{section}\counterwithout{table}{section}\renewcommand{\thefigure}{\arabic{chapter}.\arabic{figure}}\renewcommand{\thetable}{\arabic{chapter}.\arabic{table}}이것을 보면 그렇게 나올 수도 있겠다는 생각이 듭니다. 원하는 것을 말씀해 주세요. 섹션마다 그림과 표의 번호가 리셋되기를 원하시나요? 그렇다면\renewcommand{\thefigure}{\arabic{section}.\arabic{figure}}\renewcommand{\thetable}{\arabic{section}.\arabic{table}}이렇게 하면 될 것 같습니다. -
텍사랑
2015.06.16 09:55
빠른 답변 감사합니다.
저는 그냥 chapter 별로 그림과 표의 번호가 리셋되기를 원합니다.
님 말씀대로 돌려봤더니, 그림과 표의 번호가 섹션별로 나오는데 chapter 번호는 안 나옵니다.
이는 아마 제가 앞서 dissertation.cls에서
\renewcommand\thesection{\thechapter.\arabic{section}} 앞에 %를 붙여서 무효화 시켜서 그런것 같습니다.
그리고 2장에서는 section별로 번호가 리셋되는데 3장에서는 subsection 별로 번호가 리셋됩니다.
다시 말해서 저의 원래 오류현상이 한 단계 낮아져서 발생하게 됩니다.
저의 추측인 것 같은데요,
머리말 부분에 제가 chapter별로 부록을 넣기 위해서 다시 정의한 명령구절이 몇개 있습니다.
\usepackage{appendix}
\usepackage{etoolbox}
\usepackage{lipsum}
\AtBeginEnvironment{subappendices}{%
\section*{부록}% 부록을 section 단계로 설정. {} 안에 원하는 이름 넣기
\addcontentsline{toc}{section}{부록}% 부록은 section 단계로 목차에 표기
%부록의 subsection counting에서 점이 2개 나오는 것을 1개로 바꾸고 숫자 대신 알파벳을 넣
%는것.
\renewcommand\thesubsection{\thesection\Alph{subsection}}
\counterwithin{figure}{subsection}% 부록 안에 내용은 subsection 단계
\counterwithin{table}{subsection}
}
여기서 부록을 section 수준으로 정의하고 부록1, 부록2 등등을 subsection 급에 준하기 위해서 그림과 표를 부록 내의 subsection 내에서 정의하라고 했는데 혹시 여기서 문제가 생기지 않았는지 궁금합니다.
저도 이 부분을 조금씩 수정해서 테스트 해봤는데 아마 문구가 다른 것과 충돌되어 그런지 원하는 대로 안 나옵니다.
혹시 이 부분의 section, subsection 단계 부분을 다시 재정의 할 수 있을가요?
빠른 답변 다시 한번 감사드립니다.
-
텍사랑
2015.06.16 10:08
참고로 저의 현상이 2장과 3장 내용을 바꾸었을 때,
오류 현상이 역전이 된다는 것입니다.
즉 이 현상이 앞 장에서 부록을 chapter에 소속된 section 단계로 넣으면서 발생된 것으로 추정됩니다.
혹시 머리글에서 정의한 이 부분을
부록을 section 단계로 지정하고,
부록 내에 소절로 나누는 subsection을 다른 명령구로 바꿀수가 있는지요?
물론 저의 추측이 틀릴 수도 있습니다.
고수님들의 의견을 부탁합니다.
감사합니다.
-
nanim
2015.06.16 10:12
소스가 없어서 장님 문고리잡기 식 추측성 답변이 될 수밖에 없겠지만,
의심가는 것은
\counterwithin{figure}{subsection}% 부록 안에 내용은 subsection 단계
\counterwithin{table}{subsection}
이 부분입니다. 그 이후로 계속 영향을 미친 듯하네요.
부록이 끝나는 지점에서 이것을 원래대로 돌려놓으시는 것이 좋겠군요.
\counterwithout{figure}{subsection}
\counterwithout{table}{subsection}
\counterwithin{figure}{chapter}
\counterwithin{table}{chapter}
웬만큼 커뮤니케이션이 될만한 샘플이 아쉽습니다.
-
텍사랑
2015.06.16 10:41
와~~~ 해결 됐네요.
알려 주신대로
chapter 3 가 시작되기 전에
주신 네 문구를 넣으니 표와 그림 순서가 제대로 복귀 되었습니다.
nanim, 정말 감사합니다.
그리고 앞서 빠른 답변해주신 yihoze님께도 감사드립니다.
앞으로도 계속해서 열심히 텍을 사용하고 능력만큼 좋은 팁들을 공유하겠습니다.코텍이 번창하시기를 바랍니다~~