- Questo topic ha 4 risposte, 3 partecipanti ed è stato aggiornato l'ultima volta 7 anni, 10 mesi fa da .
-
Topic
-
Salve a tutti, sono nuovo nel mondo di LaTeX ma lo trovo già uno strumento molto potente per vari scopi.Ho visto che si può imposare un layout grafico per i documenti, per renderli meno scarni visivamente! ho provato a usare template già fatti sul web, esempi creati da altri, ma credo ci siano parti che vorrei eliminare e parti che vorrei modificare.
Vedo che si parla di TiKZ e per ora è davvero un mistero! magari in futuro lo apprenderò certamente!Il codice che ho trovato è il seguente:
`
\documentclass[11pt,a4paper]{book}
\usepackage{calc}
\usepackage{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`
Ovviamente ho commentato alcune parti, a naso, e funziona, visto che non mi interessava avere info sulla data di compilazione (o data in gernerale).
Opera è il logo del browser che ho usato come esempio.L’ideale per me sarebbe ottenere:
– numerazione a sinistra per pagine dispari
– numerazione a destra per le pagine pari
– invece di un rettangolo blu in alto e in basso mi piacerebbe avere una forma d’onda (o meglio ilnvece di essere dritto, almeno un motivetto ecco, per dare una forma più aggraziata)SO che chiedo troppo come primo utente, ma credo si possa fare, e soprattutto, si può ottenere il mio risultato, magari senza usare TiKZ / con un codice molto più semplice???

- Devi essere connesso per rispondere a questo topic.