迷你页面的彩色部分

迷你页面的彩色部分

我无法为页面的部分内容着色,也无法添加文本框。

我也没有找到或者答案对我的探索很有帮助。

我基本上只想为第一页实现这种类型的页面布局:

在此处输入图片描述

我尝试使用底部的代码,但没有找到任何效果...请有人帮忙!

\documentclass[DIV=calc, paper=a4, twoside]{article}     % A4 paper and 11pt font size
\usepackage{multirow}
\usepackage{hhline}
\usepackage{calc}
\usepackage{tabularx}
\usepackage{xparse}
\usepackage{longtable,booktabs}
\usepackage{lipsum} % Used for inserting dummy 'Lorem ipsum' text into the template
\usepackage[english]{babel} % English language/hyphenation
\usepackage[protrusion=true,expansion=true]{microtype} % Better typography
\usepackage{amsmath,amsfonts,amsthm} % Math packages
\usepackage[svgnames, table]{xcolor} % Enabling colors by their 'svgnames'
\usepackage[hang, normalsize,labelfont=bf,up,textfont=it,up]{caption} %     Custom captions under/above floats in tables or figures
\usepackage{booktabs} % Horizontal rules in tables
\usepackage{mdframed}
\usepackage{lmodern} 
\usepackage{xparse}
\usepackage[margin=2.25cm,bottom=2cm,top=0.8cm, headheight=3.5cm, headsep =     15pt, includefoot, includeheadfoot]{geometry}  

%----------------------------------------------------------------------------------------

\begin{document}

\vspace*{-1.1cm}  % Move top box up

\noindent \hspace*{-1in} 
\colorbox{red}{\begin{minipage}{\paperwidth}%
% Start text back at original margin
    \vspace{0.3cm} 
    \hspace*{0.9in} % distance from left edge
\color{white}
\Huge Title

% Fill to bottom of page? Not working
\vspace*{\fill}\mbox{}
\end{minipage}
}

\vspace*{-1cm}

\noindent \hspace*{-1in} 
\colorbox{blue}{\begin{minipage}{\paperwidth}%
% Start text back at original margin
    \vspace{0.8cm} 
    \hspace*{0.9in} % distance from left edge
\color{white}
\huge Subtitle

% Fill to bottom of page? Not working
\vspace*{\fill}\mbox{}
  \end{minipage}
}


\begin{minipage}{0.75\textwidth}
\vspace*{0.8cm} 
\subsubsection*{Executive Summary:}
Test text. Test text. Test text. Test text. Test text. Test text. Test     text. Test text. Test text. Test text.  \\
Test text. Test text. Test text. Test text. Test text. Test text. Test     text. Test text. Test text. Test text. \\
Test text. Test text. Test text. Test text. Test text. Test text. Test text. Test text. Test text. Test text. 
\end{minipage}%
\hfill
\begin{minipage}[t]{0.20\textwidth} \flushright
\vspace*{-0.8cm} 
Test text. Test text. Test text. Test text. Test text. Test text. Test     text. Test text. Test text. Test text.  \\
Test text. Test text. Test text. Test text. Test text. Test text. Test     text. Test text. Test text. Test text. \\
Test text. Test text. Test text. Test text. Test text. Test text. Test text. Test text. Test text. Test text. 

\end{minipage}%

% ==================== Front Page Bottom

\newpage

\end{document}

答案1

这是完整的 TikZ 解决方案。我决定使用 ysep 对齐节点以处理额外的\vspace

\documentclass[paper=a4, twoside]{article}     % A4 paper and 11pt font size
\usepackage{multirow}
\usepackage{hhline}
\usepackage{calc}
\usepackage{tabularx}
\usepackage{xparse}
\usepackage{longtable,booktabs}
\usepackage{lipsum} % Used for inserting dummy 'Lorem ipsum' text into the template
\usepackage[english]{babel} % English language/hyphenation
\usepackage[protrusion=true,expansion=true]{microtype} % Better typography
\usepackage{amsmath,amsfonts,amsthm} % Math packages
\usepackage[svgnames, table]{xcolor} % Enabling colors by their 'svgnames'
\usepackage[hang, normalsize,labelfont=bf,up,textfont=it,up]{caption} %     Custom captions under/above floats in tables or figures
\usepackage{booktabs} % Horizontal rules in tables
\usepackage{mdframed}
\usepackage{lmodern} 
\usepackage{xparse}
\usepackage[margin=2.25cm,bottom=2cm,top=0.8cm, headheight=3.5cm, headsep=15pt,includeheadfoot]{geometry}  

\usepackage{tikzpagenodes}
\usetikzlibrary{backgrounds}

%----------------------------------------------------------------------------------------

\begin{document}

\begin{tikzpicture}[overlay, remember picture, every node/.style={inner xsep=0pt}]
\path (current page text area.north west) + (0pt,1.1cm)
  node[below right, color=white, inner ysep=0.4cm] (title) {\Huge Title};
\node[below right, color=white, inner ysep=0.4cm] (subtitle) at (title.south west) {\huge Subtitle};
\node[below right, inner ysep=0.4cm, text width=0.75\textwidth] (text1) at (subtitle.south west)
  {\subsubsection*{Executive Summary:}
  Test text. Test text. Test text. Test text. Test text. Test text. Test     text. Test text. Test text. Test text.\\
  Test text. Test text. Test text. Test text. Test text. Test text. Test     text. Test text. Test text. Test text.\\
  Test text. Test text. Test text. Test text. Test text. Test text. Test text. Test text. Test text. Test text.};
\path (text1.north east) + (.05\textwidth,0pt)
  node[below right, inner ysep=0.4cm,text width=0.2\textwidth] (text2) {\sloppy\subsubsection*{}
Test text. Test text. Test text. Test text. Test text. Test text. Test     text. Test text. Test text. Test text.  \\
Test text. Test text. Test text. Test text. Test text. Test text. Test     text. Test text. Test text. Test text. \\
Test text. Test text. Test text. Test text. Test text. Test text. Test text. Test text. Test text. Test text.};

\begin{scope}[on background layer]
  \fill[red] (title.north -| current page.west) rectangle (title.south -| current page.east);% fill entire page
  \fill[blue] (subtitle.north -| current page.west) rectangle (subtitle.south -| current page.east);
  \fill[green] (text2.north west) ++(-.025\textwidth,0pt) rectangle (current page.south east);
\end{scope}
\end{tikzpicture}
\newpage
\end{document}

演示

答案2

快速而简单的破解方法:在文本后面放置合适尺寸的规则。

\documentclass{article} 
\usepackage{lipsum} 
\usepackage[svgnames, table]{xcolor} 
\usepackage[margin=2.25cm,bottom=2cm,top=0.8cm, headheight=3.5cm, headsep = 15pt, includefoot, includeheadfoot]{geometry}  

\begin{document}

\begin{picture}(0,0)
    \put(370,-650){\color{green}\rule{6cm}{21cm}}
    \put(-79,0){\color{red}\rule{\paperwidth}{1.2cm}}
    \put(-79,-70){\color{blue}\rule{\paperwidth}{2.5cm}}
    \put(-20,7){\color{white}\Huge Title}
    \put(-20,-40){\color{white}\huge Subtitle}
\end{picture}

\vskip3.5cm

\subsubsection*{Executive Summary:}
\begin{minipage}[t]{0.75\textwidth}
\lipsum[2]
\end{minipage}%
\hfill
\begin{minipage}[t]{0.20\textwidth} 
\flushright
\lipsum[2]
\end{minipage}

\end{document}

在此处输入图片描述

相关内容