1

I'm new here. I found a code online and I'm working on it to obtain a good layout for my manual.

Now I have this code:

\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

My goals are:

  1. have a simply code and obtain the same graphic result
  2. instead blue rectangle, have waves (it means that non a line but the border will be like a wave, not a straight line
  3. is not important to have the date, but is important to have the page numbers like the example
  4. at the beginning of each chapter, if it is possible, I want to reduce the space between the number and the title(or put the title near the number)
  5. on the top of each page see the wave (obviously reverse)
  6. List item
  • 1
    I can't compile your code, there's this error: : ! LaTeX Error: File "opendata" not found – AndréC Oct 31 '18 at 19:15
  • 1. Please make your code compilable. 2. You can use coils from decorations.pathmorphing to get wavy lines. The other requests are unclear to me. And please do not use the answer field to communicate with others, but update the question. – user121799 Oct 31 '18 at 21:53
  • Is there any news here? – Johannes_B Nov 15 '18 at 6:34
1

Maybe something like this? I don't understand exactly what you want to achieve …

\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}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.