笔记

笔记

我正在尝试更改在 fancypagestyle 中定义的标题页上的页面颜色。效果很好。我还使用绝对定位在此标题页上放置文本框,我重新定义了 \maketitle 命令。我的问题是标题页上没有任何文本块显示。

这是我的代码:

\documentclass[12pt]{article}

\usepackage{geometry}
\usepackage{graphicx}
\graphicspath{{./graphics/}}
\usepackage{titlesec}
\usepackage{parskip}
\usepackage{fancyhdr}
\usepackage{xcolor}
\usepackage[absolute]{textpos}
\usepackage{textcomp}
\usepackage[multiple]{footmisc}
\usepackage{afterpage}

\setlength{\topmargin}{-1cm}
\setlength{\headheight}{1cm}
\setlength{\headsep}{1cm}
\setlength{\textheight}{21.2cm}
\setlength{\textwidth}{16cm}
\setlength{\oddsidemargin}{-0.05cm}
\setlength{\evensidemargin}{-0.05cm}
\setlength{\TPHorizModule}{30mm}
\setlength{\TPVertModule}{\TPHorizModule}

\newcommand{\cth}{\small CTH~}
\newcommand{\cale}{\small CALE~}
\newcommand{\theBattelleTitle}{}
\newcommand{\theclient}{}
\newcommand{\theReportDate}{}
\newcommand{\thedisclaimer}{}
\newcommand{\theTechnical}{}
\newcommand{\theBusiness}{}


\newcommand{\BattelleTitle}[1]{%
    \renewcommand{\theBattelleTitle}{#1}
}
\newcommand{\client}[1]{%
    \renewcommand{\theclient}{#1}
}
\newcommand{\ReportDate}[1]{%
    \renewcommand{\theReportDate}{#1}
}
\newcommand{\disclaimer}[1]{%
    \renewcommand{\thedisclaimer}{#1}
}
\newcommand{\Technical}[1]{%
    \renewcommand{\theTechnical}{#1}
}
\newcommand{\Business}[1]{%
    \renewcommand{\theBusiness}{#1}
}


\renewcommand{\headrulewidth}{0pt}

\renewcommand{\footrulewidth}{0pt}

\definecolor{BattelleBlue}{RGB}{0,85,150}
\definecolor{White}{RGB}{255,255,255}

\fancypagestyle{fancyBattelle}{%
    \fancyhf{}
    \fancyhfoffset{30mm}
    \setlength{\voffset}{-10mm}
    \setlength{\footskip}{20mm}
    %\fancyhead[C]{\includegraphics[width=208mm]{BattelleTitle.jpg}}
    %\fancyfoot[C]{\includegraphics[width=208mm]{BattelleFooter.png}\\ \thepage}
}

\renewcommand{\maketitle}{%
    \clearpage
    \pagestyle{fancyBattelle}
    \mbox{}
    \pagecolor{BattelleBlue}%\afterpage{\nopagecolor}
\begin{textblock}{5.5}(1.1667,1.5)
    \noindent{\textcolor{White}{\textsf{\bf{\LARGE{\theBattelleTitle}}}}}
\end{textblock}
\begin{textblock}{7}(1.1667,2.5)
    \noindent{\textsf{\Large{Battelle Memorial Institute \\ 505 King Avenue \\ Columbus, OH  43201}}}
\end{textblock}
\begin{textblock}{7}(1.1667,3.5)
    \noindent{\textsf{\Large{To: \\ \theclient}}}
\end{textblock}
\begin{textblock}{2}(1.1667,4.25)
    \noindent{\textsf{\large{\theReportDate}}}
\end{textblock}
\begin{textblock}{2}(1.1667,5)
    \noindent{\textsf{\bf Battelle Technical Contact:} \\ \theTechnical}
\end{textblock}
\begin{textblock}{2}(4.0,5.0)
    \noindent{\textsf{\bf Battelle Contracts Contact:} \\ \theBusiness}
\end{textblock}
\begin{textblock}{5.5}(0.8333,7.0)
    \noindent{\thedisclaimer}
\end{textblock}
\newpage
}



\begin{document}

\BattelleTitle{Modeling/Simulation of Novel Concept Explosive Device}

\client{Federal Bureau of Investigation}

\ReportDate{April 2014}

\Technical{Dr. Michael Fisher \\ Research Leader \\ (614) 424-7871 \\ (614) 458-7871 (fax) \\ [email protected]}

\Business{Myriah Denk \\ Contracting Officer \\ (919) 544-9154 \\ (614) 458-0291 (fax) \\ [email protected]}

\disclaimer{This proposal or quotation includes data that shall not be disclosed outside the government and shall not be duplicated, used, or disclosed-in whole or in part-for any purpose other than to evaluate this proposal or quotation.  If, however, a contract is awarded to this offeror or quoter as a result of-or in connection with-the submission of this data, the government shall have the right to duplicate, use, or disclose the data to the extent provided in the resulting contract.  This restriction does not limit the government's right to use information contained in this data if it is obtained from another source without restriction.  The data subject to this restriction are contained in all pages of this proposal.}

\maketitle

\section{\textcolor{White}{Introduction}}


\section{Technical Approach}

\begin{figure}
    \includegraphics[width=6in.]{admodel_0001.png}
    \caption{\small{AUTODYN}\textsuperscript{\textregistered} model at time $t = 0$ for a novel concept explosive device similar to the FBI device. The model has axial symmetry and is shown here rotated 180$^\circ$ about the axis of symmetry. The device casing is aluminum (blue color), the shaped charge jet liner and the EFP are copper (green), the wave shaper is concrete (cyan), and the HE is Comp C-4, (red).}
    \label{initial}
\end{figure}

\section{Deliverables}


\section{Program Schedule and ROM Costs}



\end{document} 

谢谢

麦克风

答案1

这是一个供您使用的新宏tikz

\usepackage{tikz}

\newcommand\placetext[3][2cm]{%
\begin{tikzpicture}[remember picture,overlay]
\node[outer sep=0pt,inner sep=0pt,anchor=south west,text width=\textwidth,align=left ]
  at ([xshift=#1,yshift=-#2]current page.north west) {#3};
\end{tikzpicture}%
}

在此,我保留了默认的水平移位2cm。如果要更改它,请使用可选参数。语法是

\placetext[x shift]{yshift}{%
    content
}
xshift default 2cm, and yshift is downwards

代码:

\documentclass[12pt]{article}

\usepackage{geometry}
\usepackage{graphicx}
\graphicspath{{./graphics/}}
\usepackage{titlesec}
\usepackage{parskip}
\usepackage{fancyhdr}
\usepackage{xcolor}
%\usepackage[absolute]{textpos}
\usepackage{textcomp}
\usepackage[multiple]{footmisc}
\usepackage{afterpage}

\setlength{\topmargin}{-1cm}
\setlength{\headheight}{1cm}
\setlength{\headsep}{1cm}
\setlength{\textheight}{21.2cm}
\setlength{\textwidth}{16cm}
\setlength{\oddsidemargin}{-0.05cm}
\setlength{\evensidemargin}{-0.05cm}
%\setlength{\TPHorizModule}{30mm}
%\setlength{\TPVertModule}{\TPHorizModule}

\newcommand{\cth}{\small CTH~}
\newcommand{\cale}{\small CALE~}
\newcommand{\theBattelleTitle}{}
\newcommand{\theclient}{}
\newcommand{\theReportDate}{}
\newcommand{\thedisclaimer}{}
\newcommand{\theTechnical}{}
\newcommand{\theBusiness}{}


\newcommand{\BattelleTitle}[1]{%
    \renewcommand{\theBattelleTitle}{#1}
}
\newcommand{\client}[1]{%
    \renewcommand{\theclient}{#1}
}
\newcommand{\ReportDate}[1]{%
    \renewcommand{\theReportDate}{#1}
}
\newcommand{\disclaimer}[1]{%
    \renewcommand{\thedisclaimer}{#1}
}
\newcommand{\Technical}[1]{%
    \renewcommand{\theTechnical}{#1}
}
\newcommand{\Business}[1]{%
    \renewcommand{\theBusiness}{#1}
}


\renewcommand{\headrulewidth}{0pt}

\renewcommand{\footrulewidth}{0pt}

\definecolor{BattelleBlue}{RGB}{0,85,150}
\definecolor{White}{RGB}{255,255,255}

\fancypagestyle{fancyBattelle}{%
    \fancyhf{}
    \fancyhfoffset{30mm}
    \setlength{\voffset}{-10mm}
    \setlength{\footskip}{20mm}
    %\fancyhead[C]{\includegraphics[width=208mm]{BattelleTitle.jpg}}
    %\fancyfoot[C]{\includegraphics[width=208mm]{BattelleFooter.png}\\ \thepage}
}

\usepackage{tikz}

\newcommand\placetext[3][2cm]{%
\begin{tikzpicture}[remember picture,overlay]
\node[outer sep=0pt,inner sep=0pt,anchor=south west,text width=\textwidth,align=left ]
  at ([xshift=#1,yshift=-#2]current page.north west) {#3};
\end{tikzpicture}%
}

\renewcommand{\maketitle}{%
    \clearpage
    \pagestyle{fancyBattelle}
    \mbox{}
    \pagecolor{BattelleBlue}%\afterpage{\nopagecolor}
\placetext{5cm}{%
    \textcolor{White}{\sffamily\bfseries\LARGE \theBattelleTitle}
    }
\placetext{8cm}{%
    \sffamily\Large Battelle Memorial Institute \\ 505 King Avenue \\ Columbus, OH  43201\par}
%\begin{textblock}{7}(1.1667,3.5)
%    \noindent{\textsf{\Large{To: \\ \theclient}}}
%\end{textblock}
%\begin{textblock}{2}(1.1667,4.25)
%    \noindent{\textsf{\large{\theReportDate}}}
%\end{textblock}
%\begin{textblock}{2}(1.1667,5)
%    \noindent{\textsf{\bf Battelle Technical Contact:} \\ \theTechnical}
%\end{textblock}
\placetext[4cm]{15cm}{%
    \sffamily\bfseries Battelle Contracts Contact: \\ \theBusiness
}
%\begin{textblock}{5.5}(0.8333,-7.0)
%    \noindent\thedisclaimer
%\end{textblock}
%Some text
\newpage
}


\begin{document}


\BattelleTitle{Modeling/Simulation of Novel Concept Explosive Device}

\client{Federal Bureau of Investigation}

\ReportDate{April 2014}

\Technical{Dr. Michael Fisher \\ Research Leader \\ (614) 424-7871 \\ (614) 458-7871 (fax) \\ [email protected]}

\Business{Myriah Denk \\ Contracting Officer \\ (919) 544-9154 \\ (614) 458-0291 (fax) \\ [email protected]}

\disclaimer{This proposal or quotation includes data that shall not be disclosed outside the government and shall not be duplicated, used, or disclosed-in whole or in part-for any purpose other than to evaluate this proposal or quotation.  If, however, a contract is awarded to this offeror or quoter as a result of-or in connection with-the submission of this data, the government shall have the right to duplicate, use, or disclose the data to the extent provided in the resulting contract.  This restriction does not limit the government's right to use information contained in this data if it is obtained from another source without restriction.  The data subject to this restriction are contained in all pages of this proposal.}

\maketitle

\section{\textcolor{White}{Introduction}}


\section{Technical Approach}

\begin{figure}
    \includegraphics[width=6in.]{example-image-a}
    \caption{\small{AUTODYN}\textsuperscript{\textregistered} model at time $t = 0$ for a novel concept explosive device similar to the FBI device. The model has axial symmetry and is shown here rotated 180$^\circ$ about the axis of symmetry. The device casing is aluminum (blue color), the shaped charge jet liner and the EFP are copper (green), the wave shaper is concrete (cyan), and the HE is Comp C-4, (red).}
    \label{initial}
\end{figure}

\section{Deliverables}


\section{Program Schedule and ROM Costs}



\end{document}

在此处输入图片描述

我只修改了这个宏的几个条目。其余的交给你去做。

笔记

  1. 不要使用\sf \bf等。所有这些两个字母的命令都已弃用。请使用\sffamily\bfseries等。

  2. \noindent不接受争论,所以\noindent{...}是错误的。

  3. 同样\bf{...}\Large{...}等等,也是错误的。\bfseries是一个开关,而不是命令。

  4. \par偶尔在末尾添加一个,以便行距等正确。

正确用法的示例是

    \placetext{8cm}{%
        \sffamily\Large Battelle Memorial Institute \\ 505 King Avenue \\ Columbus,
        OH  43201\par
      }

相关内容