我正在尝试使用文章类来排版以下内容股票研究报告。我试图使用 tikzpicture 和 minipages 在标题页上放入灰色侧面部分,但不知道如何将灰色图形从页面顶部移动。
\documentclass{article}
\setcounter{secnumdepth}{0}
\usepackage[utf8]{inputenc}
%\usepackage{fontspec}
%\defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
%\setmainfont{Times}
\title{Sections and Chapters}
\author{Gubert Farnsworth}
\date{ }
\usepackage{titlesec}
%\usepackage{sectsty}
\usepackage{ulem}
\usepackage{xcolor}
\usepackage{mdframed}
\definecolor{myblue}{RGB}{13, 54, 145}
\titleformat{\section}
{\normalfont\Large\bfseries}{\thesection}{1em}{}[{\color{myblue}\titlerule[0.8pt]}]
%\sectionfont{\large\underline}
\usepackage{lastpage,fancyhdr,graphicx}
\pagestyle{myheadings}
\pagestyle{fancy}
\fancyhf{}
\lhead{\date{February 8, 2017}}
\usepackage[top=2in,left=.75in,footskip=0.75in]{geometry}
\fancypagestyle{titlepage}
{
\newgeometry{top=0.75in,left=0.75in,right=1in,footskip=0.75in}
\renewcommand{\headrulewidth}{0pt}
\lhead{\date{February 8, 2017}}
\fancyhf{}
\rfoot{\thepage}
\fancyheadoffset[L]{0in}
\fancyfootoffset[L]{1.75in}
\lfoot{\author{Carter Page}}
\lhead{\date{February 8, 2017}}
\rhead{United States}
}
\fancypagestyle{contents}
{
\newgeometry{top=1in,left=0.75in,right=1in,footskip=0.75in}
\renewcommand{\headrulewidth}{0pt}
\lhead{\date{February 8, 2017}}
\fancyhf{}
\rfoot{\thepage}
\fancyheadoffset[L]{0in}
\fancyfootoffset[L]{1.75in}
\lfoot{Author}
\lhead{\date{February 8, 2017}}
\rhead{United States}
}
\renewcommand{\headrulewidth}{0pt}
\rfoot{\thepage}
\fancyheadoffset[L]{1.75in}
\fancyfootoffset[L]{1.75in}
\lfoot{\author{Author}}
\rhead{United States}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{lipsum}
\def\particulartemplate#1{
\thispagestyle{titlepage}
\begin{tikzpicture}[overlay, remember picture]
\draw let \p1 = (current page.west), \p2 = (current page.east) in
node[minimum width=\x2-\x1, minimum height=2in, draw, rectangle, fill=myblue, anchor=north west, align=left, text width=\x2-\x1] at ($(current page.north west)$) {\Large\bfseries \quad #1};
\end{tikzpicture}
}
\def\sidetemplate{
\begin{tikzpicture}[overlay, remember picture]
\draw let \p1 = (current page.north), \p2 = (current page.south) in
node[minimum width=1in, minimum height=2in, draw, rectangle, fill=gray, anchor=north west, align=left, text width=\x2-\x1] at ($(current page.north west)$) {\Large\bfseries \quad};
\end{tikzpicture}
}
\def\changemargin#1#2{\list{}{\rightmargin#2\leftmargin#1}\item[]}
\let\endchangemargin=\endlist
%\titlespacing*{\section}
%{-1.75in}{0in}{0in}
\begin{document}
\particulartemplate{\maketitle}
\section{Introduction}
\begin{minipage}[t]{4.5in} % Mini page taking up 30% of the actual page
\subsubsection*{US economy will gain strength as 2013 progresses}
The turbulent political environment that curtailed corporate risk-taking in 2012 will end. Full ‘fiscal cliff’ will be averted but taxes will rise and federal spending will be cut. Economy will grow by 1.9\% in 2013 and 2.9\% in 2014. \newline
\subsubsection*{Corporate fundamentals support continued profit cycle expansion}
We forecast S\&P 500 revenues rise by more than 4\% in 2013 and 2014, margins hover at current levels (8.8\%-9.0\%), earnings climb by more than 6\% and the P/E multiple expands modestly from 13.2x to 13.8x at end 2013. \newline
\subsubsection*{Valuation: 12-month target of 1575 reflects 12\% potential return}
Our 3-month, 6-month, and 12-month forecasts are 1450, 1500, and 1575. We use six valuation approaches including DDM, uncertainty-based P/E multiple, cyclically-adjusted P/E multiple, price/book and ROE relationship. \newline
\subsubsection*{Strategies to capture growth: market, sectors, stocks}
(1) Stocks will outperform Treasuries; (2) Equities will beat credit returns, although not on a risk-adjusted basis; (3) Cyclical sectors will beat defensive sectors (Materials, Industrials, Information Technology will outperform Consumer Staples, Telecom, and Health Care); (4) Double Sharpe Ratio stocks offer both high risk-adjusted earnings growth and prospective returns (Bloomberg ticker: <GSTHEPSR>); and (6) Stocks with high BRICs sales exposure will beat domestic-facing firms (GSTHBRIC).
\end{minipage} \hspace*{.25in}
\begin{minipage}[t]{2.5in}
% \begin{mdframed}[style=sidebar,frametitle={}] % Sidebar box
% \end{mdframed}
\sidetemplate{Hello, Author}
\end{minipage}
\newpage
\thispagestyle{contents}
\tableofcontents
%\addcontentsline{toc}{section}{Unnumbered Section}
%\section*{Unnumbered Section}
\newgeometry{top=1in,left=2.5in,right=1in,footskip=0.75in}
\newpage
\begin{changemargin}{-1.75in}{0in}
\section{First Section}
\end{changemargin}
\subsection{Sub}
This is the first section.
Lorem ipsum dolor sit amet, consectetuer adipiscing
elit. Etiam lobortisfacilisis sem. Nullam nec mi et
neque pharetra sollicitudin. Praesent imperdietmi nec ante.
Donec ullamcorper, felis non sodales...
Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Etiam lobortis facilisissem. Nullam nec mi et neque pharetra
sollicitudin. Praesent imperdiet mi necante...
\newpage
\begin{changemargin}{-1.75in}{0in}
\section{Second Section}
\end{changemargin}
\subsection{Strategies}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Etiam lobortis facilisissem. Nullam nec mi et neque pharetra
sollicitudin. Praesent imperdiet mi necante...
\end{document}