アプリケーションノートスタイル

アプリケーションノートスタイル

私はアプリケーション ノート スタイルを設定しようとしており、これまでに次のような結果になりました。

\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 のアプリケーション ノートを複製したものです (ただし、著作権を侵害していないことを願っています)。

しかし、これはまだ私が達成したいことではありません。2 ページ目にインデックスを表示できない (1 ページ目にインデックスを表示しても問題ありません。これは私が気に入っている点です)、1 ページ目の罫線のすぐ上に会社情報を表示できない、最後のページのフッターが適切に配置されていないなどの問題があります。最後に、私はあまり優れた LaTeX プログラマーではないので、すべてをより適切に配置できると思います (おそらくクラス/スタイルで)。

可能であれば、自分のコードを共有して、誰かに改善を依頼したいと思っています。

ありがとう。

編集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}

ここに画像の説明を入力してください ここに画像の説明を入力してください ここに画像の説明を入力してください

既知の問題は次のとおりです:

-タイトルが両方の列の中央に配置されていない

- 目次が別のページではない

- 最終ページのフッターが揃っていません (hspace と vspace が役に立つかもしれません)

答え2

\tableofcontents私の場合は、前ではなく後に移動することで\clearpagesうまくいきました。

さらに、ここにいくつかの小さな提案があります。最初、MWEをコンパイルするときに問題が発生しました。LaTeXが寸法を判断できなかったためですlogo.png(ファイルが存在していてもできないことはわかっています)。そのため、このような場合に通常行うことは、natheight=100px, natwidth=100px(または他の数値、ファイルで確認してください)を\includegraphics

編集:ADのappnoteにもっと似せるには、フッターを少し変える必要があると思いました。フッターには日付がありません(そのため、その行は省略しました)し、「ページx/y」は中央に配置されていますが、リビジョン番号とは「|」(アーカイブ済み)で区切られています。\usepackage{tipa}また\textpipe、テキストサイズが非常に小さいため、フッターのテキストを{\tiny…}

とりあえず、次のロゴ(サイズ 100 px * 100 px)を思いつきました。

ここに画像の説明を入力してください

関連情報