布局修改:像这样的简单代码!

布局修改:像这样的简单代码!

我是新来的。我在网上找到了一个代码,正在研究它以获得手册的良好布局。

现在我有这个代码:

\documentclass[11pt,a4paper]{book}
\usepackage{calc}
\usepackage[left=1.5cm, right=1.5cm, bindingoffset=1.5cm, headheight=120pt, top={120pt+10mm}]{geometry}
\usepackage{fancyhdr}
\usepackage[explicit,calcwidth]{titlesec}
\usepackage{tikz}
\usepackage{lipsum}
\usepackage{fourier}
\usepackage{xcolor}

\definecolor{gmitblue}{RGB}{93,138,168}
\definecolor{mybluei}{RGB}{0,173,239}
\definecolor{myblueii}{RGB}{63,200,244}
\definecolor{line}{RGB}{70,160,216}

\usetikzlibrary{calc}
\renewcommand{\headrulewidth}{0pt}
\newcommand\hdheight{1in}
\newcommand\ftheight{.5in}
\newcommand\SectionFont{\usefont{T1}{qhv}{b}{n}\selectfont}

\titleformat{\section}
      {\normalfont\SectionFont\color{myblueii}}
      {\tikz[baseline=(a.base), overlay]{
            \node[fill=mybluei, anchor=south west, outer sep=0, draw=none, inner sep=.5mm,
                text=white,font=\Large, text width=1.5cm, align=center, minimum height=8.5mm,
                label={[text=myblueii]right:#1}
            ] (a) {\thesection};
        \foreach \x in {.25,.5,.75}{%
        \draw[mybluei, ultra thick] (a) ($(a.south west)!\x!(a.north west)$) --++ (-4,0);
        }
        \draw[myblueii, ultra thick] ($(a.south east)!.25!(a.north east)$) --++ (\textwidth-1.6cm,0);
        }
      }
      {1em}
      {}

\pagestyle{fancy}
\fancyhf{}
\fancyhead[O]{%
  \begin{tikzpicture}[overlay, remember picture]%
    \fill[gmitblue] (current page.north west) rectangle ($(current page.north east)+(0,-\hdheight)$);
    \draw[line] ([yshift=-\hdheight]current page.north west) -- ([yshift=-\hdheight]current page.north east);
    \ifnum\value{chapter}=0
    %  \node[anchor=south west, text width=11.5cm, text=white, font=\fontsize{.7cm}{1.5cm}\selectfont\bfseries] at ($(current page.north west)+(.5\hdheight,-\hdheight)$) {\raggedleft\rightmark};
    \else
      \node[anchor=south west, text width=2cm, text=white, font=\fontsize{2cm}{1.5cm} \selectfont\bfseries] (oddpagenum) at ($(current page.north west)+(.5\hdheight,-\hdheight)$) {\thechapter};
     % \node[anchor=south west, text width=11.5cm, text=white, font=\fontsize{.5cm}{1.5cm} \selectfont\bfseries] (chapter) at (oddpagenum.south east) {\quad TOPIC TO BE DISCUSSED};
    \fi
  %  \node[anchor=north east, inner xsep=5mm] at (current page.north east) {\includegraphics[height=120pt]{example-image-a}};
  \end{tikzpicture}%
}

% dettagli grafici
\fancyhead[E]{%
  \begin{tikzpicture}[overlay, remember picture]%
    \fill[gmitblue] (current page.north west) rectangle ($(current page.north east)+(0,-\hdheight)$);
    \draw[line] ([yshift=-\hdheight]current page.north west) -- ([yshift=-\hdheight]current page.north east);
 %   \node[anchor=south east, text width=7cm, text=white, font=\fontsize{.7cm}{1.5cm}\selectfont\bfseries] (evenpagenum) at ($(current page.north east)+(-.5\hdheight,-\hdheight)$) {\raggedleft\rightmark};
  %  \node[anchor=north west, inner xsep=5mm] at (current page.north west) {\includegraphics[scale=0.7]{opendata}};
  \end{tikzpicture}%
}

% le tre voci in basso nelle testatine nella pagina dispari 
\fancyfoot[CE]{
  \begin{tikzpicture}[overlay, remember picture]%
    \fill[gmitblue] (current page.south west) rectangle ($(current page.south east)+(0,.5in)$);
    \node[anchor=south west, text=white, font=\Large\bfseries, minimum size=.5in] at (current page.south west) {\thepage};
    \node[anchor=south, text=white, font=\large, minimum size=.5in] at (current page.south) {\includegraphics[scale=0.7]{opendata}};
    \node[anchor=south east, text=white, font=\large, minimum size=.5in, inner xsep=5mm] at (current page.south east) {\today};
  \end{tikzpicture}%
}

% le tre voci in basso nelle testatine nella pagina pari
\fancyfoot[CO]{
  \begin{tikzpicture}[overlay, remember picture]%
    \fill[gmitblue] (current page.south west) rectangle ($(current page.south east)+(0,.5in)$);
    \node[anchor=south west, text=white, font=\large, minimum size=.5in, inner xsep=5mm] at (current page.south west) {\today};
    \node[anchor=south, text=white, font=\large, minimum size=.5in] at (current page.south) {\includegraphics[scale=0.7]{opendata}};
    \node[anchor=south east, text=white, font=\Large\bfseries, minimum size=.5in] at (current page.south east) {\thepage};
  \end{tikzpicture}%
}

\title{A reasonably long title}
\date{\today}
\author{The author}

\titleformat{\chapter}[display]
{\normalfont\huge\bfseries}{}{0pt}{\Huge#1}
\titlespacing*{\chapter} {0pt}{20pt}{40pt}

\titleformat{\chapter}[display]
{\normalfont\huge\bfseries}{}{0pt}{\Huge#1}[\leavevmode\thispagestyle{fancy}]
\titlespacing*{\chapter} {0pt}{20pt}{40pt}


% quadrati colorati

\usepackage{xcolor}
\newcommand\crule[3][black]{\textcolor{#1}{\rule{#2}{#3}}}

% quadrati colorati


\begin{document}
\maketitle
\tableofcontents
\listoffigures

\chapter{Problem 1}


\crule{1cm}{1cm} \crule[blue]{1cm}{1cm} \crule[red!50!white!100]{1cm}{1cm} 

\chapter{Problem 2}

\chapter{Problem 3}


\end{document}
formatting color chapters fontsize bold

我的目标是:

  1. 有一个简单的代码并获得相同的图形结果
  2. 而是蓝色矩形,有波浪(这意味着不是一条线,而是边框像波浪,而不是直线
  3. 日期并不重要,但页码很重要,例如
  4. 在每章的开头,如果可能的话,我想减少数字和标题之间的间距(或将标题放在数字附近)
  5. 在每页的顶部看到波浪(显然是反向的)
  6. 项目清单

答案1

也许是这样的?我不明白你到底想实现什么……

\documentclass[11pt,a4paper]{book}
\usepackage{calc}
\usepackage[left=1.5cm, right=1.5cm, bindingoffset=1.5cm, headheight=120pt, top={120pt+10mm}]{geometry}
\usepackage{fancyhdr}
\usepackage[explicit,calcwidth]{titlesec}
\usepackage{tikz}
\usepackage{lipsum}
\usepackage{fourier}
\usepackage{xcolor}

\definecolor{gmitblue}{RGB}{93,138,168}
\definecolor{mybluei}{RGB}{0,173,239}
\definecolor{myblueii}{RGB}{63,200,244}
\definecolor{line}{RGB}{70,160,216}

\usetikzlibrary{calc}
\renewcommand{\headrulewidth}{0pt}
\newcommand\hdheight{1in}
\newcommand\ftheight{.5in}
\newcommand\SectionFont{\usefont{T1}{qhv}{b}{n}\selectfont}

\titleformat{\section}
      {\normalfont\SectionFont\color{myblueii}}
      {\tikz[baseline=(a.base), overlay]{
            \node[fill=mybluei, anchor=south west, outer sep=0, draw=none, inner sep=.5mm,
                text=white,font=\Large, text width=1.5cm, align=center, minimum height=8.5mm,
                label={[text=myblueii]right:#1}
            ] (a) {\thesection};
        \foreach \x in {.25,.5,.75}{%
        \draw[mybluei, ultra thick] (a) ($(a.south west)!\x!(a.north west)$) --++ (-4,0);
        }
        \draw[myblueii, ultra thick] ($(a.south east)!.25!(a.north east)$) --++ (\textwidth-1.6cm,0);
        }
      }
      {1em}
      {}

\pagestyle{fancy}
\fancyhf{}
\fancyhead[O]{%
  \begin{tikzpicture}[overlay, remember picture]%
%    \fill[gmitblue] (current page.north west) rectangle ($(current page.north east)+(0,-\hdheight)$);
%    \draw[line] ([yshift=-\hdheight]current page.north west) -- ([yshift=-\hdheight]current page.north east);
    \ifnum\value{chapter}=0
    %  \node[anchor=south west, text width=11.5cm, text=white, font=\fontsize{.7cm}{1.5cm}\selectfont\bfseries] at ($(current page.north west)+(.5\hdheight,-\hdheight)$) {\raggedleft\rightmark};
    \else
      \node[anchor=south west, text width=2cm, text=black, font=\fontsize{2cm}{1.5cm} \selectfont\bfseries] (oddpagenum) at ($(current page.north west)+(.5\hdheight,-1.5*\hdheight)$) {\thechapter};
     % \node[anchor=south west, text width=11.5cm, text=white, font=\fontsize{.5cm}{1.5cm} \selectfont\bfseries] (chapter) at (oddpagenum.south east) {\quad TOPIC TO BE DISCUSSED};
    \fi
  %  \node[anchor=north east, inner xsep=5mm] at (current page.north east) {\includegraphics[height=120pt]{example-image-a}};
  \end{tikzpicture}%
}

% dettagli grafici
\fancyhead[E]{%
  \begin{tikzpicture}[overlay, remember picture]%
    \fill[gmitblue] (current page.north west) rectangle ($(current page.north east)+(0,-\hdheight)$);
    \draw[line] ([yshift=-\hdheight]current page.north west) -- ([yshift=-\hdheight]current page.north east);
 %   \node[anchor=south east, text width=7cm, text=white, font=\fontsize{.7cm}{1.5cm}\selectfont\bfseries] (evenpagenum) at ($(current page.north east)+(-.5\hdheight,-\hdheight)$) {\raggedleft\rightmark};
  %  \node[anchor=north west, inner xsep=5mm] at (current page.north west) {\includegraphics[scale=0.7]{opendata}};
  \end{tikzpicture}%
}

% le tre voci in basso nelle testatine nella pagina dispari 
\fancyfoot[CE]{
  \begin{tikzpicture}[overlay, remember picture]%
    \fill[gmitblue] (current page.south west) rectangle ($(current page.south east)+(0,.5in)$);
    \node[anchor=south west, text=white, font=\Large\bfseries, minimum size=.5in] at (current page.south west) {\thepage};
    \node[anchor=south, text=white, font=\large, minimum size=.5in] at (current page.south) {HALLO};
    \node[anchor=south east, text=white, font=\large, minimum size=.5in, inner xsep=5mm] at (current page.south east) {\today};
  \end{tikzpicture}%
}

% le tre voci in basso nelle testatine nella pagina pari
\fancyfoot[CO]{
  \begin{tikzpicture}[overlay, remember picture]%
%    \fill[gmitblue] (current page.south west) rectangle ($(current page.south east)+(0,.5in)$);
    \fill[gmitblue] ([yshift=2cm]current page.south west) .. controls ([yshift=2cm]$([yshift=2cm]current page.south west)!.25!([yshift=2cm]current page.south east)$) and ([yshift=-2cm]$([yshift=2cm]current page.south west)!.75!([yshift=2cm]current page.south east)$) .. ([yshift=2cm]current page.south east) -- (current page.south east) -- (current page.south west) -- cycle;
    \fill[gmitblue] ([yshift=-2cm]current page.north west) .. controls ([yshift=-2cm]$([yshift=2cm]current page.north west)!.25!([yshift=2cm]current page.north east)$) and ([yshift=-2cm]$([yshift=-2cm]current page.north west)!.75!([yshift=-2cm]current page.north east)$) .. ([yshift=-2cm]current page.north east) -- (current page.north east) -- (current page.north west) -- cycle;
    \node[anchor=south west, text=white, font=\large, minimum size=.5in, inner xsep=5mm] at (current page.south west) {\today};
    \node[anchor=south, text=white, font=\large, minimum size=.5in] at (current page.south) {HALLO};
    \node[anchor=south east, text=white, font=\Large\bfseries, minimum size=.5in] at (current page.south east) {\thepage};
  \end{tikzpicture}%
}

\title{A reasonably long title}
\date{\today}
\author{The author}

\titleformat{\chapter}[display]
{\normalfont\huge\bfseries}{}{0pt}{\Huge#1}
\titlespacing*{\chapter} {0pt}{20pt}{40pt}

\titleformat{\chapter}[display]
{\normalfont\huge\bfseries}{}{0pt}{\Huge#1}[\leavevmode\thispagestyle{fancy}]
\titlespacing*{\chapter} {0pt}{20pt}{40pt}


% quadrati colorati

\usepackage{xcolor}
\newcommand\crule[3][black]{\textcolor{#1}{\rule{#2}{#3}}}

% quadrati colorati


\begin{document}
\maketitle
\tableofcontents
\listoffigures

\chapter{Problem$\,$1}


\crule{1cm}{1cm} \crule[blue]{1cm}{1cm} \crule[red!50!white!100]{1cm}{1cm} 

\chapter{Problem 2}

\chapter{Problem 3}

\section{Test}

\begin{itemize}
    \item Test
    \item Test
    \item Test
    \item Test
\end{itemize}

\end{document}

相关内容