
저는 회사의 현재 요구 사항을 반영하는 사용자 정의 보고서 클래스를 개발하는 데 어려움을 겪고 있습니다. 목표는 사람들이 기술적인 내용을 보고하기 위한 주요 도구로 LaTeX를 사용하도록 장려하는 것입니다. 진입 문턱을 최대한 낮추고 싶습니다. 그렇기 때문에 모든 서식을 관리하는 클래스가 좋은 생각인 것 같습니다. 거의 다 왔지만 각 부록의 사용자 정의 표지와 관련된 문제를 해결하려면 여러분의 지원이 필요합니다. 현재 코드를 사용하면 다음과 같은 결과를 얻을 수 있습니다.
하지만 저는 이것을 얻고 싶습니다(프레임 내 선택적 그림, ToC는 다른 페이지로 이동합니다).
나는 이것이 주요 문서의 표지와 비슷해 보인다는 것을 알고 있지만... 어쨌든.
내 수업:
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{myreport}[2018/08/29 My report LaTeX class]
\DeclareOption{twocolumn}{\OptionNotUsed}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{report}}
\ProcessOptions\relax
\LoadClass[onecolumn, 10pt]{report}
\RequirePackage[a4paper, left=2.5cm,right=2.5cm,top=2cm,bottom=3.5cm]{geometry}
\RequirePackage[toc, title]{appendix}
\RequirePackage{xpatch}
\RequirePackage{etoc}
\RequirePackage{lastpage}
\RequirePackage{fancyhdr}
\RequirePackage{xcolor}
%*********************************************************
% CUSTOM COLORS
%*********************************************************
\definecolor{MyBlue}{RGB}{0,65,101}
%*********************************************************
% SECTION REDEFINITION
%*********************************************************
\renewcommand\chapter{\@startsection {chapter}{1}{\z@}%
{-3.5ex \@plus -1ex \@minus -.2ex}%
{2.3ex \@plus.2ex}%
{\normalfont\Large\bfseries\color{MyBlue}}}
\renewcommand\section{\@startsection {section}{2}{\z@}%
{-3.5ex \@plus -1ex \@minus -.2ex}%
{2.3ex \@plus.2ex}%
{\normalfont\large\bfseries\color{MyBlue}}}
\renewcommand\subsection{\@startsection{subsection}{3}{\z@}%
{-3.25ex\@plus -1ex \@minus -.2ex}%
{1.5ex \@plus .2ex}%
{\normalfont\normalsize\bfseries\color{MyBlue}}}
\renewcommand\subsubsection{\@startsection{subsubsection}{4}{\z@}%
{-3.25ex\@plus -1ex \@minus -.2ex}%
{1.5ex \@plus .2ex}%
{\normalfont\normalsize\bfseries\color{MyBlue}}}
\renewcommand\paragraph{\@startsection{paragraph}{5}{\z@}%
{3.25ex \@plus1ex \@minus.2ex}%
{-1em}%
{\normalfont\normalsize\bfseries}}
\renewcommand\subparagraph{\@startsection{subparagraph}{6}{\parindent}%
{3.25ex \@plus1ex \@minus .2ex}%
{-1em}%
{\normalfont\normalsize\bfseries}}
%*********************************************************
% COUNTERS FOR FIGURES AND TABLES INCLUDE SECTION NUMBER
%*********************************************************
\setcounter{secnumdepth}{4} %depth for numbering
\counterwithin{figure}{chapter}
\counterwithin{table}{chapter}
%*********************************************************
% CUSTOM APPENDIX
%*********************************************************
\renewcommand\appendixname{Appendix}
\renewcommand\appendixtocname{Appendices}
\renewcommand\appendixpagename{Appendix}
%redefinition of appendices environment from 'appendix' package
%this set up ToC depth
\let\oldappendices\appendices
\def\appendices{\oldappendices\etocdepthtag.toc{mtappendix}\etocsettagdepth{mtchapter}{none}\etocsettagdepth{mtappendix}{subsection}}
%*********************************************************
% TITLE PAGE
%*********************************************************
\renewcommand*{\maketitle}{%
\thispagestyle{empty}
\begin{center}
\bfseries
\huge Main Title Of The Document
\vskip.5in
\LARGE Task title
\vskip.2in
\vskip.2in
\LARGE Rev no
\vspace{10cm}
\end{center}
\newpage
}
%*********************************************************
% HEADER AND FOOTER STYLE
%*********************************************************
\pagestyle{fancy}
\fancyhead{}
\renewcommand{\headrulewidth}{0pt} % no line in header area
\fancyfoot{} % clear all footer fields
\renewcommand{\footrule}{{\color{MyBlue}\vskip-\footruleskip\vskip-\footrulewidth \hrule width\headwidth height \footrulewidth\vskip\footruleskip}}
\renewcommand{\footrulewidth}{3pt}
\renewcommand\thefootnote{\textcolor{red}{\arabic{footnote}}}
\fancyfoot[RE,LO]{\footnotesize \textcolor{MyBlue} {\vskip.3cm TaskNo XXX \ - Rev.XXX}} % other info in "inner" position of footer line
\fancyfoot[LE,RO]{\footnotesize \textcolor{MyBlue} {\vskip.3cm Page \thepage\ of \pageref{LastPage}}} % page number in "outer" position of footer line
위의 클래스를 사용하는 예제 보고서는 다음과 같습니다.
\documentclass[a4paper, 10pt]{myreport}
\begin{document}
\maketitle %creates custom cover page
\tableofcontents %creates main table of content
\newpage %start first chapter from new page
%************************** INPUT DOCUMENT CONTENT **************************************
%******************************************************************************************
\chapter{Introduction}
Some text in main document.
%************************** APPENDICIES *************************************************
%******************************************************************************************
\begin{appendices}
\chapter{Additional information}
\localtableofcontents
\section{Section 1}
Some text
\section{Section 2}
Some text
\end{appendices}
\end{document}
이것은 단순화된 버전이지만 사례를 보여주기에는 충분하다고 생각합니다.
물론, 도움을 청하기 전에 제가 직접 해보려고 했는데, 결과가 알려지니까 여기까지 왔네요 :)
이것비슷한 주제인 것 같지만 나에게 적합하도록 만들 수는 없었습니다. 귀하의 의견에 감사드립니다. 감사해요!