文章中精美的彩色部分(如 Legrand 橙皮书)

文章中精美的彩色部分(如 Legrand 橙皮书)

我想知道如何整理代码并使用新命令或环境来处理特殊部分。我有代码,但它不是很智能。我使用了蛮力方法。另外,部分编号是黑色的。此外,我希望部分背景会小一点。如果你有更好或更聪明的方法来使它相似,请帮忙。想法来自http://www.latextemplates.com/template/the-legrand-orange-book

\documentclass[12pt,a4paper]{article}
\usepackage{geometry}
\usepackage{xcolor}
\usepackage{amsmath}
\usepackage[some]{background}
\usepackage{lipsum}

\definecolor{titlepagecolor}{cmyk}{1,.60,0,.40}

\backgroundsetup{
scale=1,
angle=0,
opacity=.9,
contents={\begin{tikzpicture}[remember picture,overlay]
 \path [fill=titlepagecolor] (current page.west)rectangle (current page.north east); 
 \draw [color=white, very thick] (4,0)--(4,0.5\paperheight);
\end{tikzpicture}}
}

\makeatletter                   
\def\printauthor{%                  
    {\large \@author}}          
\makeatother

\author{%
    ghfghfg  \\
    Department name \\
    \texttt{[email protected]}\vspace{40pt} \\
    fgdfgdfgd \\
    dfgdfgdfgdfg \\
    \texttt{[email protected]}
    }

\begin{document}
\BgThispage
\newgeometry{left=1cm,right=6cm,bottom=2cm}

\tableofcontents


\begin{abstract} 
An abstract is a brief summary of a research article, thesis, review, conference proceeding or any in-depth analysis of a particular subject or discipline, and is often used to help the reader quickly ascertain the paper's purpose. When used, an abstract always appears at the beginning of a manuscript, acting as the point-of-entry for any given scientific paper or patent application. Abstracting and indexing services for various academic disciplines are aimed at compiling a body of literature for that particular subject.
    \end{abstract}


\begin{titlepage}
\BgThispage
\newgeometry{left=1cm,right=6cm,bottom=2cm}

\section{\textcolor{white}{\Huge\textbf{\textsf{First section}}}}
\vspace*{0.4\textheight}
\noindent
\vspace*{2cm}\par
\noindent
\begin{minipage}{0.35\linewidth}
    \begin{flushright}
        \printauthor
    \end{flushright}
\end{minipage} \hspace{15pt}
%
\begin{minipage}{0.02\linewidth}
    \rule{1pt}{175pt}
\end{minipage} \hspace{-10pt}
%
\begin{minipage}{0.63\linewidth}
\vspace{5pt}
    \begin{abstract} 
An abstract is a brief summary of a research article, thesis, review, conference proceeding or any in-depth analysis of a particular subject or discipline, and is often used to help the reader quickly ascertain the paper's purpose. When used, an abstract always appears at the beginning of a manuscript, acting as the point-of-entry for any given scientific paper or patent application. Abstracting and indexing services for various academic disciplines are aimed at compiling a body of literature for that particular subject.
    \end{abstract}
\end{minipage}
\end{titlepage}
\restoregeometry


\newpage

\BgThispage
\newgeometry{left=1cm,right=6cm,bottom=2cm}

\section{\textcolor{white}{\Huge\textbf{\textsf{Second section}}}}
\vspace*{0.4\textheight}
\noindent
\vspace*{2cm}\par
\noindent
\begin{minipage}{0.35\linewidth}
    \begin{flushright}
        \printauthor
    \end{flushright}
\end{minipage} \hspace{15pt}
%
\begin{minipage}{0.02\linewidth}
    \rule{1pt}{175pt}
\end{minipage} \hspace{-10pt}
%
\begin{minipage}{0.63\linewidth}
\vspace{5pt}
    \begin{abstract} 
An abstract is a brief summary of a research article, thesis, review, conference proceeding or any in-depth analysis of a particular subject or discipline, and is often used to help the reader quickly ascertain the paper's purpose. When used, an abstract always appears at the beginning of a manuscript, acting as the point-of-entry for any given scientific paper or patent application. Abstracting and indexing services for various academic disciplines are aimed at compiling a body of literature for that particular subject.
    \end{abstract}
\end{minipage}

\end{document}

答案1

这是一个稍微干净一些的版本,但仍然有很多不足之处……

\documentclass[12pt,a4paper]{article}
\usepackage{geometry}
\usepackage{xcolor}
\usepackage{amsmath}
\usepackage[some]{background}
\usepackage{titlesec,afterpage}

\definecolor{titlepagecolor}{cmyk}{1,.60,0,.40}

\backgroundsetup{
  scale=1,
  angle=0,
  opacity=.9,
  contents={\begin{tikzpicture}[remember picture,overlay]
      \path [fill=titlepagecolor] (current page.west)rectangle (current page.north east);
      \draw [color=white, very thick] (4,0)--(4,0.5\paperheight);
    \end{tikzpicture}}}

\makeatletter
\def\printauthor{%
  {\large \@author}}
\makeatother

\author{%
  ghfghfg  \\
  Department name \\
  \texttt{[email protected]}\vspace{40pt} \\
  fgdfgdfgd \\
  dfgdfgdfgdfg \\
  \texttt{[email protected]}
}

\titleformat{\section}[hang]{%
  \BgThispage\color{white}\Huge\bfseries\sffamily
}{\thesection}{1.5em}{}

\newcommand\myabstract[2][\printauthor]{%
  \vspace*{.5\textheight}\par
  \noindent
  \begin{minipage}{0.35\linewidth}
    \begin{flushright}
      #1
    \end{flushright}
  \end{minipage}\hspace{15pt}
  %
  \begin{minipage}{0.02\linewidth}
    \rule{1pt}{175pt}
  \end{minipage}\hspace{-10pt}
  %
  \begin{minipage}{0.63\linewidth}
    \vspace{5pt}
    \begin{abstract}
      #2
    \end{abstract}
  \end{minipage}
  \restoregeometry}

\begin{document}

  \newgeometry{left=1cm,right=6cm,bottom=2cm,showframe}
  \savegeometry{geometrysec}
  \tableofcontents

  \loadgeometry{geometrysec}
  \section{First section}

  \myabstract{%
    An abstract is a brief summary of a research article, thesis, review, conference proceeding or any in-depth analysis of a particular subject or discipline, and is often used to help the reader quickly ascertain the paper's purpose. When used, an abstract always appears at the beginning of a manuscript, acting as the point-of-entry for any given scientific paper or patent application. Abstracting and indexing services for various academic disciplines are aimed at compiling a body of literature for that particular subject.}

  Some text.

  \loadgeometry{geometrysec}
  \section{Second section}

  \myabstract{%
    An abstract is a brief summary of a research article, thesis, review, conference proceeding or any in-depth analysis of a particular subject or discipline, and is often used to help the reader quickly ascertain the paper's purpose. When used, an abstract always appears at the beginning of a manuscript, acting as the point-of-entry for any given scientific paper or patent application. Abstracting and indexing services for various academic disciplines are aimed at compiling a body of literature for that particular subject.}

  Some more text.

\end{document}

稍微干净一点...

相关内容