tocloft 없이 LoT 또는 LoF의 조판을 복사하는 새로운 "List of..."를 만드는 쉬운 방법

tocloft 없이 LoT 또는 LoF의 조판을 복사하는 새로운 "List of..."를 만드는 쉬운 방법

나는 함께 일하는 사람들을 위한 템플릿을 만들려고 하는데, 그들은 테이블 목록과 그림 목록 외에 "개체 목록"을 원합니다. 그러나 그들은 "개체 목록"이 "그림 목록"과 완전히 동일한 형식을 갖기를 원합니다(적어도 목차 수준에서는 텍스트 내 개체 자체의 형식이 다른 문제입니다).

원래는 패키지를 사용하려고 했으나 tocloft목차 및 LoT/LoF를 조판하는 데 사용하는 다른 항목(특히 titlesectitletoc패키지를 사용하고 있음)과 모든 종류의 충돌이 있는 것 같습니다. 그러나 한동안 이 작업을 수행한 후 그들은 마침내 최근에 "개체 목록"이 LoF와 정확히 동일한 형식을 갖기를 원한다고 말했습니다. 이는 LoO에 필요한 모든 것을 신속하게 구축하기 위해 일종의 "이 명령을 기존 명령과 동일하게 정의"할 수 있는 것처럼 보입니다. 불행히도 나는 그 명령이 무엇인지 모릅니다. 나는 무엇을 꺼낼 수 있는지 알아보기 위해 tocloft를 파헤치는 중입니다. 해당 패키지는 매우 사용자 정의 가능한 "목록" 옵션을 만드는 데 맞춰져 있기 때문에 코드에는 필요한 것보다 훨씬 더 많은 것이 있으므로 템플릿으로 사용하기가 약간 어렵습니다.

LoF와 형식은 동일하지만 목록에 콘텐츠를 추가하는 별도의 명령을 사용하는 새로운 "... 목록"을 만드는 방법에 대한 제안 사항이 있습니까? 아니면 tocloft 패키지를 파헤치는 것보다 더 쉽게 그런 내용을 읽을 수 있는 곳은 어디입니까?

편집:: 댓글을 기반으로 합니다. 명확히 하기 위해 보고서 문서 클래스를 사용하고 있지만 가능하면 다른 패키지를 사용하지 않기를 바랐습니다. 단지 ToC, LoT 및 LoF의 조판 설정과 이를 다루는 다양한 패키지를 조정하기 위해 이미 일부 패키지를 사용했기 때문입니다. 이런 것들은 서로 잘 어울리지 않는 것 같습니다.

편집 2:: 내 cls에서 관련 코드를 꺼내어 일종의 MWE에 넣었습니다. 문제의 일부는 다른 패키지를 로드할 때 조판의 예기치 않은 재포맷을 방지하는 것이므로 현재 ToC/LoT/LoF를 조작하는 모든 것을 여기에 보관했기 때문에 다소 길었습니다. 다음은 MWE입니다(명확하게 말하자면 여기에 LoT/LoF를 모방하는 개체 목록을 추가하고 싶습니다). 코드는 명확성을 높이기 위해 많은 주석을 달았습니다.

\documentclass{report}
\makeatletter
\usepackage[linktoc=all]{hyperref}% Use this to provide intra-pdf hyperlinking and better toc
\hypersetup{%               %           Setup the coloring of the links. 
%                           %           Currently the only necessary one is "colorlinks=true" and "linkcolor=blue".
    colorlinks   = true,    %           Colours links instead of ugly boxes
    urlcolor     = blue,    %           Colour for external hyperlinks
    linkcolor    = blue,    %           Colour of internal links
    citecolor    = blue     %           Colour of citations, could be ``red''
    }

\usepackage{etoolbox}
\usepackage{tabularx}
\usepackage{xcolor}
\usepackage{amsthm,amssymb,amsmath}
\usepackage[format=hang,labelsep=period,justification=raggedright,font=singlespacing,singlelinecheck=false]{caption}
\usepackage{titlesec}%          Use this for the actual header styling
\usepackage{titletoc}%          Use this to manipulate Table of Contents styling
\usepackage{float}
%\RequirePackage[numbers]{natbib}

\usepackage[
    margin=1in,%            All 4 margins need to be one inch.
    paperheight=11in,%      We want 11in tall paper.
    paperwidth=8.5in%       And 8.5in wide paper.
    ]{geometry}%            Geometry package is the easiest way to deal with margins.


\providecommand{\realSingleSpace}{\setstretch{1}}%  They claim they want single-space, but what they actually want is 
%                                               "as little white space between letters as is visually acceptable".

%%%%%%%%%%%%%%%%
%%% Margins: %%%
%%%%%%%%%%%%%%%%
%%%                         They want 1 inch all around margins, which we do with the geometry package.
\usepackage[
    margin=1in,%            All 4 margins need to be one inch.
    paperheight=11in,%      We want 11in tall paper.
    paperwidth=8.5in%       And 8.5in wide paper.
    ]{geometry}%            Geometry package is the easiest way to deal with margins.

%% End Margin Config.

%%%%%%%%%%%%%%%%%%%%%
%%% Font Options: %%%
%%%%%%%%%%%%%%%%%%%%%
\raggedright%               They want a ragged right edge.
%% End Font Setting

%%%%%%%%%%%%%%%%%%%%%%
%%% Page Numbering %%%
%%%%%%%%%%%%%%%%%%%%%%
%%%                         They want the page number in arabic numerals in the bottom middle of each page.

\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand\headrulewidth{0pt}
\lhead{}\chead{}\rhead{}
\cfoot{\thepage}
\setlength{\footskip}{0.5in}%   They want the page number to be half an inch from the bottom. 
%                               This measurement is actually the distance to the text block; 
%                               So 1in margin - 0.5inch from botton = 0.5in footskip value.
%% End page numbering settings

%%%%%%%%%%%%%%%%%%%%
%%% Font Spacing %%%
%%%%%%%%%%%%%%%%%%%%

\usepackage[nodisplayskipstretch]{setspace}%    This will allow us to set spacing in general.
%                                                   The optional argument "nodisplayskipstretch" turns off doublespacing 
%                                                       for math display mode environments.
\usepackage{indentfirst}%                       This will make sure the first paragraph of every chapter is indented.
\doublespacing%                                     Make everything double spaced by default.
\preto\longtable{\par\realSingleSpace}%             Pre-append using longtables to make sure that tables are single spaced.
\preto\itemize{\par\realSingleSpace}%               Pre-append singlespace to itemize to account for 
%                                                       single space bullet point lists.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%    Formating Design    %%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%
%%% Caption Configuration TBD

\newcounter{figCount}%      This is an internal counter to track how many figures
\setcounter{figCount}{1}%   We will start at 1 due to how stepping it works.

\newcommand{\addFigure}[3][\Alph{figCount}]{%   Command to manually add a figure
    \parbox{#2\textwidth}{\centering #1 \\ \includegraphics[width=#2\textwidth]{#3}}
    \stepcounter{figCount}
    }

\newenvironment{multiFigure}% Environment that mimicks figure type environment,
%                               Except it doesn't float around and it resets figCount.
    {% Begin Environment Code
        \setcounter{figCount}{1}
        \minipage\textwidth
    }
    {% End Environment Code
        \endminipage
    }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Theorem environment definitions %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newtheorem{theorem}{Theorem}[chapter]
    \renewcommand{\thetheorem}{\thechapter-\arabic{theorem}}
\newtheorem{claim}{Claim}[chapter]
    \renewcommand{\theclaim}{\thechapter-\arabic{claim}}
\newtheorem{lemma}{Lemma}[chapter]
    \renewcommand{\thelemma}{\thechapter-\arabic{lemma}}


%%%%%%%%%%%%%%%%%%%%%%%%
%%% Table Formatting %%%
%%%%%%%%%%%%%%%%%%%%%%%%
%%% They want tables configured a certain way that makes the package "longtables" a more desirable option.
%   More specifically, from their website on text-flow:
%        Text must be continuous throughout the chapter. 
%        It is best to place all tables and figures at the end of the appropriate chapter. 
%        Avoid inserting them into the text of the chapter, unless you are able to do so 
%        without leaving blank gaps at the bottom of text pages.
%%%%%%%
\RequirePackage{longtable}
\RequirePackage{flafter}% This package stops tables from floating backward up the text. This stops weirdness like tables appearing before the section they are in within the source.

%% End table configure

%%%%%%%%%%%%%%%%%%%%%%%%
%%% Header Formatting %%%
%%%%%%%%%%%%%%%%%%%%%%%%
%%  Some headers by default have a huge margin between the top of the chapter text and the top margin, 
%       which the grad school doesn't like. So we use the titlesec package and the \titleformat command to 
%       directly access all aspects of chapters and parts to fix spacing, formating, and style.
\titlelabel{\thetitle . \quad}

\newif\ifdocBody
\docBodyfalse% Initially we aren't in the body yet.
%% Define chapter's style based on if we want chapters to auto-upper-case or not.

\titleformat{\chapter}[hang]
    {\uppercase}
    {}
    {0pt}
    {\centering\realSingleSpace\ifdocBody CHAPTER \thechapter \\[-5pt] \fi}
    [\raggedright\doublespacing]

\titleformat{\part}[hang]
    {}
    {}
    {0pt}
    {\centering\realSingleSpace\MakeUppercase}
    {\raggedright\doublespacing}


\titlespacing{\part}{0pt}{-0.7in}{0.5\baselineskip}

\titlespacing{\chapter}{0pt}{-0.7in}{0.5\baselineskip}

%%% Setup the formating for the actual section, subsection, and subsubsections in the text. We use the titlesec package here as it allows us to directly access the formating without having to renew the command and deal with all the code happening in the background for things like "table of contents" and pagebreaking.
%\titleformat*{\section}{\bfseries\center}% sections need to be bold and centered.


\setcounter{secnumdepth}{5}
\titleformat{\section}%
    {%
        \bfseries\center\realSingleSpace%       We want \section to be bold (\bfseries), centered (\center), 
    }%                                              and single spaced (\realSingleSpace)
    {%
        \thesection%                            The section number is held in \thesection
    }%
    {1em}%                                      The space between section number and text is the standard 1em
    {}%

\titleformat{\subsection}%
    {\bfseries\raggedright\realSingleSpace}%
    {\thesubsection}%
    {1em}{}%
\titleformat{\subsubsection}
    {
        \bfseries\filright\realSingleSpace%     We want \subsubsection to be bold (\bfseries), left-justified (\filright), 
    }%                                              and single spaced (\realSingleSpace)
    {
        \thesubsubsection%                      The section number is held in \thesubsubsection
    }
    {1em}%                                      The space between section number and text is the standard 1em
    {}

\titlespacing{\section}{0pt}{0pt}{0pt}
\titlespacing{\subsection}{0pt}{10pt}{0pt}
\titlespacing{\subsubsection}{0pt}{10pt}{0pt}
%% End of Header formating



%%%%%%%
%%% Table of Contents, List of Figures, and List of Tables fixes: They wanted hyperlinked dotted lines between the chapter name and the page number. They also want all uppercase "TABLE OF CONTENTS".
%%%%%%%

%% Fix the formatting of the various numbers.
\renewcommand*{\thefigure}{\thechapter-\arabic{figure}}%            Change the dot to a hyphen for list of figures.
\renewcommand*{\theequation}{\thechapter-\arabic{equation}}%        Change the equation to chapter - equation#
\renewcommand*{\thetable}{\thechapter-\arabic{table}}%              Change the dot to a hyphen for list of tables.



%%% Fix the titles of the "List Of ...", complete with adding the page/title at the top where applicable.
\renewcommand*\listfigurename{LIST OF FIGURES

    \underline{\smash{Figure}} \hfill \underline{\smash{page}}

    \vspace*{-0.7\baselineskip}
    }%

\renewcommand*\listtablename{LIST OF TABLES

    \underline{\smash{Tables}} \hfill \underline{\smash{page}}

    \vspace*{-0.7\baselineskip}
    }%

\renewcommand{\contentsname}{TABLE OF CONTENTS

    \hspace*{0pt}\hfill \underline{\smash{page}}

    \vspace*{-0.7\baselineskip}
    }%

\titlecontents{figure}[2em]
    {}
    {\hspace*{-2em}\hyper@linkstart{link}{\Hy@tocdestname}\hspace*{2em}{\contentslabel{2em}}\hyper@linkend}
    {}
    {\hyper@linkstart{link}{\Hy@tocdestname}{\titlerule*[5pt]{.}\thecontentspage}\hyper@linkend \\*\addvspace{8pt}}

\titlecontents{table}[2em]
    {}
    {\hspace*{-2em}\hyper@linkstart{link}{\Hy@tocdestname}\hspace*{2em}{\contentslabel{2em}}\hyper@linkend}
    {}
    {\hyper@linkstart{link}{\Hy@tocdestname}{\titlerule*[5pt]{.}\thecontentspage}\hyper@linkend \\*\addvspace{8pt}}

%%%% An attempt to do everything with titlesec and titletoc packages instead of using toclof package, to avoid package clashes.
\contentsmargin{0pt}

%%%%%%%
%%% Below is the formatting for all the Table of Contents hyperlinks, dotted lines, and horizontal alignment.

\titlecontents{part}[0em]
    {\mdseries}
    {\hyper@linkstart{link}{\Hy@tocdestname}{\contentslabel{2.3em}}\hyper@linkend}
    {}
    {}

\titlecontents{chapter}[0em]
    {}
    {\contentslabel{2em}}
    {}
    {\hyper@linkstart{link}{\Hy@tocdestname}{\titlerule*[5pt]{.}\thecontentspage}\hyper@linkend \\*\addvspace{8pt}}

\titlecontents{section}[4.1em]
    {}
    {\hspace*{-2em}\hyper@linkstart{link}{\Hy@tocdestname}\hspace*{2em}{\contentslabel{2em}}\hyper@linkend}
    {}
    {\hyper@linkstart{link}{\Hy@tocdestname}{\titlerule*[5pt]{.}\thecontentspage}\hyper@linkend \\*}

\titlecontents{subsection}[6.4em]
    {}
    {\hspace*{-2.3em}\hyper@linkstart{link}{\Hy@tocdestname}\hspace*{2.3em}{\contentslabel{2.3em}}\hyper@linkend}
    {}
    {\hyper@linkstart{link}{\Hy@tocdestname}{\titlerule*[5pt]{.}\thecontentspage}\hyper@linkend \\*}

\titlecontents{subsubsection}[9.4em]
    {}
    {\hspace*{-3em}\hyper@linkstart{link}{\Hy@tocdestname}\hspace*{3em}{\contentslabel{3em}}\hyper@linkend}
    {}
    {\hyper@linkstart{link}{\Hy@tocdestname}{\titlerule*[5pt]{.}\thecontentspage}\hyper@linkend \\*}

%\newenvironment{multiFigure}% Environment that mimicks figure type environment,
%%                               Except it doesn't float around and it resets figCount.
%    {% Begin Environment Code
%        \setcounter{figCount}{1}
%        \minipage\textwidth
%    }
%    {% End Environment Code
%        \endminipage
%    }
\begin{document}

답변1

내 댓글의 방식:

\documentclass{report}
\makeatletter
\usepackage[linktoc=all]{hyperref}% Use this to provide intra-pdf hyperlinking and better toc
\hypersetup{%               %           Setup the coloring of the links. 
%                           %           Currently the only necessary one is "colorlinks=true" and "linkcolor=blue".
    colorlinks   = true,    %           Colours links instead of ugly boxes
    urlcolor     = blue,    %           Colour for external hyperlinks
    linkcolor    = blue,    %           Colour of internal links
    citecolor    = blue     %           Colour of citations, could be ``red''
    }

\usepackage{etoolbox}
\usepackage{tabularx}
\usepackage{xcolor}
\usepackage{amsthm,amssymb,amsmath}
\usepackage[format=hang,labelsep=period,justification=raggedright,font=singlespacing,singlelinecheck=false]{caption}
\usepackage{titlesec}%          Use this for the actual header styling
\usepackage{titletoc}%          Use this to manipulate Table of Contents styling
\usepackage{float}
%\RequirePackage[numbers]{natbib}

\usepackage[
    margin=1in,%            All 4 margins need to be one inch.
    paperheight=11in,%      We want 11in tall paper.
    paperwidth=8.5in%       And 8.5in wide paper.
    ]{geometry}%            Geometry package is the easiest way to deal with margins.


\providecommand{\realSingleSpace}{\setstretch{1}}%  They claim they want single-space, but what they actually want is 
%                                               "as little white space between letters as is visually acceptable".

%%%%%%%%%%%%%%%%
%%% Margins: %%%
%%%%%%%%%%%%%%%%
%%%                         They want 1 inch all around margins, which we do with the geometry package.
\usepackage[
    margin=1in,%            All 4 margins need to be one inch.
    paperheight=11in,%      We want 11in tall paper.
    paperwidth=8.5in%       And 8.5in wide paper.
    ]{geometry}%            Geometry package is the easiest way to deal with margins.

%% End Margin Config.

%%%%%%%%%%%%%%%%%%%%%
%%% Font Options: %%%
%%%%%%%%%%%%%%%%%%%%%
\raggedright%               They want a ragged right edge.
%% End Font Setting

%%%%%%%%%%%%%%%%%%%%%%
%%% Page Numbering %%%
%%%%%%%%%%%%%%%%%%%%%%
%%%                         They want the page number in arabic numerals in the bottom middle of each page.

\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand\headrulewidth{0pt}
\lhead{}\chead{}\rhead{}
\cfoot{\thepage}
\setlength{\footskip}{0.5in}%   They want the page number to be half an inch from the bottom. 
%                               This measurement is actually the distance to the text block; 
%                               So 1in margin - 0.5inch from botton = 0.5in footskip value.
%% End page numbering settings

%%%%%%%%%%%%%%%%%%%%
%%% Font Spacing %%%
%%%%%%%%%%%%%%%%%%%%

\usepackage[nodisplayskipstretch]{setspace}%    This will allow us to set spacing in general.
%                                                   The optional argument "nodisplayskipstretch" turns off doublespacing 
%                                                       for math display mode environments.
\usepackage{indentfirst}%                       This will make sure the first paragraph of every chapter is indented.
\doublespacing%                                     Make everything double spaced by default.
\preto\longtable{\par\realSingleSpace}%             Pre-append using longtables to make sure that tables are single spaced.
\preto\itemize{\par\realSingleSpace}%               Pre-append singlespace to itemize to account for 
%                                                       single space bullet point lists.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%    Formating Design    %%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%
%%% Caption Configuration TBD

\newcounter{figCount}%      This is an internal counter to track how many figures
\setcounter{figCount}{1}%   We will start at 1 due to how stepping it works.

\newcommand{\addFigure}[3][\Alph{figCount}]{%   Command to manually add a figure
    \parbox{#2\textwidth}{\centering #1 \\ \includegraphics[width=#2\textwidth]{#3}}
    \stepcounter{figCount}
    }

\newenvironment{multiFigure}% Environment that mimicks figure type environment,
%                               Except it doesn't float around and it resets figCount.
    {% Begin Environment Code
        \setcounter{figCount}{1}
        \minipage\textwidth
    }
    {% End Environment Code
        \endminipage
    }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Theorem environment definitions %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newtheorem{theorem}{Theorem}[chapter]
    \renewcommand{\thetheorem}{\thechapter-\arabic{theorem}}
\newtheorem{claim}{Claim}[chapter]
    \renewcommand{\theclaim}{\thechapter-\arabic{claim}}
\newtheorem{lemma}{Lemma}[chapter]
    \renewcommand{\thelemma}{\thechapter-\arabic{lemma}}


%%%%%%%%%%%%%%%%%%%%%%%%
%%% Table Formatting %%%
%%%%%%%%%%%%%%%%%%%%%%%%
%%% They want tables configured a certain way that makes the package "longtables" a more desirable option.
%   More specifically, from their website on text-flow:
%        Text must be continuous throughout the chapter. 
%        It is best to place all tables and figures at the end of the appropriate chapter. 
%        Avoid inserting them into the text of the chapter, unless you are able to do so 
%        without leaving blank gaps at the bottom of text pages.
%%%%%%%
\RequirePackage{longtable}
\RequirePackage{flafter}% This package stops tables from floating backward up the text. This stops weirdness like tables appearing before the section they are in within the source.

%% End table configure

%%%%%%%%%%%%%%%%%%%%%%%%
%%% Header Formatting %%%
%%%%%%%%%%%%%%%%%%%%%%%%
%%  Some headers by default have a huge margin between the top of the chapter text and the top margin, 
%       which the grad school doesn't like. So we use the titlesec package and the \titleformat command to 
%       directly access all aspects of chapters and parts to fix spacing, formating, and style.
\titlelabel{\thetitle . \quad}

\newif\ifdocBody
\docBodyfalse% Initially we aren't in the body yet.
%% Define chapter's style based on if we want chapters to auto-upper-case or not.

\titleformat{\chapter}[hang]
    {\uppercase}
    {}
    {0pt}
    {\centering\realSingleSpace\ifdocBody CHAPTER \thechapter \\[-5pt] \fi}
    [\raggedright\doublespacing]

\titleformat{\part}[hang]
    {}
    {}
    {0pt}
    {\centering\realSingleSpace\MakeUppercase}
    {\raggedright\doublespacing}


\titlespacing{\part}{0pt}{-0.7in}{0.5\baselineskip}

\titlespacing{\chapter}{0pt}{-0.7in}{0.5\baselineskip}

%%% Setup the formating for the actual section, subsection, and subsubsections in the text. We use the titlesec package here as it allows us to directly access the formating without having to renew the command and deal with all the code happening in the background for things like "table of contents" and pagebreaking.
%\titleformat*{\section}{\bfseries\center}% sections need to be bold and centered.


\setcounter{secnumdepth}{5}
\titleformat{\section}%
    {%
        \bfseries\center\realSingleSpace%       We want \section to be bold (\bfseries), centered (\center), 
    }%                                              and single spaced (\realSingleSpace)
    {%
        \thesection%                            The section number is held in \thesection
    }%
    {1em}%                                      The space between section number and text is the standard 1em
    {}%

\titleformat{\subsection}%
    {\bfseries\raggedright\realSingleSpace}%
    {\thesubsection}%
    {1em}{}%
\titleformat{\subsubsection}
    {
        \bfseries\filright\realSingleSpace%     We want \subsubsection to be bold (\bfseries), left-justified (\filright), 
    }%                                              and single spaced (\realSingleSpace)
    {
        \thesubsubsection%                      The section number is held in \thesubsubsection
    }
    {1em}%                                      The space between section number and text is the standard 1em
    {}

\titlespacing{\section}{0pt}{0pt}{0pt}
\titlespacing{\subsection}{0pt}{10pt}{0pt}
\titlespacing{\subsubsection}{0pt}{10pt}{0pt}
%% End of Header formating



%%%%%%%
%%% Table of Contents, List of Figures, and List of Tables fixes: They wanted hyperlinked dotted lines between the chapter name and the page number. They also want all uppercase "TABLE OF CONTENTS".
%%%%%%%

%% Fix the formatting of the various numbers.
\renewcommand*{\thefigure}{\thechapter-\arabic{figure}}%            Change the dot to a hyphen for list of figures.
\renewcommand*{\theequation}{\thechapter-\arabic{equation}}%        Change the equation to chapter - equation#
\renewcommand*{\thetable}{\thechapter-\arabic{table}}%              Change the dot to a hyphen for list of tables.



%%% Fix the titles of the "List Of ...", complete with adding the page/title at the top where applicable.
\renewcommand*\listfigurename{LIST OF FIGURES

    \underline{\smash{Figure}} \hfill \underline{\smash{page}}

    \vspace*{-0.7\baselineskip}
    }%

\renewcommand*\listtablename{LIST OF TABLES

    \underline{\smash{Tables}} \hfill \underline{\smash{page}}

    \vspace*{-0.7\baselineskip}
    }%

\renewcommand{\contentsname}{TABLE OF CONTENTS

    \hspace*{0pt}\hfill \underline{\smash{page}}

    \vspace*{-0.7\baselineskip}
    }%

\titlecontents{figure}[2em]
    {}
    {\hspace*{-2em}\hyper@linkstart{link}{\Hy@tocdestname}\hspace*{2em}{\contentslabel{2em}}\hyper@linkend}
    {}
    {\hyper@linkstart{link}{\Hy@tocdestname}{\titlerule*[5pt]{.}\thecontentspage}\hyper@linkend \\*\addvspace{8pt}}

\titlecontents{table}[2em]
    {}
    {\hspace*{-2em}\hyper@linkstart{link}{\Hy@tocdestname}\hspace*{2em}{\contentslabel{2em}}\hyper@linkend}
    {}
    {\hyper@linkstart{link}{\Hy@tocdestname}{\titlerule*[5pt]{.}\thecontentspage}\hyper@linkend \\*\addvspace{8pt}}

%%%% An attempt to do everything with titlesec and titletoc packages instead of using toclof package, to avoid package clashes.
\contentsmargin{0pt}

%%%%%%%
%%% Below is the formatting for all the Table of Contents hyperlinks, dotted lines, and horizontal alignment.

\titlecontents{part}[0em]
    {\mdseries}
    {\hyper@linkstart{link}{\Hy@tocdestname}{\contentslabel{2.3em}}\hyper@linkend}
    {}
    {}

\titlecontents{chapter}[0em]
    {}
    {\contentslabel{2em}}
    {}
    {\hyper@linkstart{link}{\Hy@tocdestname}{\titlerule*[5pt]{.}\thecontentspage}\hyper@linkend \\*\addvspace{8pt}}

\titlecontents{section}[4.1em]
    {}
    {\hspace*{-2em}\hyper@linkstart{link}{\Hy@tocdestname}\hspace*{2em}{\contentslabel{2em}}\hyper@linkend}
    {}
    {\hyper@linkstart{link}{\Hy@tocdestname}{\titlerule*[5pt]{.}\thecontentspage}\hyper@linkend \\*}

\titlecontents{subsection}[6.4em]
    {}
    {\hspace*{-2.3em}\hyper@linkstart{link}{\Hy@tocdestname}\hspace*{2.3em}{\contentslabel{2.3em}}\hyper@linkend}
    {}
    {\hyper@linkstart{link}{\Hy@tocdestname}{\titlerule*[5pt]{.}\thecontentspage}\hyper@linkend \\*}

\titlecontents{subsubsection}[9.4em]
    {}
    {\hspace*{-3em}\hyper@linkstart{link}{\Hy@tocdestname}\hspace*{3em}{\contentslabel{3em}}\hyper@linkend}
    {}
    {\hyper@linkstart{link}{\Hy@tocdestname}{\titlerule*[5pt]{.}\thecontentspage}\hyper@linkend \\*}

%\newenvironment{multiFigure}% Environment that mimicks figure type environment,
%%                               Except it doesn't float around and it resets figCount.
%    {% Begin Environment Code
%        \setcounter{figCount}{1}
%        \minipage\textwidth
%    }
%    {% End Environment Code
%        \endminipage
%    }



%koleygr: ADDED CODE UNTILL BEGIN DOCUMENT:

\usepackage{pgffor}

\newfloat{object}{H}{objs}[chapter]


\newcounter{objCounter}

\renewcommand{\thefigure}{\thechapter-\arabic{figure}}
\renewcommand{\thetable}{\thechapter-\arabic{table}}
\renewcommand{\theobject}{\thechapter-\arabic{objCounter}}
\AtBeginDocument{%
\let\oldcaptionof\captionof
\renewcommand\captionof[2]{%
\xdef\MyObj{object}
\xdef\ArgA{#1}
\ifx\ArgA\MyObj
\refstepcounter{objCounter}\oldcaptionof{#1}{#2}\label{Obj:\arabic{objCounter}}%
\else
\oldcaptionof{#1}{#2}
\fi
}
}
\makeatletter
\newcommand\TableOfObjects{%
\setstretch{3} 
\begin{center}
    LIST OF OBJECTS
\end{center}

\underline{\smash{Objects}}\hfill\underline{\smash{page}}

\vspace{0.5cm}

\foreach \i in {1,...,100}{
\@ifundefined{r@Obj:\i}
{\breakforeach}
{\noindent\ref{Obj:\i}\hspace{7pt}\nameref{Obj:\i}\hyperref[Obj:\i]{\dotfill}\pageref{Obj:\i}\\}
}
}
\makeatother

\begin{document}
\listoffigures
\listoftables
\TableOfObjects

\chapter{First Chapter}
\begin{minipage}{\textwidth}
\centering
\captionof{table}{test table 1}
\end{minipage}
\begin{minipage}{\textwidth}
\centering
\captionof{figure}{test figure 1}
\end{minipage}
\begin{minipage}{\textwidth}
\centering
\captionof{table}{test table 2}
\end{minipage}
\begin{figure}
    \centering
    \captionof{figure}{test figure 2}
    \label{fig:my_label}
\end{figure}

\chapter{Second Chapter}
\begin{minipage}{\textwidth}
\centering
\captionof{table}{test table 3}
\end{minipage}
\begin{minipage}{\textwidth}
\centering
\captionof{object}{test object 1}
\end{minipage}
\begin{minipage}{\textwidth}
\centering
\captionof{object}{test object 2}
\end{minipage}
\begin{object}
    \centering
    \captionof{object}{test object 3}
    \label{fig:my_label}
\end{object}

\chapter{ThirdChapter}
\begin{minipage}{\textwidth}
\centering
\captionof{table}{test table 1}
\end{minipage}
\begin{minipage}{\textwidth}
\centering
\captionof{figure}{test figure 1}
\end{minipage}
\begin{minipage}{\textwidth}
\centering
\captionof{table}{test table 2}
\end{minipage}
\begin{figure}
    \centering
    \captionof{figure}{test figure 2}
    \label{fig:my_label}
\end{figure}

\end{document}

산출:

여기에 이미지 설명을 입력하세요

관련 정보