如何调整迷你页面的位置

如何调整迷你页面的位置

在我的下面的 MWE 中,根据找到的模板开发这里,我该如何改变 的位置minipage?比如说,我想将其移到minipage页面的下方,我该怎么做?

这是我的代码:

\documentclass[11pt]{book}
\usepackage[top=3cm,bottom=3cm,left=3.2cm,right=3.2cm,headsep=10pt,a4paper]{geometry}
\usepackage{booktabs}
\usepackage[demo]{graphicx}
\usepackage{mwe}
\usepackage{tikz}
\usepackage{xcolor}
\definecolor{ultramarine}{RGB}{0,45,97}
\definecolor{cpiOrange}{RGB}{241,85,44}
\definecolor{cpiGray}{RGB}{106,100,100}
\definecolor{myred}{RGB}{177,14,35}

\begin{document}

\begingroup

\setlength{\parskip}{1.2ex plus 0.5ex minus 0.2ex}
\setlength{\parindent}{0in}

\thispagestyle{empty}
\newgeometry{margin = 0in}
\setlength{\fboxsep}{0pt}
\hfill \colorbox{ultramarine}{\makebox[3.22in][r]{\shortstack[r]{\vspace{2.75in}}}}%
\vspace{-0.25pt}
\setlength{\fboxsep}{10pt}
\setlength{\fboxrule}{0pt}
\colorbox{myred}{\makebox[8.05in][l]{\hfill \shortstack[r]{\fontsize{36}{36}\rmfamily\color{white} Very Cool Topic\\%
\fontsize{24}{24}\rmfamily\color{white} Assignment I}}}%
\setlength{\fboxsep}{0pt}
\vspace{-8.5pt}
\hfill {\begin{minipage}{3.22in} {\fontsize{36}{36}\rmfamily{This is the name of the Topic to be discussed}}\vspace{1cm} \\
\includegraphics[width=2.75in]{Fig_P4-6}
\end{minipage}}
\hfill \colorbox{ultramarine}{\hspace{.25in} \parbox{2.97in}{\vspace{7.5in} \color{white} \textbf{Author:{ \scshape Cooler Duder}\\Testing\\ Here we go}}}%
\restoregeometry
\endgroup

\end{document}

答案1

轻松控制元素位置的一个选项是使用textpos包及其absolute选项;一个小例子:

\documentclass[11pt]{book}
\usepackage[top=3cm,bottom=3cm,left=3.2cm,right=3.2cm,headsep=10pt,a4paper]{geometry}
\usepackage{booktabs}
\usepackage[absolute]{textpos}
\usepackage[demo]{graphicx}
\usepackage{mwe}
\usepackage{tikz}
\usepackage{xcolor}
\definecolor{ultramarine}{RGB}{0,45,97}
\definecolor{cpiOrange}{RGB}{241,85,44}
\definecolor{cpiGray}{RGB}{106,100,100}
\definecolor{myred}{RGB}{177,14,35}

\begin{document}

\begingroup

\setlength{\parskip}{1.2ex plus 0.5ex minus 0.2ex}
\setlength{\parindent}{0in}

\thispagestyle{empty}
\newgeometry{margin = 0in}
\setlength{\fboxsep}{0pt}
\hfill \colorbox{ultramarine}{\makebox[3.22in][r]{\shortstack[r]{\vspace{2.75in}}}}%
\vspace{-0.25pt}
\setlength{\fboxsep}{10pt}
\setlength{\fboxrule}{0pt}
\colorbox{myred}{\makebox[8.05in][l]{\hfill \shortstack[r]{\fontsize{36}{36}\rmfamily\color{white} Very Cool Topic\\%
\fontsize{24}{24}\rmfamily\color{white} Assignment I}}}%
\setlength{\fboxsep}{0pt}
\vspace{-8.5pt}\hfill 
{%
\begin{textblock*}{3.22in}(3cm,14cm)%
    \begin{minipage}{3.22in} 
    {\fontsize{36}{36}\rmfamily This is the name of the Topic to be discussed\par}
    \vspace{1cm}
  \includegraphics[width=2.75in]{Fig_P4-6}
  \end{minipage}%
  \end{textblock*}%
}
\hfill\colorbox{ultramarine}{\hspace{.25in} \parbox{2.97in}{\vspace{7.5in} \color{white} \textbf{Author:{ \scshape Cooler Duder}\\Testing\\ Here we go}}}%
\restoregeometry
\endgroup

\end{document}

更改括号内的值

\begin{textblock*}{3.22in}(3cm,14cm)

将元素移动到所需位置。

在此处输入图片描述

另一个选择是,由于您已经加载了 TikZ,因此将其放置minipage在里面\node并使用remember picture,overlay选项tikzpicture和特殊的current page.<anchor>锚点系列。

附注:请注意,我已将代码更改minipage

{\fontsize{36}{36}\rmfamily This is the name of the Topic to be discussed\par}

否则,您的设置\baselineskip将会应用错误的值。

相关内容