애플리케이션 노트 스타일

애플리케이션 노트 스타일

저는 애플리케이션 노트 스타일을 설정하려고 하는데, 이것이 제가 지금까지 생각해낸 것입니다:

\documentclass[a4paper,twocolumn,twoside,11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[]{Chivo}
\usepackage{verbatim}
\usepackage{xcolor}
\usepackage{tabularx}
\usepackage{pgf, tikz}
\usepackage{mathrsfs}
\usepackage{verbatim}
\usepackage{lastpage}

\usetikzlibrary{shapes, calc, shapes, arrows, babel}

\usepackage{amsmath, amssymb, textcomp}
\everymath{\displaystyle}


\usepackage{eurosym}

\usepackage{graphicx}
\graphicspath{{./img/}}
\usepackage{svg}
\usepackage{lipsum}

\usepackage{hyperref}

% custom header/footer
\usepackage{fancyhdr}
%\pagestyle{fancy}
\makeatletter
\newcommand{\logo}{\includegraphics[width=0.6\columnwidth]{logo.png}}
\newcommand{\logosmall}{\includegraphics[width=0.3\columnwidth]{logo.png}}
\newcommand{\claim}{©YYYY Company name, Inc. All rights reserved.\\ Trademarks and registered trademarks are the\\\vspace{-6pt} property of their respective owners.}
\newcommand{\website}{www.companysite.com}
\renewcommand{\date}[1]{\gdef\@date{#1}}
\newcommand*{\revision}[1]{\gdef\@revision{#1}}
\newcommand*{\code}[1]{\gdef\@code{#1}}
\newcommand*{\type}[1]{\gdef\@type{#1}}
%
%
% First page
%
\fancypagestyle{first}{
    \renewcommand{\familydefault}{\sfdefault}
    \setlength\headheight{47pt}
    %\renewcommand{\topmargin}{0pt}
    \fancyhead[L]{\logo}
    \fancyhead[R]{%
    \huge{\bf{%
    \@code\\
    \@type
    }}}%
    \renewcommand{\headrulewidth}{2pt}
    \headrule
    %
    \fancyfoot[L]{\@date}
    \fancyfoot[C]{\@revision}
    \fancyfoot[R]{Page~\thepage~of~\pageref{LastPage}}
}
%
% Document body
\fancypagestyle{body}{
    \renewcommand{\familydefault}{\sfdefault}
    \setlength\headheight{47pt}
    %\renewcommand{\topmargin}{0pt}
    % even pages
    \fancyhead[CE]{\fbox{%
    \parbox{\textwidth}{
    \vspace*{10pt}\huge{
    \textbf{\@code}
    \hfill
    \textbf{\color{lightgray}{\@type}}
    }
    \vspace*{10pt}
    }}}%
    % odd pages
    \fancyhead[CO]{\fbox{%
    \parbox{\textwidth}{
    \vspace*{10pt}\huge{
    \textbf{\color{lightgray}{\@type}}
    \hfill \textbf{\@code}
    }
    \vspace*{10pt}
    }}}%
    \renewcommand{\headrulewidth}{0pt}
    %
    \fancyfoot[L]{\@date}
    \fancyfoot[C]{\@revision}
    \fancyfoot[R]{Page~\thepage~of~\pageref{LastPage}}
}
%
%
% Last page
\fancypagestyle{last}{
    \renewcommand{\familydefault}{\sfdefault}
    \setlength\headheight{47pt}
    %\renewcommand{\topmargin}{0pt}
    % even pages
    \fancyhead[CE]{\fbox{%
    \parbox{\textwidth}{
    \vspace*{10pt}\huge{
    \textbf{\@code}
    \hfill
    \textbf{\color{lightgray}{\@type}}
    }
    \vspace*{10pt}
    }}}%
    % odd pages
    \fancyhead[CO]{\fbox{%
    \parbox{\textwidth}{
    \vspace*{10pt}\huge{
    \textbf{\color{lightgray}{\@type}}
    \hfill \textbf{\@code}
    }
    \vspace*{10pt}
    }}}%
    \renewcommand{\headrulewidth}{0pt}
    %
    \fancyfoot[L]{\vspace*{-10pt}{\tiny \claim}\\ \@date}
    \fancyfoot[C]{\vspace{-20pt}\logosmall\\ \@revision}
    \fancyfoot[R]{\fbox{%
    \parbox{0.3\textwidth}{
    \large{
    \vspace*{10pt}
    \textbf{\website}
    \vspace*{-5pt}
    }}}\\
    Page~\thepage~of~\pageref{LastPage}
    }
}
\makeatother

% custom title
\makeatletter
\renewcommand*{\maketitle}{%
\renewcommand{\familydefault}{\sfdefault}
\thispagestyle{first}
\twocolumn[
\let\clearpage\relax% Remove \clearpage functionality
\vspace*{-10pt}% Insert needed vertical retraction
\begin{@twocolumnfalse}
    \begin{center}
    \bf{
        {\LARGE\@title\par}
        \@author
        }
    \end{center}
    \end{@twocolumnfalse}
    \vspace*{30pt}
    ]
}%
\makeatother

\setcounter{secnumdepth}{0} % sections are level 1

\title{My Outstanding Application Note Title}
\author{J.~Doe}
\date{22.02.2019}
\revision{Rev.~0.1}
\code{AN-1}
\type{APPLICATION~NOTE}

\begin{document}
\maketitle
\tableofcontents
\clearpage
\pagestyle{body}

\section{Section}
\lipsum[1]

\section{Section}
\lipsum[2]

\subsection{Subsection}
\lipsum[3]

\section{Section}
\lipsum[4]

\subsection{Subsection}
\lipsum[5]

\paragraph{Paragraph}
\lipsum[6]

\subsection{Subsection}
\lipsum[7]

\paragraph{Paragraph}
\lipsum[8]

\newpage
\clearpage
\pagestyle{last}
\begin{onecolumn}
\begin{table}[!ht]%
\caption{Revision history.}
\label{}
\centering
\begin{tabular}{p{0.3\linewidth}p{0.3\linewidth}p{0.3\linewidth}}
\hline
Revision & Author & Changes\\
\hline
cell 1 & cell 2 & cell 3\\
cell 1 & cell 2 & cell 3\\
\hline
\end{tabular}
\end{table}
\end{onecolumn}

\end{document}

이것은 대부분 내가 매우 좋아하는 Analog Devices 애플리케이션 노트를 복제합니다(그러나 저작권을 침해하지 않기를 바랍니다).

그러나 두 번째 페이지에서 색인을 얻을 수 없기 때문에 이것은 여전히 ​​내가 달성하고 싶은 것이 아닙니다(비록 내가 좋아하는 첫 번째 페이지에 색인을 두는 것은 여전히 ​​괜찮지만). 첫 페이지의 규칙 바로 위에 회사 정보가 표시되고 마지막 페이지의 바닥글이 제대로 정렬되지 않습니다. 마지막으로, 저는 그다지 좋은 라텍스 프로그래머가 아니기 때문에 모든 것이 더 잘 정리될 수 있다고 생각합니다(어쩌면 클래스/스타일로).

내 코드를 공유하고 가능하다면 누군가에게 개선을 요청하고 싶습니다.

감사합니다.

편집1: 다음 중간 단계를 생각해 냈습니다.

\documentclass[a4paper,twocolumn,twoside,11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[]{Chivo}
\usepackage{verbatim}
\usepackage{xcolor}
\usepackage{tabularx}
\usepackage{pgf, tikz}
\usepackage{mathrsfs}
\usepackage{verbatim}
\usepackage{lastpage}
\usepackage{multirow}

\usepackage{tipa} % for the pipe symbol
\usepackage[left=1.25cm,right=1.25cm,top=1.8cm,bottom=5cm]{geometry}

\usepackage{amsmath, amssymb, textcomp}
\everymath{\displaystyle}


\usepackage{eurosym}

\usepackage{graphicx}
\usepackage{svg}
\usepackage{lipsum}

\usepackage{hyperref}

% custom header/footer
\usepackage{fancyhdr}
\makeatletter
\newcommand{\logo}{\includegraphics[width=0.3\columnwidth]{logo.png}}
\newcommand{\logosmall}{\includegraphics[width=0.15\columnwidth]{logo.png}}
\newcommand{\claim}{©YYYY Company name, Inc. All rights reserved. Trademarks and registered trademarks are the property of their respective owners.}
\newcommand{\website}{www.companysite.com}
\newcommand{\telephone}{123.456.7890}
\newcommand{\address}{\small{One Technology Way}\large{$\cdot$}\small{P.O.Box 9106}\large{$\cdot$}\small{Norwood,MA02062-9106,USA}}
\renewcommand{\date}[1]{\gdef\@date{#1}}
\newcommand*{\revision}[1]{\gdef\@revision{#1}}
\newcommand*{\code}[1]{\gdef\@code{#1}}
\newcommand*{\type}[1]{\gdef\@type{#1}}
\newcommand*{\theCompany}{\textbf{{\address}\large{$\cdot$}\small{Tel:\telephone}\large{$\cdot$}\small{\website}}}
%
%
% First page
%
\fancypagestyle{first}{
    \renewcommand{\familydefault}{\sfdefault}
    \setlength\headheight{94pt}
    \fancyhead[C]{
    \begin{tabular}[b]{p{0.3\linewidth}p{0.27\linewidth}p{0.3\linewidth}} % still having some alignment issues here
    \multirow{2}{1in}{\logo}    & &                    \\
                                & &                    \\
                                & & \huge{\bf{\@code}} \\
                                & & \huge{\bf{\@type}} \\
                                & &                    \\
    \multicolumn{3}{l}{\theCompany}                    \\
    \end{tabular}
    \vspace*{-15pt}
    }
    \renewcommand{\headrulewidth}{2pt}
    %\fancyfoot[C]{\footnotesize{\@revision\textpipe{}Page~\thepage~of~\pageref{LastPage}}}
    \fancyfoot[C]{
    \begin{tabular}[b]{p{0.3\linewidth}p{0.3\linewidth}p{0.3\linewidth}}
    & \footnotesize{\@revision\textpipe{}Page~\thepage~of~\pageref{LastPage}} & \\
    \end{tabular}
    }
}
%
% Document body
\fancypagestyle{body}{
    \renewcommand{\familydefault}{\sfdefault}
    \setlength\headheight{47pt}
    %\renewcommand{\topmargin}{0pt}
    % even pages
    \fancyhead[CE]{\fbox{%
    \parbox{\textwidth}{
    \vspace*{10pt}\huge{
    \textbf{\@code}
    \hfill
    \textbf{\color{lightgray}{\@type}}
    }
    \vspace*{10pt}
    }}}%
    % odd pages
    \fancyhead[CO]{\fbox{%
    \parbox{\textwidth}{
    \vspace*{10pt}\huge{
    \textbf{\color{lightgray}{\@type}}
    \hfill \textbf{\@code}
    }
    \vspace*{10pt}
    }}}%
    \renewcommand{\headrulewidth}{0pt}
    %
    %\fancyfoot[C]{\footnotesize{\@revision\textpipe{}Page~\thepage~of~\pageref{LastPage}}}
    \fancyfoot[C]{
    \begin{tabular}[b]{p{0.3\linewidth}p{0.3\linewidth}p{0.3\linewidth}}
    & \footnotesize{\@revision\textpipe{}Page~\thepage~of~\pageref{LastPage}} & \\
    \end{tabular}
    }
}
%
%
% Last page
\fancypagestyle{last}{
    \renewcommand{\familydefault}{\sfdefault}
    \setlength\headheight{47pt}
    %\renewcommand{\topmargin}{0pt}
    % even pages
    \fancyhead[CE]{\fbox{%
    \parbox{\textwidth}{
    \vspace*{10pt}\huge{
    \textbf{\@code}
    \hfill
    \textbf{\color{lightgray}{\@type}}
    }
    \vspace*{10pt}
    }}}%
    % odd pages
    \fancyhead[CO]{\fbox{%
    \parbox{\textwidth}{
    \vspace*{10pt}\huge{
    \textbf{\color{lightgray}{\@type}}
    \hfill \textbf{\@code}
    }
    \vspace*{10pt}
    }}}%
    \renewcommand{\headrulewidth}{0pt}
    \fancyfoot[C]{
    \begin{tabular}[b]{p{0.3\linewidth}p{0.3\linewidth}p{0.3\linewidth}}
                        & \multirow{2}{1in}{\logosmall} & \\
    \footnotesize{\claim} &                               & \multirow{2}{1in}{\fbox{\parbox{0.3\textwidth}{\centering\large{\vspace*{10pt}\textbf{\website}\vspace*{5pt}}}}}\\
                        &                               & \\
                        &\footnotesize{\@revision\textpipe{}Page~\thepage~of~\pageref{LastPage}}&\\
    \end{tabular}
    }
}
\makeatother

% custom title
\makeatletter
\renewcommand*{\maketitle}{%
\renewcommand{\familydefault}{\sfdefault}
\thispagestyle{first}
\twocolumn[
\vspace*{-20pt}% Insert needed vertical retraction
\begin{@twocolumnfalse}
    \begin{center}
    \bf{
        {\LARGE\@title\par}
        \@author
        }
    \end{center}
    \end{@twocolumnfalse}
    \vspace*{20pt}
    ]
}%
\makeatother

\setcounter{secnumdepth}{0} % sections are level 1

\title{My Application Note Title}
\author{J.~Doe}
\date{22.02.2019}
\revision{Rev.~0.1}
\code{AN-1}
\type{APPLICATION~NOTE}

\begin{document}
\maketitle
\section{Introduction}
\lipsum[1]\lipsum[2]\lipsum[1]
\clearpage

\tableofcontents
\pagestyle{body}

\section{Section}
\lipsum[1]

\section{Section}
\lipsum[2]

\subsection{Subsection}
\lipsum[3]

\section{Section}
\lipsum[4]

\subsection{Subsection}
\lipsum[5]

\paragraph{Paragraph}
\lipsum[6]

\subsection{Subsection}
\lipsum[7]

\paragraph{Paragraph}
\lipsum[8]

\newpage
\clearpage
\pagestyle{last}
\begin{onecolumn}
\begin{table}[!ht]%
\caption{Revision history.}
\label{}
\centering
\begin{tabular}{p{0.3\linewidth}p{0.3\linewidth}p{0.3\linewidth}}
\hline
Revision & Author & Changes\\
\hline
cell 1 & cell 2 & cell 3\\
cell 1 & cell 2 & cell 3\\
\hline
\end{tabular}
\end{table}
\end{onecolumn}

\end{document}

이제 마지막 페이지 바닥글에 문서 본문 전체에 복제되는 여러 행이 있는 테이블 형식 환경을 배치했습니다. 나는 모든 페이지에서 일관된 바닥글을 얻기 위해 수직 정렬을 조정하려고 노력할 것입니다.

제목 페이지와 관련하여 적절한 정렬을 위해 동일한 환경(표 형식 + 다중 행)을 사용했으며 회사 주소를 수평 규칙 바로 위에 표시할 수 있었습니다(@derBender 덕분에). 그러나 여전히 몇 가지 정렬 문제가 있습니다.

그러나 "템플릿"에는 추가 작업이 필요합니다.

편집2:

약간의 미세 조정을 통해 나는 이것을 생각해 냈습니다.

\documentclass[a4paper,twocolumn,twoside,11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[]{Chivo}
\usepackage{verbatim}
\usepackage{xcolor}
\usepackage{tabularx}
\usepackage{pgf, tikz}
\usepackage{mathrsfs}
\usepackage{verbatim}
\usepackage{lastpage}
\usepackage{multirow}

\usepackage{tipa} % for the pipe symbol
\usepackage[left=1.25cm,right=1.25cm,top=1.8cm,bottom=5cm]{geometry}

\usepackage{amsmath, amssymb, textcomp}
\everymath{\displaystyle}


\usepackage{eurosym}

\usepackage{graphicx}
\usepackage{svg}
\usepackage{lipsum}

\usepackage{hyperref}

% custom header/footer
\usepackage{fancyhdr}
\makeatletter
\newcommand{\logo}{\includegraphics[width=0.3\columnwidth]{logo.png}}
\newcommand{\logosmall}{\includegraphics[width=0.15\columnwidth]{logo.png}}
\newcommand{\claim}{©YYYY Company name, Inc. All rights reserved. Trademarks and registered trademarks are the property of their respective owners.}
\newcommand{\website}{www.companysite.com}
\newcommand{\websitelast}{\fbox{\parbox{0.3\textwidth}{\centering\large{\vspace*{10pt}\textbf{\website}\vspace*{10pt}}}}}
\newcommand{\telephone}{123.456.7890}
\newcommand{\address}{\small{One Technology Way}\large{$\cdot$}\small{P.O.Box 9106}\large{$\cdot$}\small{Norwood,MA02062-9106,USA}}
\renewcommand{\date}[1]{\gdef\@date{#1}}
\newcommand*{\revision}[1]{\gdef\@revision{#1}}
\newcommand*{\code}[1]{\gdef\@code{#1}}
\newcommand*{\type}[1]{\gdef\@type{#1}}
\newcommand*{\theCompany}{\textbf{{\address}\large{$\cdot$}\small{Tel:\telephone}\large{$\cdot$}\small{\website}}}
%
% First page
%
\fancypagestyle{first}{
    \renewcommand{\familydefault}{\sfdefault}
    \setlength\headheight{94pt}
    \fancyhead[C]{
    \begin{tabular}[b]{lcr} % still having some alignment issues here
    \multirow{2}{1in}{\logo}    & &                    \\
                                & &                    \\
                                & & \huge{\bf{\@code}} \\
                                & & \huge{\bf{\@type}} \\
                                & &                    \\
    \multicolumn{3}{l}{\theCompany}                    \\
    \end{tabular}
    \vspace*{-15pt}
    }
    \renewcommand{\headrulewidth}{2pt}
    %\fancyfoot[C]{\footnotesize{\@revision\textpipe{}Page~\thepage~of~\pageref{LastPage}}}
    \fancyfoot[C]{
    \begin{tabular}[b]{lcr}
    & \footnotesize{\@revision\textpipe{}Page~\thepage~of~\pageref{LastPage}} & \\
    \end{tabular}
    }
}
%
% Document body
\fancypagestyle{body}{
    \renewcommand{\familydefault}{\sfdefault}
    \setlength\headheight{47pt}
    % even pages
    \fancyhead[CE]{\fbox{%
    \parbox{\textwidth}{
    \vspace*{10pt}\huge{
    \textbf{\@code}
    \hfill
    \textbf{\color{lightgray}{\@type}}
    }
    \vspace*{10pt}
    }}}%
    % odd pages
    \fancyhead[CO]{\fbox{%
    \parbox{\textwidth}{
    \vspace*{10pt}\huge{
    \textbf{\color{lightgray}{\@type}}
    \hfill \textbf{\@code}
    }
    \vspace*{10pt}
    }}}%
    \renewcommand{\headrulewidth}{0pt}
    \setlength\footskip{73pt}
    %
\fancyfoot[C]{
    \begin{tabular}[b]{lcr}
        &                                                                         & \\
        &                                                                         & \\
        &                                                                         & \\
        & \footnotesize{\@revision\textpipe{}Page~\thepage~of~\pageref{LastPage}} & \\
    \end{tabular}
}
}
%
% Last page
\fancypagestyle{last}{
    \renewcommand{\familydefault}{\sfdefault}
    \setlength\headheight{47pt}
    % even pages
    \fancyhead[CE]{\fbox{%
    \parbox{\textwidth}{
    \vspace*{10pt}\huge{
    \textbf{\@code}
    \hfill
    \textbf{\color{lightgray}{\@type}}
    }
    \vspace*{10pt}
    }}}%
    % odd pages
    \fancyhead[CO]{\fbox{%
    \parbox{\textwidth}{
    \vspace*{10pt}\huge{
    \textbf{\color{lightgray}{\@type}}
    \hfill \textbf{\@code}
    }
    \vspace*{10pt}
    }}}%
    \renewcommand{\headrulewidth}{0pt}
    \setlength\footskip{73pt}
    %\multirow[<vpos>]{<nrows>}[<bigstruts>]{<width>}[<vmove>]{<text>}
    \fancyfoot[C]{
    \begin{tabular}[b]{p{0.4\linewidth}p{0.2\linewidth}p{0.4\linewidth}}
                        & \multirow[]{2}*[0.1in]{\logosmall} & \\
    \footnotesize{\claim} &                               & \multirow{2}*{\websitelast} \\
                        &                               & \\
                        &\footnotesize{\@revision\textpipe{}Page~\thepage~of~\pageref{LastPage}} & \\
    \end{tabular}
    }
}
\makeatother

% custom title
\makeatletter
\renewcommand*{\maketitle}{%
\renewcommand{\familydefault}{\sfdefault}
\thispagestyle{first}
\twocolumn[
\vspace*{-20pt}% Insert needed vertical retraction
\begin{@twocolumnfalse}
    \begin{center}
    \bf{
        {\LARGE\@title\par}
        \@author
        }
    \end{center}
    \end{@twocolumnfalse}
    \vspace*{20pt}
    ]
}%
\makeatother

\setcounter{secnumdepth}{0} % sections are level 1

\title{My Outstanding Application Note Title}
\author{J.~Doe}
\date{22.02.2019}
\revision{Rev.~0.1}
\code{AN-1}
\type{APPLICATION~NOTE}

\begin{document}
\maketitle
\section{Introduction}
\lipsum[1]\lipsum[2]\lipsum[1]
\clearpage

\tableofcontents
\pagestyle{body}

\section{Section}
\lipsum[1]

\section{Section}
\lipsum[2]

\subsection{Subsection}
\lipsum[3]

\section{Section}
\lipsum[4]

\subsection{Subsection}
\lipsum[5]

\paragraph{Paragraph}
\lipsum[6]

\subsection{Subsection}
\lipsum[7]

\paragraph{Paragraph}
\lipsum[8]

\newpage
\clearpage
\pagestyle{last}
\begin{onecolumn}
\begin{table}[!ht]%
\caption{Revision history.}
\label{}
\centering
\begin{tabular}{p{0.3\linewidth}p{0.3\linewidth}p{0.3\linewidth}}
\hline
Revision & Author & Changes\\
\hline
cell 1 & cell 2 & cell 3\\
cell 1 & cell 2 & cell 3\\
\hline
\end{tabular}
\end{table}
\end{onecolumn}

\end{document}

그러나 색인은 여전히 ​​본문 텍스트로 대체됩니다.

편집3: 최종 버전에 이어 만족합니다.

\documentclass[a4paper,twocolumn,twoside,11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{titlesec}
\usepackage[titles]{tocloft}
\usepackage{verbatim}
\usepackage{xcolor}
\usepackage{tabularx}
\usepackage{pgf,tikz}
\usepackage{mathrsfs}
\usepackage{lastpage}
\usepackage{multirow}

\usepackage{tipa} % for the pipe symbol
\usepackage[left=1.25cm,right=1.25cm,top=1.8cm,bottom=5cm]{geometry}

\usepackage{amsmath, amssymb, textcomp}


\usepackage{eurosym}

\usepackage{graphicx}
\usepackage{lipsum}

\usepackage{hyperref}

% custom header/footer
\usepackage{fancyhdr}
\makeatletter
\newcommand{\logo}{\includegraphics[draft,width=0.7\columnwidth]{logo.png}}
\newcommand{\logosmall}{\includegraphics[draft,width=0.2\columnwidth]{logo.png}}
\newcommand{\claim}[1]{\gdef\@claim{#1}}
\newcommand{\site}[1]{\gdef\@site{#1}}
\renewcommand{\date}[1]{\gdef\@date{#1}}
\newcommand*{\revision}[1]{\gdef\@revision{#1}}
\newcommand*{\id}[1]{\gdef\@id{#1}}
\newcommand*{\type}[1]{\gdef\@type{#1}}
\newcommand*{\info}[1]{\gdef\@info{#1}}
%
% First page
%p{0.3\textwidth}p{0.3\textwidth}p{0.3\textwidth}
\fancypagestyle{first}{
    %\renewcommand{\familydefault}{\sfdefault}
    \setlength\headheight{94pt}
    \fancyhead[C]{
    \begin{tabular}[b]{lcr} % still having some alignment issues here
    \multirow{2}*[-0.1in]{\logo} & &                                   \\
                                & & \huge{\textbf{\textsf{\@id}}}     \\
                                & & \huge{\textbf{\textsf{\@type}}}   \\
    \multicolumn{3}{b{0.95\textwidth}}{\footnotesize{\textsf{\@info}}} \\
    \end{tabular}
    }
    \vspace*{-5pt}
    \renewcommand{\headrulewidth}{2pt}
    %\fancyfoot[C]{\footnotesize{\@revision\textpipe{}Page~\thepage~of~\pageref{LastPage}}}
    \fancyfoot[C]{
    \begin{tabular}[b]{lcr}
    & \textsf{\footnotesize{\@revision\textpipe{}Page~\thepage~of~\pageref{LastPage}}} & \\
    \end{tabular}
    }
}
%
% Document body
\fancypagestyle{body}{
    %\renewcommand{\familydefault}{\sfdefault}
    \setlength\headheight{47pt}
    % even pages
    \fancyhead[CE]{\fbox{%
    \parbox{\textwidth}{
    \vspace*{10pt}\huge{
    \textbf{\textsf{\@id}}
    \hfill
    \textbf{\textsf{\color{lightgray}{\@type}}}
    }
    \vspace*{10pt}
    }}}%
    % odd pages
    \fancyhead[CO]{\fbox{%
    \parbox{\textwidth}{
    \vspace*{10pt}\huge{
    \textbf{\textsf{\color{lightgray}{\@type}}}
    \hfill \textbf{\textsf{\@id}}
    }
    \vspace*{10pt}
    }}}%
    \renewcommand{\headrulewidth}{0pt}
    \setlength\footskip{73pt}
    %
\fancyfoot[C]{
    \begin{tabular}[b]{lcr}
        &                                                                         & \\
        &                                                                         & \\
        &                                                                         & \\
        & \textsf{\footnotesize{\@revision\textpipe{}Page~\thepage~of~\pageref{LastPage}}} & \\
    \end{tabular}
}
}
%
% Last page
\fancypagestyle{last}{
    %\renewcommand{\familydefault}{\sfdefault}
    \setlength\headheight{47pt}
    % even pages
    \fancyhead[CE]{\fbox{%
    \parbox{\textwidth}{
    \vspace*{10pt}\huge{
    \textbf{\textsf{\@id}}
    \hfill
    \textbf{\textsf{\color{lightgray}{\@type}}}
    }
    \vspace*{10pt}
    }}}%
    % odd pages
    \fancyhead[CO]{\fbox{%
    \parbox{\textwidth}{
    \vspace*{10pt}\huge{
    \textbf{\textsf{\color{lightgray}{\@type}}}
    \hfill \textbf{\textsf{\@id}}
    }
    \vspace*{10pt}
    }}}%
    \renewcommand{\headrulewidth}{0pt}
    \setlength\footskip{73pt}
    %\multirow[<vpos>]{<nrows>}[<bigstruts>]{<width>}[<vmove>]{<text>}
    \fancyfoot[C]{
    \begin{tabular}[b]{p{0.4\linewidth}p{0.2\linewidth}p{0.4\linewidth}}
                        & \multirow[]{2}*[-0.15in]{\logosmall} & \\
    \textsf{\footnotesize{\@claim}} &                               & \multirow[]{2}*[0.1in]{\fbox{\parbox{0.3\textwidth}{\centering\large{\vspace*{10pt}\textbf{\textsf{\@site}}\vspace*{10pt}}}}} \\
                        &                               & \\
                        &\textsf{\footnotesize{\@revision\textpipe{}Page~\thepage~of~\pageref{LastPage}}} & \\
    \end{tabular}
    }
}
\makeatother

% custom title
\makeatletter
\renewcommand*{\maketitle}{%
%\renewcommand{\familydefault}{\sfdefault}
\thispagestyle{first}
\twocolumn[
\vspace*{-20pt}% Insert needed vertical retraction
\begin{@twocolumnfalse}
    \begin{center}
        {\LARGE\textbf{\textsf{\@title}}\par}
        \textbf{\textsf{\@author}}
    \end{center}
    \end{@twocolumnfalse}
    \vspace*{20pt}
    ]
}%
%
\makeatother

\setcounter{secnumdepth}{0} % sections are level 1
\titleformat*{\section}{\Large\bfseries\sffamily}
\titleformat*{\subsection}{\large\bfseries\sffamily}
\titleformat*{\subsubsection}{\bfseries\sffamily}
\titleformat*{\paragraph}{\large\bfseries\sffamily}
\titleformat*{\subparagraph}{\bfseries\sffamily}
\renewcommand{\cftsecfont}{\bfseries\sffamily}
\renewcommand{\cftsubsecfont}{\sffamily}
\renewcommand{\cftsubsubsecfont}{\sffamily}

\title{My Outstanding Application Note Title}
\author{J.~Doe}
\date{22.02.2019}
\revision{Rev.~0.1}
\id{AN-1}
\type{APPLICATION~NOTE}
\info{Please place here company infos.}
\claim{Please, place here your copyright notice.}
\site{www.companysite.com}

\begin{document}
\maketitle
\tableofcontents
\clearpage
\pagestyle{body}

\section{Section}
\lipsum[1-4]

\section{Section}
\lipsum[1]

\section{Section}
\lipsum[2]

\subsection{Subsection}
\lipsum[3]

\subsubsection{Subsubsection}
\lipsum[4]

\subsection{Subsection}
\lipsum[5]

\paragraph{Paragraph}
\lipsum[6]

\subparagraph{Subparagraph}
\lipsum[7]

\newpage
\clearpage
\pagestyle{last}
\begin{onecolumn}
\begin{table}[!ht]%
\caption{Revision history.}
\label{}
\centering
\begin{tabular}{p{0.3\linewidth}p{0.3\linewidth}p{0.3\linewidth}}
\hline
Revision & Author & Changes\\
\hline
cell 1 & cell 2 & cell 3\\
cell 1 & cell 2 & cell 3\\
\hline
\end{tabular}
\end{table}
\end{onecolumn}

\end{document}

답변1

내 생각에 꽤 괜찮은 것을 생각해 냈는데… 그래도 여전히 개선될 수 있습니다.

\documentclass[a4paper,twocolumn,twoside,11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[]{Chivo}
\usepackage{verbatim}
\usepackage{xcolor}
\usepackage{tabularx}
\usepackage{pgf, tikz}
\usepackage{mathrsfs}
\usepackage{verbatim}
\usepackage{lastpage}

\usepackage{tipa} % for the pipe symbol
\usepackage[left=1.25cm,right=1.25cm,top=1.8cm,bottom=5cm]{geometry}

\usetikzlibrary{shapes, calc, shapes, arrows, babel}

\usepackage{amsmath, amssymb, textcomp}
\everymath{\displaystyle}


\usepackage{eurosym}

\usepackage{graphicx}
\graphicspath{{./img/}}
\usepackage{svg}
\usepackage{lipsum}

\usepackage{hyperref}

% custom header/footer
\usepackage{fancyhdr}
%\pagestyle{fancy}
\makeatletter
\newcommand{\logo}{\includegraphics[natwidth=100px,natheight=100px,width=0.6\columnwidth]{logo.png}}
\newcommand{\logosmall}{\includegraphics[natwidth=100px,natheight=100px,width=0.2\columnwidth]{logo.png}}
\newcommand{\claim}{©YYYY Company name, Inc. All rights reserved.\\ Trademarks and registered trademarks are the\\\vspace{-6pt} property of their respective owners.}
\newcommand{\website}{www.companysite.com}
\newcommand{\telephone}{123.456.7890}
\newcommand{\address}{\small{One Technology Way}\large{$\cdot$}\small{P.O.Box 9106}\large{$\cdot$}\small{Norwood,MA02062-9106,USA}}
\renewcommand{\date}[1]{\gdef\@date{#1}}
\newcommand*{\revision}[1]{\gdef\@revision{#1}}
\newcommand*{\code}[1]{\gdef\@code{#1}}
\newcommand*{\type}[1]{\gdef\@type{#1}}
\newcommand*{\theCompany}{\textbf{{\address}\large{$\cdot$}\small{Tel:\telephone}\large{$\cdot$}\small{\website}}}
%
%
% First page
%
\fancypagestyle{first}{
    \renewcommand{\familydefault}{\sfdefault}
    \setlength\headheight{47pt}
    %\renewcommand{\topmargin}{0pt}
    \fancyhead[L]{\logo\\}
    \fancyhead[R]{
                    \huge{
                        \bf{
                            \@code\\
                            \@type\\
                           }
                    }
                 }
    \fancyhead[C]{~\\~\\\theCompany}
    \renewcommand{\headrulewidth}{2pt}
    %
    %\vspace*{-30pt}
    \fancyfoot[C]{\tiny{\@revision\textpipe{}Page~\thepage~of~\pageref{LastPage}}}
}
%
% Document body
\fancypagestyle{body}{
    \renewcommand{\familydefault}{\sfdefault}
    \setlength\headheight{47pt}
    %\renewcommand{\topmargin}{0pt}
    % even pages
    \fancyhead[CE]{\fbox{%
    \parbox{\textwidth}{
    \vspace*{10pt}\huge{
    \textbf{\@code}
    \hfill
    \textbf{\color{lightgray}{\@type}}
    }
    \vspace*{10pt}
    }}}%
    % odd pages
    \fancyhead[CO]{\fbox{%
    \parbox{\textwidth}{
    \vspace*{10pt}\huge{
    \textbf{\color{lightgray}{\@type}}
    \hfill \textbf{\@code}
    }
    \vspace*{10pt}
    }}}%
    \renewcommand{\headrulewidth}{0pt}
    %
    \fancyfoot[C]{\tiny{\@revision\textpipe{}Page~\thepage~of~\pageref{LastPage}}}
}
%
%
% Last page
\fancypagestyle{last}{
    \renewcommand{\familydefault}{\sfdefault}
    \setlength\headheight{47pt}
    %\renewcommand{\topmargin}{0pt}
    % even pages
    \fancyhead[CE]{\fbox{%
    \parbox{\textwidth}{
    \vspace*{10pt}\huge{
    \textbf{\@code}
    \hfill
    \textbf{\color{lightgray}{\@type}}
    }
    \vspace*{10pt}
    }}}%
    % odd pages
    \fancyhead[CO]{\fbox{%
    \parbox{\textwidth}{
    \vspace*{10pt}\huge{
    \textbf{\color{lightgray}{\@type}}
    \hfill \textbf{\@code}
    }
    \vspace*{10pt}
    }}}%
    \renewcommand{\headrulewidth}{0pt}

    \fancyfoot[L]{\vspace*{-10pt}{\tiny \claim}}
    \fancyfoot[C]{\vspace{-60pt}\hspace{1cm}\logosmall\\\tiny{\@revision\textpipe{}Page~\thepage~of~\pageref{LastPage}}}
    \fancyfoot[R]{\fbox{%
    \parbox{0.3\textwidth}{
    \centering
    \large{
    \vspace*{10pt}
    \textbf{\website}
    \vspace*{5pt}
    }}}\\
    ~
    }
}
\makeatother

% custom title
\makeatletter
\renewcommand*{\maketitle}{%
\renewcommand{\familydefault}{\sfdefault}
\thispagestyle{first}
\twocolumn[
%\let\clearpage\relax% Remove \clearpage functionality
\vspace*{-10pt}% Insert needed vertical retraction
\begin{@twocolumnfalse}
    \begin{center}
    \bf{
        {~\par}
        ~
        }
    \end{center}
    \end{@twocolumnfalse}
    \vspace*{90pt}
    ]
}%
\makeatother

\setcounter{secnumdepth}{0} % sections are level 1

\title{}
\author{}
\date{22.02.2019}
\revision{Rev.~0.1}
\code{AN-1}
\type{APPLICATION~NOTE}

\begin{document}
    \maketitle
    \begin{center}
        %\title
        %\author{J.~Doe}
        \renewcommand{\title}{My Application Note Title}
        \renewcommand{\author}{J.~Doe}
        \Large{\textbf{\title \\ by \author}}
    \end{center}
\section{Introduction}
\lipsum[1]\lipsum[2]\lipsum[1]
\clearpage

\tableofcontents
\pagestyle{body}

\section{Section}
\lipsum[1]

\section{Section}
\lipsum[2]

\subsection{Subsection}
\lipsum[3]

\section{Section}
\lipsum[4]

\subsection{Subsection}
\lipsum[5]

\paragraph{Paragraph}
\lipsum[6]

\subsection{Subsection}
\lipsum[7]

\paragraph{Paragraph}
\lipsum[8]

\newpage
\clearpage
\pagestyle{last}
\begin{onecolumn}
\begin{table}[!ht]%
\caption{Revision history.}
\label{}
\centering
\begin{tabular}{p{0.3\linewidth}p{0.3\linewidth}p{0.3\linewidth}}
\hline
Revision & Author & Changes\\
\hline
cell 1 & cell 2 & cell 3\\
cell 1 & cell 2 & cell 3\\
\hline
\end{tabular}
\end{table}
\end{onecolumn}

\end{document}

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

알려진 문제는 다음과 같습니다:

-제목이 두 열 위 중앙에 위치하지 않음

-toc은 별도의 페이지에 없습니다.

-마지막 페이지의 바닥글이 제대로 정렬되지 않았습니다(어쩌면 일부 hspace 및 vspace가 여기에 도움이 될 수 있습니까?)

답변2

\tableofcontents이전 대신 이후 를 이동하는 것이 \clearpages나에게 도움이 되었습니다.

또한 다음은 몇 가지 사소한 제안 사항입니다. 처음에는 MWE를 컴파일할 때 LaTeX가 크기를 파악할 수 없었기 때문에 문제가 발생했습니다 logo.png(파일이 존재하더라도 알 수 없다는 것을 알고 있습니다). 그래서 제가 일반적으로 수행하는 작업은 다음과 같습니다. 이 경우에는 natheight=100px, natwidth=100px(또는 다른 숫자, 파일에서 확인)을 추가하는 것입니다.\includegraphics

편집:AD의 앱노트처럼 보이도록 하려면 바닥글을 약간 다르게 해야 한다고 생각했습니다. 바닥글에 날짜가 없고(그래서 해당 줄을 생략했습니다) "페이지 x/y"가 중앙에 위치합니다. 그러나 "|"로 개정 번호와 구분됩니다. (보관된 내용은 \usepackage{tipa}텍스트 \textpipe크기가 매우 작기 때문에 바닥글에 텍스트를{\tiny…}

일시적으로 다음 로고(크기 100px * 100px)를 생각해냈습니다.

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

관련 정보