Modifica struttura template già esistente : errore!

  • Questo topic ha 16 risposte, 3 partecipanti ed è stato aggiornato l'ultima volta 6 anni, 6 mesi fa da ivan.
  • Creatore
    Topic
  • #117399
    Up
    0
    Down
    ::


    Ho modificato il file structure.tex nel seguente modo

    Spoiler

    https://it.overleaf.com/latex/templates/the-legrand-orange-book-template-english/jtctyfmnpppc

    Spoiler

    `

    %—————————————————————————————-
    % MAIN TABLE OF CONTENTS
    %—————————————————————————————-

    \usepackage{titletoc} % Required for manipulating the table of contents

    %\contentsmargin{0cm} % Removes the default margin

    % Part text styling (this is mostly taken care of in the PART HEADINGS section of this file)
    \titlecontents{part}
    [0cm] % Left indentation
    {\addvspace{20pt}\bfseries} % Spacing and font options for parts
    {}
    {}
    {}

    % Chapter text styling
    \titlecontents{chapter}
    [1.25cm] % Left indentation
    {\addvspace{12pt}\large\sffamily\bfseries} % Spacing and font options for chapters
    {\color{ocre!60}\contentslabel[\Large\thecontentslabel]{1.25cm}\color{ocre}} % Formatting of numbered sections of this type
    {\color{ocre}} % Formatting of numberless sections of this type
    {\color{ocre!60}\normalsize\;\titlerule*[.5pc]{.}\;\thecontentspage} % Formatting of the filler to the right of the heading and the page number

    % Section text styling
    \titlecontents{section}
    [1.25cm] % Left indentation
    {\addvspace{3pt}\sffamily\bfseries} % Spacing and font options for sections
    {\contentslabel[\thecontentslabel]{1.25cm}} % Formatting of numbered sections of this type
    {} % Formatting of numberless sections of this type
    {\hfill\color{black}\thecontentspage} % Formatting of the filler to the right of the heading and the page number

    % Subsection text styling
    \titlecontents{subsection}
    [1.25cm] % Left indentation
    {\addvspace{1pt}\sffamily\small} % Spacing and font options for subsections
    {\contentslabel[\thecontentslabel]{1.25cm}} % Formatting of numbered sections of this type
    {} % Formatting of numberless sections of this type
    {\ \titlerule*[.5pc]{.}\;\thecontentspage} % Formatting of the filler to the right of the heading and the page number

    % Figure text styling
    \titlecontents{figure}
    [1.25cm] % Left indentation
    {\addvspace{1pt}\sffamily\small} % Spacing and font options for figures
    {\thecontentslabel\hspace*{1em}} % Formatting of numbered sections of this type
    {} % Formatting of numberless sections of this type
    {\ \titlerule*[.5pc]{.}\;\thecontentspage} % Formatting of the filler to the right of the heading and the page number

    % Table text styling
    \titlecontents{table}
    [1.25cm] % Left indentation
    {\addvspace{1pt}\sffamily\small} % Spacing and font options for tables
    {\thecontentslabel\hspace*{1em}} % Formatting of numbered sections of this type
    {} % Formatting of numberless sections of this type
    {\ \titlerule*[.5pc]{.}\;\thecontentspage} % Formatting of the filler to the right of the heading and the page number

    %—————————————————————————————-
    % MINI TABLE OF CONTENTS IN PART HEADS
    %—————————————————————————————-

    % Chapter text styling
    \titlecontents{lchapter}
    [0em] % Left indentation
    {\addvspace{15pt}\large\sffamily\bfseries} % Spacing and font options for chapters
    {\color{ocre}\contentslabel[\Large\thecontentslabel]{1.25cm}\color{ocre}} % Chapter number
    {}
    {\color{ocre}\normalsize\sffamily\bfseries\;\titlerule*[.5pc]{.}\;\thecontentspage} % Page number

    % Section text styling
    \titlecontents{lsection}
    [0em] % Left indentation
    {\sffamily\small} % Spacing and font options for sections
    {\contentslabel[\thecontentslabel]{1.25cm}} % Section number
    {}
    {}

    % Subsection text styling (note these aren't shown by default, display them by searchings this file for tocdepth and reading the commented text)
    \titlecontents{lsubsection}
    [.5em] % Left indentation
    {\sffamily\footnotesize} % Spacing and font options for subsections
    {\contentslabel[\thecontentslabel]{1.25cm}}
    {}
    {}

    %—————————————————————————————-
    % HEADERS AND FOOTERS
    %—————————————————————————————-

    \usepackage{fancyhdr} % Required for header and footer configuration

    \pagestyle{fancy} % Enable the custom headers and footers

    \renewcommand{\chaptermark}[1]{\markboth{\sffamily\normalsize\bfseries\chaptername\ \thechapter.\ #1}{}} % Styling for the current chapter in the header
    \renewcommand{\sectionmark}[1]{\markright{\sffamily\normalsize\thesection\hspace{5pt}#1}{}} % Styling for the current section in the header

    \fancyhf{} % Clear default headers and footers
    \fancyhead[LE,RO]{\sffamily\normalsize\thepage} % Styling for the page number in the header
    \fancyhead[LO]{\rightmark} % Print the nearest section name on the left side of odd pages
    \fancyhead[RE]{\leftmark} % Print the current chapter name on the right side of even pages
    %\fancyfoot[C]{\thepage} % Uncomment to include a footer

    \renewcommand{\headrulewidth}{0.5pt} % Thickness of the rule under the header

    \fancypagestyle{plain}{% Style for when a plain pagestyle is specified
    \fancyhead{}\renewcommand{\headrulewidth}{0pt}%
    }

    % Removes the header from odd empty pages at the end of chapters
    \makeatletter
    \renewcommand{\cleardoublepage}{
    \clearpage\ifodd\c@page\else
    \hbox{}
    \vspace*{\fill}
    \thispagestyle{empty}
    \newpage
    \fi}

    %—————————————————————————————-
    % THEOREM STYLES
    %—————————————————————————————-

    \usepackage{amsmath,amsfonts,amssymb,amsthm} % For math equations, theorems, symbols, etc

    \newcommand{\intoo}[2]{\mathopen{]}#1\,;#2\mathclose{[}}
    \newcommand{\ud}{\mathop{\mathrm{{}d}}\mathopen{}}
    \newcommand{\intff}[2]{\mathopen{[}#1\,;#2\mathclose{]}}
    \renewcommand{\qedsymbol}{$\blacksquare$}
    \newtheorem{notation}{Notation}[chapter]

    % Boxed/framed environments
    \newtheoremstyle{ocrenumbox}% Theorem style name
    {0pt}% Space above
    {0pt}% Space below
    {\normalfont}% Body font
    {}% Indent amount
    {\small\bf\sffamily\color{ocre}}% Theorem head font
    {\;}% Punctuation after theorem head
    {0.25em}% Space after theorem head
    {\small\sffamily\color{ocre}\thmname{#1}\nobreakspace\thmnumber{\@ifnotempty{#1}{}\@upn{#2}}% Theorem text (e.g. Theorem 2.1)
    \thmnote{\nobreakspace\the\thm@notefont\sffamily\bfseries\color{black}—\nobreakspace#3.}} % Optional theorem note

    \newtheoremstyle{blacknumex}% Theorem style name
    {5pt}% Space above
    {5pt}% Space below
    {\normalfont}% Body font
    {} % Indent amount
    {\small\bf\sffamily}% Theorem head font
    {\;}% Punctuation after theorem head
    {0.25em}% Space after theorem head
    {\small\sffamily{\tiny\ensuremath{\blacksquare}}\nobreakspace\thmname{#1}\nobreakspace\thmnumber{\@ifnotempty{#1}{}\@upn{#2}}% Theorem text (e.g. Theorem 2.1)
    \thmnote{\nobreakspace\the\thm@notefont\sffamily\bfseries—\nobreakspace#3.}}% Optional theorem note

    \newtheoremstyle{blacknumbox} % Theorem style name
    {0pt}% Space above
    {0pt}% Space below
    {\normalfont}% Body font
    {}% Indent amount
    {\small\bf\sffamily}% Theorem head font
    {\;}% Punctuation after theorem head
    {0.25em}% Space after theorem head
    {\small\sffamily\thmname{#1}\nobreakspace\thmnumber{\@ifnotempty{#1}{}\@upn{#2}}% Theorem text (e.g. Theorem 2.1)
    \thmnote{\nobreakspace\the\thm@notefont\sffamily\bfseries—\nobreakspace#3.}}% Optional theorem note

    % Non-boxed/non-framed environments
    \newtheoremstyle{ocrenum}% Theorem style name
    {5pt}% Space above
    {5pt}% Space below
    {\normalfont}% Body font
    {}% Indent amount
    {\small\bf\sffamily\color{ocre}}% Theorem head font
    {\;}% Punctuation after theorem head
    {0.25em}% Space after theorem head
    {\small\sffamily\color{ocre}\thmname{#1}\nobreakspace\thmnumber{\@ifnotempty{#1}{}\@upn{#2}}% Theorem text (e.g. Theorem 2.1)
    \thmnote{\nobreakspace\the\thm@notefont\sffamily\bfseries\color{black}—\nobreakspace#3.}} % Optional theorem note
    \makeatother

    % Defines the theorem text style for each type of theorem to one of the three styles above
    \newcounter{dummy}
    \numberwithin{dummy}{section}
    \theoremstyle{ocrenumbox}
    \newtheorem{theoremeT}[dummy]{Theorem}
    \newtheorem{problem}{Problem}[chapter]
    \newtheorem{exerciseT}{Exercise}[chapter]
    \theoremstyle{blacknumex}
    \newtheorem{exampleT}{Example}[chapter]
    \theoremstyle{blacknumbox}
    \newtheorem{vocabulary}{Vocabulary}[chapter]
    \newtheorem{definitionT}{Definition}[section]
    \newtheorem{corollaryT}[dummy]{Corollary}
    \theoremstyle{ocrenum}
    \newtheorem{proposition}[dummy]{Proposition}

    %—————————————————————————————-
    % REMARK ENVIRONMENT
    %—————————————————————————————-

    \newenvironment{remark}{\par\vspace{10pt}\small % Vertical white space above the remark and smaller font size
    \begin{list}{}{
    \leftmargin=35pt % Indentation on the left
    \rightmargin=25pt}\item\ignorespaces % Indentation on the right
    \makebox[-2.5pt]{\begin{tikzpicture}[overlay]
    \node[draw=ocre!60,line width=1pt,circle,fill=ocre!25,font=\sffamily\bfseries,inner sep=2pt,outer sep=0pt] at (-15pt,0pt){\textcolor{ocre}{R}};\end{tikzpicture}} % Orange R in a circle
    \advance\baselineskip -1pt}{\end{list}\vskip5pt} % Tighter line spacing and white space after remark

    %—————————————————————————————-
    % SECTION NUMBERING IN THE MARGIN
    %—————————————————————————————-

    \makeatletter
    \renewcommand{\@seccntformat}[1]{\llap{\textcolor{ocre}{\csname the#1\endcsname}\hspace{1em}}}
    \renewcommand{\section}{\@startsection{section}{1}{\z@}
    {-4ex \@plus -1ex \@minus -.4ex}
    {1ex \@plus.2ex }
    {\normalfont\large\sffamily\bfseries}}
    \renewcommand{\subsection}{\@startsection {subsection}{2}{\z@}
    {-3ex \@plus -0.1ex \@minus -.4ex}
    {0.5ex \@plus.2ex }
    {\normalfont\sffamily\bfseries}}
    \renewcommand{\subsubsection}{\@startsection {subsubsection}{3}{\z@}
    {-2ex \@plus -0.1ex \@minus -.2ex}
    {.2ex \@plus.2ex }
    {\normalfont\small\sffamily\bfseries}}
    \renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}
    {-2ex \@plus-.2ex \@minus .2ex}
    {.1ex}
    {\normalfont\small\sffamily\bfseries}}

    %—————————————————————————————-
    % PART HEADINGS
    %—————————————————————————————-

    % Numbered part in the table of contents
    \newcommand{\@mypartnumtocformat}[2]{%
    \setlength\fboxsep{0pt}%
    \noindent\colorbox{ocre!20}{\strut\parbox[c][.7cm]{\ecart}{\color{ocre!70}\Large\sffamily\bfseries\centering#1}}\hskip\esp\colorbox{ocre!40}{\strut\parbox[c][.7cm]{\linewidth-\ecart-\esp}{\Large\sffamily\centering#2}}%
    }

    % Unnumbered part in the table of contents
    \newcommand{\@myparttocformat}[1]{%
    \setlength\fboxsep{0pt}%
    \noindent\colorbox{ocre!40}{\strut\parbox[c][.7cm]{\linewidth}{\Large\sffamily\centering#1}}%
    }

    \newlength\esp
    \setlength\esp{4pt}
    \newlength\ecart
    \setlength\ecart{1.2cm-\esp}
    \newcommand{\thepartimage}{}%
    \newcommand{\partimage}[1]{\renewcommand{\thepartimage}{#1}}%
    \def\@part[#1]#2{%
    \ifnum \c@secnumdepth >-2\relax%
    \refstepcounter{part}%
    \addcontentsline{toc}{part}{\texorpdfstring{\protect\@mypartnumtocformat{\thepart}{#1}}{\partname~\thepart\ —\ #1}}
    \else%
    \addcontentsline{toc}{part}{\texorpdfstring{\protect\@myparttocformat{#1}}{#1}}%
    \fi%
    \startcontents%
    \markboth{}{}%
    {\thispagestyle{empty}%
    \begin{tikzpicture}[remember picture,overlay]%
    \node at (current page.north west){\begin{tikzpicture}[remember picture,overlay]%
    \fill[ocre!20](0cm,0cm) rectangle (\paperwidth,-\paperheight);
    \node[anchor=north] at (4cm,-3.25cm){\color{ocre!40}\fontsize{220}{100}\sffamily\bfseries\thepart};
    \node[anchor=south east] at (\paperwidth-1cm,-\paperheight+1cm){\parbox[t][][t]{8.5cm}{
    \printcontents{l}{0}{\setcounter{tocdepth}{1}}% The depth to which the Part mini table of contents displays headings; 0 for chapters only, 1 for chapters and sections and 2 for chapters, sections and subsections
    }};
    \node[anchor=north east] at (\paperwidth-1.5cm,-3.25cm){\parbox[t][][t]{15cm}{\strut\raggedleft\color{white}\fontsize{30}{30}\sffamily\bfseries#2}};
    \end{tikzpicture}};
    \end{tikzpicture}}%
    \@endpart}
    \def\@spart#1{%
    \startcontents%
    \phantomsection
    {\thispagestyle{empty}%
    \begin{tikzpicture}[remember picture,overlay]%
    \node at (current page.north west){\begin{tikzpicture}[remember picture,overlay]%
    \fill[ocre!20](0cm,0cm) rectangle (\paperwidth,-\paperheight);
    \node[anchor=north east] at (\paperwidth-1.5cm,-3.25cm){\parbox[t][][t]{15cm}{\strut\raggedleft\color{white}\fontsize{30}{30}\sffamily\bfseries#1}};
    \end{tikzpicture}};
    \end{tikzpicture}}
    \addcontentsline{toc}{part}{\texorpdfstring{%
    \setlength\fboxsep{0pt}%
    \noindent\protect\colorbox{ocre!40}{\strut\protect\parbox[c][.7cm]{\linewidth}{\Large\sffamily\protect\centering #1\quad\mbox{}}}}{#1}}%
    \@endpart}
    \def\@endpart{\vfil\newpage
    \if@twoside
    \if@openright
    \null
    \thispagestyle{empty}%
    \newpage
    \fi
    \fi
    \if@tempswa
    \twocolumn
    \fi}

    %—————————————————————————————-
    % CHAPTER HEADINGS
    %—————————————————————————————-

    % A switch to conditionally include a picture, implemented by Christian Hupfer
    \newif\ifusechapterimage
    \usechapterimagetrue
    \newcommand{\thechapterimage}{}%
    \newcommand{\chapterimage}[1]{\ifusechapterimage\renewcommand{\thechapterimage}{#1}\fi}%
    \newcommand{\autodot}{.}
    \def\@makechapterhead#1{%
    {\parindent \z@ \raggedright \normalfont
    \ifnum \c@secnumdepth >\m@ne
    \if@mainmatter
    \begin{tikzpicture}[remember picture,overlay]
    \node at (current page.north west)
    {\begin{tikzpicture}[remember picture,overlay]
    \node[anchor=north west,inner sep=0pt] at (0,0) {\ifusechapterimage\includegraphics[width=\paperwidth]{\thechapterimage}\fi};
    \draw[anchor=west] (\Gm@lmargin,-9cm) node [line width=2pt,rounded corners=15pt,draw=ocre,fill=white,fill opacity=0.5,inner sep=15pt]{\strut\makebox[22cm]{}};
    \draw[anchor=west] (\Gm@lmargin+.3cm,-9cm) node {\huge\sffamily\bfseries\color{black}\thechapter\autodot~#1\strut};
    \end{tikzpicture}};
    \end{tikzpicture}
    \else
    \begin{tikzpicture}[remember picture,overlay]
    \node at (current page.north west)
    {\begin{tikzpicture}[remember picture,overlay]
    \node[anchor=north west,inner sep=0pt] at (0,0) {\ifusechapterimage\includegraphics[width=\paperwidth]{\thechapterimage}\fi};
    \draw[anchor=west] (\Gm@lmargin,-9cm) node [line width=2pt,rounded corners=15pt,draw=ocre,fill=white,fill opacity=0.5,inner sep=15pt]{\strut\makebox[22cm]{}};
    \draw[anchor=west] (\Gm@lmargin+.3cm,-9cm) node {\huge\sffamily\bfseries\color{black}#1\strut};
    \end{tikzpicture}};
    \end{tikzpicture}
    \fi\fi\par\vspace*{270\p@}}}

    %——————————————-

    \def\@makeschapterhead#1{%
    \begin{tikzpicture}[remember picture,overlay]
    \node at (current page.north west)
    {\begin{tikzpicture}[remember picture,overlay]
    \node[anchor=north west,inner sep=0pt] at (0,0) {\ifusechapterimage\includegraphics[width=\paperwidth]{\thechapterimage}\fi};
    \draw[anchor=west] (\Gm@lmargin,-9cm) node [line width=2pt,rounded corners=15pt,draw=ocre,fill=white,fill opacity=0.5,inner sep=15pt]{\strut\makebox[22cm]{}};
    \draw[anchor=west] (\Gm@lmargin+.3cm,-9cm) node {\huge\sffamily\bfseries\color{black}#1\strut};
    \end{tikzpicture}};
    \end{tikzpicture}
    \par\vspace*{270\p@}}
    \makeatother

    %—————————————————————————————-
    % LINKS
    %—————————————————————————————-

    \usepackage{hyperref}
    \hypersetup{hidelinks,backref=true,pagebackref=true,hyperindex=true,colorlinks=false,breaklinks=true,urlcolor=ocre,bookmarks=true,bookmarksopen=false}

    \usepackage{bookmark}
    \bookmarksetup{
    open,
    numbered,
    addtohook={%
    \ifnum\bookmarkget{level}=0 % chapter
    \bookmarksetup{bold}%
    \fi
    \ifnum\bookmarkget{level}=-1 % part
    \bookmarksetup{color=ocre,bold}%
    \fi
    }
    }

    `

    Ho aggiunto i package necessari nel file principale.

    Non riesco, però, a ottenere questi risultati importanti:
    – togliere la pagina bianca da un capitolo ad un altro
    – colorare in verde (o ocre) il nome dei capitoli
    – non mi compaiono i numeri delle pagine in basso al centro

Visualizzazione 15 filoni di risposte
  • Autore
    Risposte
    • #117400
      Up
      0
      Down
      ::


      Per favore, invia un ECM: esempio minimo compilabile.
      Sottolineo che deve essere minimo, cioè contenere il minimo richiesto, e che si deve poter copiare, incollare su di un proprio file e compilare.

      Ciao
      Ivan

    • #117401
      Up
      0
      Down
      ::


      File Struttura

      `

      %—————————————————————————————-
      % HEADERS AND FOOTERS
      %—————————————————————————————-

      \usepackage{fancyhdr} % Required for header and footer configuration

      \pagestyle{fancy} % Enable the custom headers and footers

      \renewcommand{\chaptermark}[1]{\markboth{\sffamily\normalsize\bfseries\chaptername\ \thechapter.\ #1}{}} % Styling for the current chapter in the header
      \renewcommand{\sectionmark}[1]{\markright{\sffamily\normalsize\thesection\hspace{5pt}#1}{}} % Styling for the current section in the header

      \fancyhf{} % Clear default headers and footers
      \fancyhead[LE,RO]{\sffamily\normalsize\thepage} % Styling for the page number in the header
      \fancyhead[LO]{\rightmark} % Print the nearest section name on the left side of odd pages
      \fancyhead[RE]{\leftmark} % Print the current chapter name on the right side of even pages
      %\fancyfoot[C]{\thepage} % Uncomment to include a footer

      \renewcommand{\headrulewidth}{0.5pt} % Thickness of the rule under the header

      \fancypagestyle{plain}{% Style for when a plain pagestyle is specified
      \fancyhead{}\renewcommand{\headrulewidth}{0pt}%
      }

      % Removes the header from odd empty pages at the end of chapters
      \makeatletter
      \renewcommand{\cleardoublepage}{
      \clearpage\ifodd\c@page\else
      \hbox{}
      \vspace*{\fill}
      \thispagestyle{empty}
      \newpage
      \fi}

      %—————————————————————————————-
      % THEOREM STYLES
      %—————————————————————————————-

      \usepackage{amsmath,amsfonts,amssymb,amsthm} % For math equations, theorems, symbols, etc

      \newcommand{\intoo}[2]{\mathopen{]}#1\,;#2\mathclose{[}}
      \newcommand{\ud}{\mathop{\mathrm{{}d}}\mathopen{}}
      \newcommand{\intff}[2]{\mathopen{[}#1\,;#2\mathclose{]}}
      \renewcommand{\qedsymbol}{$\blacksquare$}
      \newtheorem{notation}{Notation}[chapter]

      % Boxed/framed environments
      \newtheoremstyle{ocrenumbox}% Theorem style name
      {0pt}% Space above
      {0pt}% Space below
      {\normalfont}% Body font
      {}% Indent amount
      {\small\bf\sffamily\color{ocre}}% Theorem head font
      {\;}% Punctuation after theorem head
      {0.25em}% Space after theorem head
      {\small\sffamily\color{ocre}\thmname{#1}\nobreakspace\thmnumber{\@ifnotempty{#1}{}\@upn{#2}}% Theorem text (e.g. Theorem 2.1)
      \thmnote{\nobreakspace\the\thm@notefont\sffamily\bfseries\color{black}—\nobreakspace#3.}} % Optional theorem note

      \newtheoremstyle{blacknumex}% Theorem style name
      {5pt}% Space above
      {5pt}% Space below
      {\normalfont}% Body font
      {} % Indent amount
      {\small\bf\sffamily}% Theorem head font
      {\;}% Punctuation after theorem head
      {0.25em}% Space after theorem head
      {\small\sffamily{\tiny\ensuremath{\blacksquare}}\nobreakspace\thmname{#1}\nobreakspace\thmnumber{\@ifnotempty{#1}{}\@upn{#2}}% Theorem text (e.g. Theorem 2.1)
      \thmnote{\nobreakspace\the\thm@notefont\sffamily\bfseries—\nobreakspace#3.}}% Optional theorem note

      \newtheoremstyle{blacknumbox} % Theorem style name
      {0pt}% Space above
      {0pt}% Space below
      {\normalfont}% Body font
      {}% Indent amount
      {\small\bf\sffamily}% Theorem head font
      {\;}% Punctuation after theorem head
      {0.25em}% Space after theorem head
      {\small\sffamily\thmname{#1}\nobreakspace\thmnumber{\@ifnotempty{#1}{}\@upn{#2}}% Theorem text (e.g. Theorem 2.1)
      \thmnote{\nobreakspace\the\thm@notefont\sffamily\bfseries—\nobreakspace#3.}}% Optional theorem note

      % Non-boxed/non-framed environments
      \newtheoremstyle{ocrenum}% Theorem style name
      {5pt}% Space above
      {5pt}% Space below
      {\normalfont}% Body font
      {}% Indent amount
      {\small\bf\sffamily\color{ocre}}% Theorem head font
      {\;}% Punctuation after theorem head
      {0.25em}% Space after theorem head
      {\small\sffamily\color{ocre}\thmname{#1}\nobreakspace\thmnumber{\@ifnotempty{#1}{}\@upn{#2}}% Theorem text (e.g. Theorem 2.1)
      \thmnote{\nobreakspace\the\thm@notefont\sffamily\bfseries\color{black}—\nobreakspace#3.}} % Optional theorem note
      \makeatother

      % Defines the theorem text style for each type of theorem to one of the three styles above
      \newcounter{dummy}
      \numberwithin{dummy}{section}
      \theoremstyle{ocrenumbox}
      \newtheorem{theoremeT}[dummy]{Theorem}
      \newtheorem{problem}{Problem}[chapter]
      \newtheorem{exerciseT}{Exercise}[chapter]
      \theoremstyle{blacknumex}
      \newtheorem{exampleT}{Example}[chapter]
      \theoremstyle{blacknumbox}
      \newtheorem{vocabulary}{Vocabulary}[chapter]
      \newtheorem{definitionT}{Definition}[section]
      \newtheorem{corollaryT}[dummy]{Corollary}
      \theoremstyle{ocrenum}
      \newtheorem{proposition}[dummy]{Proposition}

      %—————————————————————————————-
      % REMARK ENVIRONMENT
      %—————————————————————————————-

      \newenvironment{remark}{\par\vspace{10pt}\small % Vertical white space above the remark and smaller font size
      \begin{list}{}{
      \leftmargin=35pt % Indentation on the left
      \rightmargin=25pt}\item\ignorespaces % Indentation on the right
      \makebox[-2.5pt]{\begin{tikzpicture}[overlay]
      \node[draw=ocre!60,line width=1pt,circle,fill=ocre!25,font=\sffamily\bfseries,inner sep=2pt,outer sep=0pt] at (-15pt,0pt){\textcolor{ocre}{R}};\end{tikzpicture}} % Orange R in a circle
      \advance\baselineskip -1pt}{\end{list}\vskip5pt} % Tighter line spacing and white space after remark

      %—————————————————————————————-
      % SECTION NUMBERING IN THE MARGIN
      %—————————————————————————————-

      \makeatletter
      \renewcommand{\@seccntformat}[1]{\llap{\textcolor{ocre}{\csname the#1\endcsname}\hspace{1em}}}
      \renewcommand{\section}{\@startsection{section}{1}{\z@}
      {-4ex \@plus -1ex \@minus -.4ex}
      {1ex \@plus.2ex }
      {\normalfont\large\sffamily\bfseries}}
      \renewcommand{\subsection}{\@startsection {subsection}{2}{\z@}
      {-3ex \@plus -0.1ex \@minus -.4ex}
      {0.5ex \@plus.2ex }
      {\normalfont\sffamily\bfseries}}
      \renewcommand{\subsubsection}{\@startsection {subsubsection}{3}{\z@}
      {-2ex \@plus -0.1ex \@minus -.2ex}
      {.2ex \@plus.2ex }
      {\normalfont\small\sffamily\bfseries}}
      \renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}
      {-2ex \@plus-.2ex \@minus .2ex}
      {.1ex}
      {\normalfont\small\sffamily\bfseries}}

      %—————————————————————————————-
      % PART HEADINGS
      %—————————————————————————————-

      % Numbered part in the table of contents
      \newcommand{\@mypartnumtocformat}[2]{%
      \setlength\fboxsep{0pt}%
      \noindent\colorbox{ocre!20}{\strut\parbox[c][.7cm]{\ecart}{\color{ocre!70}\Large\sffamily\bfseries\centering#1}}\hskip\esp\colorbox{ocre!40}{\strut\parbox[c][.7cm]{\linewidth-\ecart-\esp}{\Large\sffamily\centering#2}}%
      }

      % Unnumbered part in the table of contents
      \newcommand{\@myparttocformat}[1]{%
      \setlength\fboxsep{0pt}%
      \noindent\colorbox{ocre!40}{\strut\parbox[c][.7cm]{\linewidth}{\Large\sffamily\centering#1}}%
      }

      \newlength\esp
      \setlength\esp{4pt}
      \newlength\ecart
      \setlength\ecart{1.2cm-\esp}
      \newcommand{\thepartimage}{}%
      \newcommand{\partimage}[1]{\renewcommand{\thepartimage}{#1}}%
      \def\@part[#1]#2{%
      \ifnum \c@secnumdepth >-2\relax%
      \refstepcounter{part}%
      \addcontentsline{toc}{part}{\texorpdfstring{\protect\@mypartnumtocformat{\thepart}{#1}}{\partname~\thepart\ —\ #1}}
      \else%
      \addcontentsline{toc}{part}{\texorpdfstring{\protect\@myparttocformat{#1}}{#1}}%
      \fi%
      \startcontents%
      \markboth{}{}%
      {\thispagestyle{empty}%
      \begin{tikzpicture}[remember picture,overlay]%
      \node at (current page.north west){\begin{tikzpicture}[remember picture,overlay]%
      \fill[ocre!20](0cm,0cm) rectangle (\paperwidth,-\paperheight);
      \node[anchor=north] at (4cm,-3.25cm){\color{ocre!40}\fontsize{220}{100}\sffamily\bfseries\thepart};
      \node[anchor=south east] at (\paperwidth-1cm,-\paperheight+1cm){\parbox[t][][t]{8.5cm}{
      \printcontents{l}{0}{\setcounter{tocdepth}{1}}% The depth to which the Part mini table of contents displays headings; 0 for chapters only, 1 for chapters and sections and 2 for chapters, sections and subsections
      }};
      \node[anchor=north east] at (\paperwidth-1.5cm,-3.25cm){\parbox[t][][t]{15cm}{\strut\raggedleft\color{white}\fontsize{30}{30}\sffamily\bfseries#2}};
      \end{tikzpicture}};
      \end{tikzpicture}}%
      \@endpart}
      \def\@spart#1{%
      \startcontents%
      \phantomsection
      {\thispagestyle{empty}%
      \begin{tikzpicture}[remember picture,overlay]%
      \node at (current page.north west){\begin{tikzpicture}[remember picture,overlay]%
      \fill[ocre!20](0cm,0cm) rectangle (\paperwidth,-\paperheight);
      \node[anchor=north east] at (\paperwidth-1.5cm,-3.25cm){\parbox[t][][t]{15cm}{\strut\raggedleft\color{white}\fontsize{30}{30}\sffamily\bfseries#1}};
      \end{tikzpicture}};
      \end{tikzpicture}}
      \addcontentsline{toc}{part}{\texorpdfstring{%
      \setlength\fboxsep{0pt}%
      \noindent\protect\colorbox{ocre!40}{\strut\protect\parbox[c][.7cm]{\linewidth}{\Large\sffamily\protect\centering #1\quad\mbox{}}}}{#1}}%
      \@endpart}
      \def\@endpart{\vfil\newpage
      \if@twoside
      \if@openright
      \null
      \thispagestyle{empty}%
      \newpage
      \fi
      \fi
      \if@tempswa
      \twocolumn
      \fi}

      %—————————————————————————————-
      % CHAPTER HEADINGS
      %—————————————————————————————-

      % A switch to conditionally include a picture, implemented by Christian Hupfer
      \newif\ifusechapterimage
      \usechapterimagetrue
      \newcommand{\thechapterimage}{}%
      \newcommand{\chapterimage}[1]{\ifusechapterimage\renewcommand{\thechapterimage}{#1}\fi}%
      \newcommand{\autodot}{.}
      \def\@makechapterhead#1{%
      {\parindent \z@ \raggedright \normalfont
      \ifnum \c@secnumdepth >\m@ne
      \if@mainmatter
      \begin{tikzpicture}[remember picture,overlay]
      \node at (current page.north west)
      {\begin{tikzpicture}[remember picture,overlay]
      \node[anchor=north west,inner sep=0pt] at (0,0) {\ifusechapterimage\includegraphics[width=\paperwidth]{\thechapterimage}\fi};
      \draw[anchor=west] (\Gm@lmargin,-9cm) node [line width=2pt,rounded corners=15pt,draw=ocre,fill=white,fill opacity=0.5,inner sep=15pt]{\strut\makebox[22cm]{}};
      \draw[anchor=west] (\Gm@lmargin+.3cm,-9cm) node {\huge\sffamily\bfseries\color{black}\thechapter\autodot~#1\strut};
      \end{tikzpicture}};
      \end{tikzpicture}
      \else
      \begin{tikzpicture}[remember picture,overlay]
      \node at (current page.north west)
      {\begin{tikzpicture}[remember picture,overlay]
      \node[anchor=north west,inner sep=0pt] at (0,0) {\ifusechapterimage\includegraphics[width=\paperwidth]{\thechapterimage}\fi};
      \draw[anchor=west] (\Gm@lmargin,-9cm) node [line width=2pt,rounded corners=15pt,draw=ocre,fill=white,fill opacity=0.5,inner sep=15pt]{\strut\makebox[22cm]{}};
      \draw[anchor=west] (\Gm@lmargin+.3cm,-9cm) node {\huge\sffamily\bfseries\color{black}#1\strut};
      \end{tikzpicture}};
      \end{tikzpicture}
      \fi\fi\par\vspace*{270\p@}}}

      %——————————————-

      \def\@makeschapterhead#1{%
      \begin{tikzpicture}[remember picture,overlay]
      \node at (current page.north west)
      {\begin{tikzpicture}[remember picture,overlay]
      \node[anchor=north west,inner sep=0pt] at (0,0) {\ifusechapterimage\includegraphics[width=\paperwidth]{\thechapterimage}\fi};
      \draw[anchor=west] (\Gm@lmargin,-9cm) node [line width=2pt,rounded corners=15pt,draw=ocre,fill=white,fill opacity=0.5,inner sep=15pt]{\strut\makebox[22cm]{}};
      \draw[anchor=west] (\Gm@lmargin+.3cm,-9cm) node {\huge\sffamily\bfseries\color{black}#1\strut};
      \end{tikzpicture}};
      \end{tikzpicture}
      \par\vspace*{270\p@}}
      \makeatother

      %—————————————————————————————-
      % LINKS
      %—————————————————————————————-

      \usepackage{hyperref}
      \hypersetup{hidelinks,backref=true,pagebackref=true,hyperindex=true,colorlinks=false,breaklinks=true,urlcolor=ocre,bookmarks=true,bookmarksopen=false}

      \usepackage{bookmark}
      \bookmarksetup{
      open,
      numbered,
      addtohook={%
      \ifnum\bookmarkget{level}=0 % chapter
      \bookmarksetup{bold}%
      \fi
      \ifnum\bookmarkget{level}=-1 % part
      \bookmarksetup{color=ocre,bold}%
      \fi
      }
      }

      `

      File main

      `
      \documentclass[12pt,a4paper,oneside]{book}

      \usepackage[T1]{fontenc}
      \usepackage[utf8]{inputenc}
      \usepackage[english,italian]{babel}
      \usepackage[sfdefault]{roboto}

      \linespread{1.55}

      \usepackage{layaureo}

      \usepackage{tikz}
      \graphicspath{{Pictures/}}
      \usepackage{graphicx}

      \usepackage{enumitem}
      \setlist{nolistsep}
      \usepackage{booktabs}

      \usepackage{xcolor} % Required for specifying colors by name
      \definecolor{ocre}{RGB}{64,141,146} % Define the orange color used for highlighting throughout the book

      \usepackage[style=numeric,citestyle=numeric,sorting=nyt,sortcites=true,autopunct=true,babel=hyphen,hyperref=true,abbreviate=false,backref=true,backend=biber]{biblatex}

      \input{structure.tex}

      \usepackage{hyperref}
      \hypersetup{
      colorlinks,
      linkcolor=ocre,
      linktoc=all
      }

      \begin{document}

      \chapterimage{chapter_head_1.pdf} % Table of contents heading image

      \tableofcontents

      \pagestyle{plain}

      \frontmatter

      \chapterimage{prova.pdf} % Chapter heading image

      \input{capitoli/introduzione}
      \input{capitoli/finalnote}

      \mainmatter

      \input{capitoli/capitolo1}
      \input{capitoli/capitolo2}
      \input{capitoli/capitolo3}
      \input{capitoli/capitolo4}
      \input{capitoli/capitolo5}
      \input{capitoli/capitolo6}
      \input{capitoli/summary}
      \input{capitoli/acknowledgements}

      \input{capitoli/bibliografia}

      \end{document}

      `

    • #117402
      Up
      0
      Down
      ::


      Porta pazienza. Serve un codice unico, che sia minimo e compilabile.
      Dubito che tutti quei \input siano necessari. C’è qualcosa di non chiaro nel concetto di codice minimo?
      E nel concetto di compilabile?
      Ecco un esempio minimo compilabile:
      `\documentclass{article}
      \begin{document}

      \chapter{Capitolo che non funziona}

      \end{document]`
      Questo esempio è il minimo che serve per mostrare il problema: ovvero che \chapter non è definito nella classe article.

      Ciao
      Ivan

    • #117403
      Up
      0
      Down
      ::


      Questo è il codice minimo compilabile

      `
      \documentclass[12pt,a4paper,oneside]{book}

      \usepackage[T1]{fontenc}
      \usepackage[utf8]{inputenc}
      \usepackage[english,italian]{babel}
      \usepackage[sfdefault]{roboto}

      \linespread{1.55}

      \usepackage{layaureo}

      \usepackage{tikz}
      \graphicspath{{Pictures/}}
      \usepackage{graphicx}

      \usepackage{enumitem}
      \setlist{nolistsep}
      \usepackage{booktabs}

      \usepackage{xcolor} % Required for specifying colors by name
      \definecolor{ocre}{RGB}{64,141,146} % Define the orange color used for highlighting throughout the book

      \usepackage[style=numeric,citestyle=numeric,sorting=nyt,sortcites=true,autopunct=true,babel=hyphen,hyperref=true,abbreviate=false,backref=true,backend=biber]{biblatex}

      \usepackage{hyperref}
      \hypersetup{
      colorlinks,
      linkcolor=ocre,
      linktoc=all
      }

      \usepackage{fancyhdr}
      \pagestyle{fancy}
      \fancyfoot[CO,CE]{\thepage}

      %—————————————————————————————-
      % SECTION NUMBERING IN THE MARGIN
      %—————————————————————————————-

      \makeatletter
      \renewcommand{\@seccntformat}[1]{\llap{\textcolor{ocre}{\csname the#1\endcsname}\hspace{1em}}}
      \renewcommand{\section}{\@startsection{section}{1}{\z@}
      {-4ex \@plus -1ex \@minus -.4ex}
      {1ex \@plus.2ex }
      {\normalfont\large\sffamily\bfseries}}
      \renewcommand{\subsection}{\@startsection {subsection}{2}{\z@}
      {-3ex \@plus -0.1ex \@minus -.4ex}
      {0.5ex \@plus.2ex }
      {\normalfont\sffamily\bfseries}}
      \renewcommand{\subsubsection}{\@startsection {subsubsection}{3}{\z@}
      {-2ex \@plus -0.1ex \@minus -.2ex}
      {.2ex \@plus.2ex }
      {\normalfont\small\sffamily\bfseries}}
      \renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}
      {-2ex \@plus-.2ex \@minus .2ex}
      {.1ex}
      {\normalfont\small\sffamily\bfseries}}

      %—————————————————————————————-
      % PART HEADINGS
      %—————————————————————————————-

      % Numbered part in the table of contents
      \newcommand{\@mypartnumtocformat}[2]{%
      \setlength\fboxsep{0pt}%
      \noindent\colorbox{ocre!20}{\strut\parbox[c][.7cm]{\ecart}{\color{ocre!70}\Large\sffamily\bfseries\centering#1}}\hskip\esp\colorbox{ocre!40}{\strut\parbox[c][.7cm]{\linewidth-\ecart-\esp}{\Large\sffamily\centering#2}}%
      }

      % Unnumbered part in the table of contents
      \newcommand{\@myparttocformat}[1]{%
      \setlength\fboxsep{0pt}%
      \noindent\colorbox{ocre!40}{\strut\parbox[c][.7cm]{\linewidth}{\Large\sffamily\centering#1}}%
      }

      \newlength\esp
      \setlength\esp{4pt}
      \newlength\ecart
      \setlength\ecart{1.2cm-\esp}
      \newcommand{\thepartimage}{}%
      \newcommand{\partimage}[1]{\renewcommand{\thepartimage}{#1}}%
      \def\@part[#1]#2{%
      \ifnum \c@secnumdepth >-2\relax%
      \refstepcounter{part}%
      \addcontentsline{toc}{part}{\texorpdfstring{\protect\@mypartnumtocformat{\thepart}{#1}}{\partname~\thepart\ —\ #1}}
      \else%
      \addcontentsline{toc}{part}{\texorpdfstring{\protect\@myparttocformat{#1}}{#1}}%
      \fi%
      \startcontents%
      \markboth{}{}%
      {\thispagestyle{empty}%
      \begin{tikzpicture}[remember picture,overlay]%
      \node at (current page.north west){\begin{tikzpicture}[remember picture,overlay]%
      \fill[ocre!20](0cm,0cm) rectangle (\paperwidth,-\paperheight);
      \node[anchor=north] at (4cm,-3.25cm){\color{ocre!40}\fontsize{220}{100}\sffamily\bfseries\thepart};
      \node[anchor=south east] at (\paperwidth-1cm,-\paperheight+1cm){\parbox[t][][t]{8.5cm}{
      \printcontents{l}{0}{\setcounter{tocdepth}{1}}% The depth to which the Part mini table of contents displays headings; 0 for chapters only, 1 for chapters and sections and 2 for chapters, sections and subsections
      }};
      \node[anchor=north east] at (\paperwidth-1.5cm,-3.25cm){\parbox[t][][t]{15cm}{\strut\raggedleft\color{white}\fontsize{30}{30}\sffamily\bfseries#2}};
      \end{tikzpicture}};
      \end{tikzpicture}}%
      \@endpart}
      \def\@spart#1{%
      \startcontents%
      \phantomsection
      {\thispagestyle{empty}%
      \begin{tikzpicture}[remember picture,overlay]%
      \node at (current page.north west){\begin{tikzpicture}[remember picture,overlay]%
      \fill[ocre!20](0cm,0cm) rectangle (\paperwidth,-\paperheight);
      \node[anchor=north east] at (\paperwidth-1.5cm,-3.25cm){\parbox[t][][t]{15cm}{\strut\raggedleft\color{white}\fontsize{30}{30}\sffamily\bfseries#1}};
      \end{tikzpicture}};
      \end{tikzpicture}}
      \addcontentsline{toc}{part}{\texorpdfstring{%
      \setlength\fboxsep{0pt}%
      \noindent\protect\colorbox{ocre!40}{\strut\protect\parbox[c][.7cm]{\linewidth}{\Large\sffamily\protect\centering #1\quad\mbox{}}}}{#1}}%
      \@endpart}
      \def\@endpart{\vfil\newpage
      \if@twoside
      \if@openright
      \null
      \thispagestyle{empty}%
      \newpage
      \fi
      \fi
      \if@tempswa
      \twocolumn
      \fi}

      %—————————————————————————————-
      % CHAPTER HEADINGS
      %—————————————————————————————-

      % A switch to conditionally include a picture, implemented by Christian Hupfer
      \newif\ifusechapterimage
      \usechapterimagetrue
      \newcommand{\thechapterimage}{}%
      \newcommand{\chapterimage}[1]{\ifusechapterimage\renewcommand{\thechapterimage}{#1}\fi}%
      \newcommand{\autodot}{.}
      \def\@makechapterhead#1{%
      {\parindent \z@ \raggedright \normalfont
      \ifnum \c@secnumdepth >\m@ne
      \if@mainmatter
      \begin{tikzpicture}[remember picture,overlay]
      \node at (current page.north west)
      {\begin{tikzpicture}[remember picture,overlay]
      \node[anchor=north west,inner sep=0pt] at (0,0) {\ifusechapterimage\includegraphics[width=\paperwidth]{\thechapterimage}\fi};
      \draw[anchor=west] (\Gm@lmargin,-9cm) node [line width=2pt,rounded corners=15pt,draw=ocre,fill=white,fill opacity=0.5,inner sep=15pt]{\strut\makebox[22cm]{}};
      \draw[anchor=west] (\Gm@lmargin+.3cm,-9cm) node {\huge\sffamily\bfseries\color{black}\thechapter\autodot~#1\strut};
      \end{tikzpicture}};
      \end{tikzpicture}
      \else
      \begin{tikzpicture}[remember picture,overlay]
      \node at (current page.north west)
      {\begin{tikzpicture}[remember picture,overlay]
      \node[anchor=north west,inner sep=0pt] at (0,0) {\ifusechapterimage\includegraphics[width=\paperwidth]{\thechapterimage}\fi};
      \draw[anchor=west] (\Gm@lmargin,-9cm) node [line width=2pt,rounded corners=15pt,draw=ocre,fill=white,fill opacity=0.5,inner sep=15pt]{\strut\makebox[22cm]{}};
      \draw[anchor=west] (\Gm@lmargin+.3cm,-9cm) node {\huge\sffamily\bfseries\color{black}#1\strut};
      \end{tikzpicture}};
      \end{tikzpicture}
      \fi\fi\par\vspace*{270\p@}}}

      %——————————————-

      \def\@makeschapterhead#1{%
      \begin{tikzpicture}[remember picture,overlay]
      \node at (current page.north west)
      {\begin{tikzpicture}[remember picture,overlay]
      \node[anchor=north west,inner sep=0pt] at (0,0) {\ifusechapterimage\includegraphics[width=\paperwidth]{\thechapterimage}\fi};
      \draw[anchor=west] (\Gm@lmargin,-9cm) node [line width=2pt,rounded corners=15pt,draw=ocre,fill=white,fill opacity=0.5,inner sep=15pt]{\strut\makebox[22cm]{}};
      \draw[anchor=west] (\Gm@lmargin+.3cm,-9cm) node {\huge\sffamily\bfseries\color{black}#1\strut};
      \end{tikzpicture}};
      \end{tikzpicture}
      \par\vspace*{270\p@}}
      \makeatother

      %—————————————————————————————-
      % END CUSTOMIZATION STRUCTURE
      %—————————————————————————————-

      \begin{document}

      \chapterimage{chapter_head_1.pdf} % Table of contents heading image

      \frontmatter

      \tableofcontents

      \pagestyle{plain}

      \chapterimage{prova.pdf} % Chapter heading image

      \input{capitoli/introduzione}
      \let\cleardoublepage\clearpage
      \input{capitoli/finalnote}

      \mainmatter

      \let\cleardoublepage\clearpage
      \input{capitoli/capitolo1}
      \let\cleardoublepage\clearpage
      \input{capitoli/capitolo2}
      \input{capitoli/capitolo3}
      \input{capitoli/capitolo4}
      \input{capitoli/capitolo5}
      \input{capitoli/capitolo6}
      \input{capitoli/summary}
      \input{capitoli/acknowledgements}

      \input{capitoli/bibliografia}

      \end{document}

      `

      Basta togliere gli input e si ottiene un file che si compila.

      Qui sono riuscita a mettere i numeri di pagina e a togliere la pagina bianca tra i vari capitoli.

      Mi interessa:
      – colorare di verde la scritta dei capitoli
      – togliere il numero al capitolo e inserirlo nella TOC (la procedura classica genera errore – mancanza di \item)

    • #117404
      Up
      0
      Down
      ::

      dani94dc” post=117829
      Basta togliere gli input e si ottiene un file che si compila.

      1) E quindi non potevi farlo tu?
      2) Tuttavia, è vero che compila, ma si ottiene un errore. Se sostituisco con
      `
      \begin{document}

      \chapter{Lipsum}

      \end{document}
      `
      ottengo un errore. Sarà evidentemente dovuto a qualcosa nel preambolo.
      Cerca di isolare il problema.
      Comunque ora almeno abbiamo un esempio compilabile che riproduce un errore.

      dani94dc” post=117829
      Qui sono riuscita a mettere i numeri di pagina e a togliere la pagina bianca tra i vari capitoli.

      Ho visto che hai usato `\let\cleardoublepage\clearpage`
      Ok, funziona, ma non è il modo più elegante. Ma prima di trovare una soluzione migliore bisogna partire da un esempio minimo compilabile.

      dani94dc” post=117829
      Mi interessa:
      – colorare di verde la scritta dei capitoli
      – togliere il numero al capitolo e inserirlo nella TOC (la procedura classica genera errore – mancanza di \item)

      Ciao
      Ivan

    • #117405
      Up
      0
      Down
      ::


      Forse non mi sono spiegata: il problema non dipende dagli input, che importano i capitoli. Ho specificato quello perchè non posso passarvi i capitoli del file. Basta che inseriate del testo lipsum, fittizio.

      Ho aggiornato il file

      `
      \documentclass[12pt,a4paper,oneside]{book}

      \usepackage[T1]{fontenc}
      \usepackage[utf8]{inputenc}
      \usepackage[english]{babel}
      \usepackage[sfdefault]{roboto}

      \linespread{1.55}

      \usepackage{layaureo}

      \usepackage{tikz}
      \graphicspath{{Pictures/}}
      \usepackage{graphicx}

      \usepackage{enumitem}
      \setlist{nolistsep}
      \usepackage{booktabs}

      \usepackage{xcolor} % Required for specifying colors by name
      \definecolor{ocre}{RGB}{64,141,146} % Define the orange color used for highlighting throughout the book

      \usepackage[style=numeric,citestyle=numeric,sorting=nyt,sortcites=true,autopunct=true,babel=hyphen,hyperref=true,abbreviate=false,backref=true,backend=biber]{biblatex}

      \usepackage{hyperref}
      \hypersetup{
      colorlinks,
      linkcolor=ocre,
      linktoc=all
      }

      \usepackage{fancyhdr}
      \pagestyle{fancy}
      \fancyfoot[CO,CE]{\thepage}

      %—————————————————————————————-
      % SECTION NUMBERING IN THE MARGIN
      %—————————————————————————————-

      \makeatletter
      \renewcommand{\@seccntformat}[1]{\llap{\textcolor{ocre}{\csname the#1\endcsname}\hspace{1em}}}
      \renewcommand{\section}{\@startsection{section}{1}{\z@}
      {-4ex \@plus -1ex \@minus -.4ex}
      {1ex \@plus.2ex }
      {\normalfont\large\sffamily\bfseries}}
      \renewcommand{\subsection}{\@startsection {subsection}{2}{\z@}
      {-3ex \@plus -0.1ex \@minus -.4ex}
      {0.5ex \@plus.2ex }
      {\normalfont\sffamily\bfseries}}
      \renewcommand{\subsubsection}{\@startsection {subsubsection}{3}{\z@}
      {-2ex \@plus -0.1ex \@minus -.2ex}
      {.2ex \@plus.2ex }
      {\normalfont\small\sffamily\bfseries}}
      \renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}
      {-2ex \@plus-.2ex \@minus .2ex}
      {.1ex}
      {\normalfont\small\sffamily\bfseries}}

      %—————————————————————————————-
      % PART HEADINGS
      %—————————————————————————————-

      % Numbered part in the table of contents
      \newcommand{\@mypartnumtocformat}[2]{%
      \setlength\fboxsep{0pt}%
      \noindent\colorbox{ocre!20}{\strut\parbox[c][.7cm]{\ecart}{\color{ocre!70}\Large\sffamily\bfseries\centering#1}}\hskip\esp\colorbox{ocre!40}{\strut\parbox[c][.7cm]{\linewidth-\ecart-\esp}{\Large\sffamily\centering#2}}%
      }

      % Unnumbered part in the table of contents
      \newcommand{\@myparttocformat}[1]{%
      \setlength\fboxsep{0pt}%
      \noindent\colorbox{ocre!40}{\strut\parbox[c][.7cm]{\linewidth}{\Large\sffamily\centering#1}}%
      }

      \newlength\esp
      \setlength\esp{4pt}
      \newlength\ecart
      \setlength\ecart{1.2cm-\esp}
      \newcommand{\thepartimage}{}%
      \newcommand{\partimage}[1]{\renewcommand{\thepartimage}{#1}}%
      \def\@part[#1]#2{%
      \ifnum \c@secnumdepth >-2\relax%
      \refstepcounter{part}%
      \addcontentsline{toc}{part}{\texorpdfstring{\protect\@mypartnumtocformat{\thepart}{#1}}{\partname~\thepart\ —\ #1}}
      \else%
      \addcontentsline{toc}{part}{\texorpdfstring{\protect\@myparttocformat{#1}}{#1}}%
      \fi%
      \startcontents%
      \markboth{}{}%
      {\thispagestyle{empty}%
      \begin{tikzpicture}[remember picture,overlay]%
      \node at (current page.north west){\begin{tikzpicture}[remember picture,overlay]%
      \fill[ocre!20](0cm,0cm) rectangle (\paperwidth,-\paperheight);
      \node[anchor=north] at (4cm,-3.25cm){\color{ocre!40}\fontsize{220}{100}\sffamily\bfseries\thepart};
      \node[anchor=south east] at (\paperwidth-1cm,-\paperheight+1cm){\parbox[t][][t]{8.5cm}{
      \printcontents{l}{0}{\setcounter{tocdepth}{1}}% The depth to which the Part mini table of contents displays headings; 0 for chapters only, 1 for chapters and sections and 2 for chapters, sections and subsections
      }};
      \node[anchor=north east] at (\paperwidth-1.5cm,-3.25cm){\parbox[t][][t]{15cm}{\strut\raggedleft\color{white}\fontsize{30}{30}\sffamily\bfseries#2}};
      \end{tikzpicture}};
      \end{tikzpicture}}%
      \@endpart}
      \def\@spart#1{%
      \startcontents%
      \phantomsection
      {\thispagestyle{empty}%
      \begin{tikzpicture}[remember picture,overlay]%
      \node at (current page.north west){\begin{tikzpicture}[remember picture,overlay]%
      \fill[ocre!20](0cm,0cm) rectangle (\paperwidth,-\paperheight);
      \node[anchor=north east] at (\paperwidth-1.5cm,-3.25cm){\parbox[t][][t]{15cm}{\strut\raggedleft\color{white}\fontsize{30}{30}\sffamily\bfseries#1}};
      \end{tikzpicture}};
      \end{tikzpicture}}
      \addcontentsline{toc}{part}{\texorpdfstring{%
      \setlength\fboxsep{0pt}%
      \noindent\protect\colorbox{ocre!40}{\strut\protect\parbox[c][.7cm]{\linewidth}{\Large\sffamily\protect\centering #1\quad\mbox{}}}}{#1}}%
      \@endpart}
      \def\@endpart{\vfil\newpage
      \if@twoside
      \if@openright
      \null
      \thispagestyle{empty}%
      \newpage
      \fi
      \fi
      \if@tempswa
      \twocolumn
      \fi}

      %—————————————————————————————-
      % CHAPTER HEADINGS
      %—————————————————————————————-

      % A switch to conditionally include a picture, implemented by Christian Hupfer
      \newif\ifusechapterimage
      \usechapterimagetrue
      \newcommand{\thechapterimage}{}%
      \newcommand{\chapterimage}[1]{\ifusechapterimage\renewcommand{\thechapterimage}{#1}\fi}%
      \newcommand{\autodot}{.}
      \def\@makechapterhead#1{%
      {\parindent \z@ \raggedright \normalfont
      \ifnum \c@secnumdepth >\m@ne
      \if@mainmatter
      \begin{tikzpicture}[remember picture,overlay]
      \node at (current page.north west)
      {\begin{tikzpicture}[remember picture,overlay]
      \node[anchor=north west,inner sep=0pt] at (0,0) {\ifusechapterimage\includegraphics[width=\paperwidth]{\thechapterimage}\fi};
      \draw[anchor=west] (\Gm@lmargin,-9cm) node [line width=2pt,rounded corners=15pt,draw=ocre,fill=white,fill opacity=0.5,inner sep=15pt]{\strut\makebox[22cm]{}};
      \draw[anchor=west] (\Gm@lmargin+.3cm,-9cm) node {\huge\sffamily\bfseries\color{black}\thechapter\autodot~#1\strut};
      \end{tikzpicture}};
      \end{tikzpicture}
      \else
      \begin{tikzpicture}[remember picture,overlay]
      \node at (current page.north west)
      {\begin{tikzpicture}[remember picture,overlay]
      \node[anchor=north west,inner sep=0pt] at (0,0) {\ifusechapterimage\includegraphics[width=\paperwidth]{\thechapterimage}\fi};
      \draw[anchor=west] (\Gm@lmargin,-9cm) node [line width=2pt,rounded corners=15pt,draw=ocre,fill=white,fill opacity=0.5,inner sep=15pt]{\strut\makebox[22cm]{}};
      \draw[anchor=west] (\Gm@lmargin+.3cm,-9cm) node {\huge\sffamily\bfseries\color{black}#1\strut};
      \end{tikzpicture}};
      \end{tikzpicture}
      \fi\fi\par\vspace*{270\p@}}}

      %——————————————-

      \def\@makeschapterhead#1{%
      \begin{tikzpicture}[remember picture,overlay]
      \node at (current page.north west)
      {\begin{tikzpicture}[remember picture,overlay]
      \node[anchor=north west,inner sep=0pt] at (0,0) {\ifusechapterimage\includegraphics[width=\paperwidth]{\thechapterimage}\fi};
      \draw[anchor=west] (\Gm@lmargin,-9cm) node [line width=2pt,rounded corners=15pt,draw=ocre,fill=white,fill opacity=0.5,inner sep=15pt]{\strut\makebox[22cm]{}};
      \draw[anchor=west] (\Gm@lmargin+.3cm,-9cm) node {\huge\sffamily\bfseries\color{black}#1\strut};
      \end{tikzpicture}};
      \end{tikzpicture}
      \par\vspace*{270\p@}}
      \makeatother

      %—————————————————————————————-
      % END CUSTOMIZATION STRUCTURE
      %—————————————————————————————-

      \begin{document}

      \chapterimage{prova2.pdf} % Table of contents heading image

      \frontmatter

      \tableofcontents

      \pagestyle{plain}

      \chapterimage{prova.pdf} % Chapter heading image

      \input{capitoli/scopeandpurpose}
      \addcontentsline{toc}{chapter}{Scope and purpose}
      \let\cleardoublepage\clearpage
      \input{capitoli/finalnote}
      \addcontentsline{toc}{chapter}{finalnote}

      \mainmatter

      \let\cleardoublepage\clearpage
      \input{capitoli/capitolo1}
      \addcontentsline{toc}{chapter}{Chiropractic}
      \let\cleardoublepage\clearpage
      \input{capitoli/capitolo2}
      \addcontentsline{toc}{chapter}{MSK Conditions and Chiropractic}
      \input{capitoli/capitolo3}
      \addcontentsline{toc}{chapter}{MSK Conditions and Neonatal Pain}
      \input{capitoli/capitolo4}
      \addcontentsline{toc}{chapter}{Breastfeeding Introduction}
      \input{capitoli/capitolo5}
      \input{capitoli/capitolo6}
      \input{capitoli/summary}
      \input{capitoli/acknowledgements}

      \input{capitoli/bibliografia}

      \end{document}

      Ora ho tolto i numeri ai capitoli, sto cercando di farlo con tutti.

      Non riesco, tuttavia, a cambiare il colore del titolo del capitolo, che vorrei verde (o ocre, come l'ho definito).
      Non so dove mettere le mani con TiKZ
      `

    • #117406
      Up
      0
      Down
      ::


      Ripeto, se sostituisco il tuo corpo del documento con
      `\begin{document}

      \chapter{lipsum}

      \end{document}`
      Ottengo un errore. Finché non crei un esempio minimo compilabile non se ne esce.
      Ovvio che non puoi inviarci tutti i capitoli. Ma cosa ti costa produrre un esempio così:

      `

      \begin{document}

      \chapter{Lipsum}

      Altro codice che serve per risolvere il tuo problema

      \end{document]
      `

      Ciao
      Ivan

    • #117407
      Up
      0
      Down
      ::


      Non ha molto senso sostituire il corpo del documento con quello che hai scritto.
      Il mio codice funziona perché è tutto così … se si va a stravolgere è normale che non funziona … ci ho pensato anche io.

      L’errore sarà nei comandi TiKZ … che, come dico, non conosco, ho usato, copiato e incollato e non riesco a imparare a un giorno dalla consegna della tesina…

      Quello che posso chiedervi, a questo punto, per aggirare l’ostacolo è: si può creare , con un codice meno farraginoso (e più corto), lo stesso effetto grafico che ottengo nel mio?

      Spoiler

      http://imageshack.com/a/img924/1424/eWy3vN.png

    • #117408
      Up
      0
      Down
      ::

      dani94dc” post=117827File Struttura

      `

      %—————————————————————————————-
      % HEADERS AND FOOTERS
      %—————————————————————————————-

      \usepackage{fancyhdr} % Required for header and footer configuration

      \pagestyle{fancy} % Enable the custom headers and footers

      \renewcommand{\chaptermark}[1]{\markboth{\sffamily\normalsize\bfseries\chaptername\ \thechapter.\ #1}{}} % Styling for the current chapter in the header
      \renewcommand{\sectionmark}[1]{\markright{\sffamily\normalsize\thesection\hspace{5pt}#1}{}} % Styling for the current section in the header

      \fancyhf{} % Clear default headers and footers
      \fancyhead[LE,RO]{\sffamily\normalsize\thepage} % Styling for the page number in the header
      \fancyhead[LO]{\rightmark} % Print the nearest section name on the left side of odd pages
      \fancyhead[RE]{\leftmark} % Print the current chapter name on the right side of even pages
      %\fancyfoot[C]{\thepage} % Uncomment to include a footer

      \renewcommand{\headrulewidth}{0.5pt} % Thickness of the rule under the header

      \fancypagestyle{plain}{% Style for when a plain pagestyle is specified
      \fancyhead{}\renewcommand{\headrulewidth}{0pt}%
      }

      % Removes the header from odd empty pages at the end of chapters
      \makeatletter
      \renewcommand{\cleardoublepage}{
      \clearpage\ifodd\c@page\else
      \hbox{}
      \vspace*{\fill}
      \thispagestyle{empty}
      \newpage
      \fi}

      %—————————————————————————————-
      % THEOREM STYLES
      %—————————————————————————————-

      \usepackage{amsmath,amsfonts,amssymb,amsthm} % For math equations, theorems, symbols, etc

      \newcommand{\intoo}[2]{\mathopen{]}#1\,;#2\mathclose{[}}
      \newcommand{\ud}{\mathop{\mathrm{{}d}}\mathopen{}}
      \newcommand{\intff}[2]{\mathopen{[}#1\,;#2\mathclose{]}}
      \renewcommand{\qedsymbol}{$\blacksquare$}
      \newtheorem{notation}{Notation}[chapter]

      % Boxed/framed environments
      \newtheoremstyle{ocrenumbox}% Theorem style name
      {0pt}% Space above
      {0pt}% Space below
      {\normalfont}% Body font
      {}% Indent amount
      {\small\bf\sffamily\color{ocre}}% Theorem head font
      {\;}% Punctuation after theorem head
      {0.25em}% Space after theorem head
      {\small\sffamily\color{ocre}\thmname{#1}\nobreakspace\thmnumber{\@ifnotempty{#1}{}\@upn{#2}}% Theorem text (e.g. Theorem 2.1)
      \thmnote{\nobreakspace\the\thm@notefont\sffamily\bfseries\color{black}—\nobreakspace#3.}} % Optional theorem note

      \newtheoremstyle{blacknumex}% Theorem style name
      {5pt}% Space above
      {5pt}% Space below
      {\normalfont}% Body font
      {} % Indent amount
      {\small\bf\sffamily}% Theorem head font
      {\;}% Punctuation after theorem head
      {0.25em}% Space after theorem head
      {\small\sffamily{\tiny\ensuremath{\blacksquare}}\nobreakspace\thmname{#1}\nobreakspace\thmnumber{\@ifnotempty{#1}{}\@upn{#2}}% Theorem text (e.g. Theorem 2.1)
      \thmnote{\nobreakspace\the\thm@notefont\sffamily\bfseries—\nobreakspace#3.}}% Optional theorem note

      \newtheoremstyle{blacknumbox} % Theorem style name
      {0pt}% Space above
      {0pt}% Space below
      {\normalfont}% Body font
      {}% Indent amount
      {\small\bf\sffamily}% Theorem head font
      {\;}% Punctuation after theorem head
      {0.25em}% Space after theorem head
      {\small\sffamily\thmname{#1}\nobreakspace\thmnumber{\@ifnotempty{#1}{}\@upn{#2}}% Theorem text (e.g. Theorem 2.1)
      \thmnote{\nobreakspace\the\thm@notefont\sffamily\bfseries—\nobreakspace#3.}}% Optional theorem note

      % Non-boxed/non-framed environments
      \newtheoremstyle{ocrenum}% Theorem style name
      {5pt}% Space above
      {5pt}% Space below
      {\normalfont}% Body font
      {}% Indent amount
      {\small\bf\sffamily\color{ocre}}% Theorem head font
      {\;}% Punctuation after theorem head
      {0.25em}% Space after theorem head
      {\small\sffamily\color{ocre}\thmname{#1}\nobreakspace\thmnumber{\@ifnotempty{#1}{}\@upn{#2}}% Theorem text (e.g. Theorem 2.1)
      \thmnote{\nobreakspace\the\thm@notefont\sffamily\bfseries\color{black}—\nobreakspace#3.}} % Optional theorem note
      \makeatother

      % Defines the theorem text style for each type of theorem to one of the three styles above
      \newcounter{dummy}
      \numberwithin{dummy}{section}
      \theoremstyle{ocrenumbox}
      \newtheorem{theoremeT}[dummy]{Theorem}
      \newtheorem{problem}{Problem}[chapter]
      \newtheorem{exerciseT}{Exercise}[chapter]
      \theoremstyle{blacknumex}
      \newtheorem{exampleT}{Example}[chapter]
      \theoremstyle{blacknumbox}
      \newtheorem{vocabulary}{Vocabulary}[chapter]
      \newtheorem{definitionT}{Definition}[section]
      \newtheorem{corollaryT}[dummy]{Corollary}
      \theoremstyle{ocrenum}
      \newtheorem{proposition}[dummy]{Proposition}

      %—————————————————————————————-
      % REMARK ENVIRONMENT
      %—————————————————————————————-

      \newenvironment{remark}{\par\vspace{10pt}\small % Vertical white space above the remark and smaller font size
      \begin{list}{}{
      \leftmargin=35pt % Indentation on the left
      \rightmargin=25pt}\item\ignorespaces % Indentation on the right
      \makebox[-2.5pt]{\begin{tikzpicture}[overlay]
      \node[draw=ocre!60,line width=1pt,circle,fill=ocre!25,font=\sffamily\bfseries,inner sep=2pt,outer sep=0pt] at (-15pt,0pt){\textcolor{ocre}{R}};\end{tikzpicture}} % Orange R in a circle
      \advance\baselineskip -1pt}{\end{list}\vskip5pt} % Tighter line spacing and white space after remark

      %—————————————————————————————-
      % SECTION NUMBERING IN THE MARGIN
      %—————————————————————————————-

      \makeatletter
      \renewcommand{\@seccntformat}[1]{\llap{\textcolor{ocre}{\csname the#1\endcsname}\hspace{1em}}}
      \renewcommand{\section}{\@startsection{section}{1}{\z@}
      {-4ex \@plus -1ex \@minus -.4ex}
      {1ex \@plus.2ex }
      {\normalfont\large\sffamily\bfseries}}
      \renewcommand{\subsection}{\@startsection {subsection}{2}{\z@}
      {-3ex \@plus -0.1ex \@minus -.4ex}
      {0.5ex \@plus.2ex }
      {\normalfont\sffamily\bfseries}}
      \renewcommand{\subsubsection}{\@startsection {subsubsection}{3}{\z@}
      {-2ex \@plus -0.1ex \@minus -.2ex}
      {.2ex \@plus.2ex }
      {\normalfont\small\sffamily\bfseries}}
      \renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}
      {-2ex \@plus-.2ex \@minus .2ex}
      {.1ex}
      {\normalfont\small\sffamily\bfseries}}

      %—————————————————————————————-
      % PART HEADINGS
      %—————————————————————————————-

      % Numbered part in the table of contents
      \newcommand{\@mypartnumtocformat}[2]{%
      \setlength\fboxsep{0pt}%
      \noindent\colorbox{ocre!20}{\strut\parbox[c][.7cm]{\ecart}{\color{ocre!70}\Large\sffamily\bfseries\centering#1}}\hskip\esp\colorbox{ocre!40}{\strut\parbox[c][.7cm]{\linewidth-\ecart-\esp}{\Large\sffamily\centering#2}}%
      }

      % Unnumbered part in the table of contents
      \newcommand{\@myparttocformat}[1]{%
      \setlength\fboxsep{0pt}%
      \noindent\colorbox{ocre!40}{\strut\parbox[c][.7cm]{\linewidth}{\Large\sffamily\centering#1}}%
      }

      \newlength\esp
      \setlength\esp{4pt}
      \newlength\ecart
      \setlength\ecart{1.2cm-\esp}
      \newcommand{\thepartimage}{}%
      \newcommand{\partimage}[1]{\renewcommand{\thepartimage}{#1}}%
      \def\@part[#1]#2{%
      \ifnum \c@secnumdepth >-2\relax%
      \refstepcounter{part}%
      \addcontentsline{toc}{part}{\texorpdfstring{\protect\@mypartnumtocformat{\thepart}{#1}}{\partname~\thepart\ —\ #1}}
      \else%
      \addcontentsline{toc}{part}{\texorpdfstring{\protect\@myparttocformat{#1}}{#1}}%
      \fi%
      \startcontents%
      \markboth{}{}%
      {\thispagestyle{empty}%
      \begin{tikzpicture}[remember picture,overlay]%
      \node at (current page.north west){\begin{tikzpicture}[remember picture,overlay]%
      \fill[ocre!20](0cm,0cm) rectangle (\paperwidth,-\paperheight);
      \node[anchor=north] at (4cm,-3.25cm){\color{ocre!40}\fontsize{220}{100}\sffamily\bfseries\thepart};
      \node[anchor=south east] at (\paperwidth-1cm,-\paperheight+1cm){\parbox[t][][t]{8.5cm}{
      \printcontents{l}{0}{\setcounter{tocdepth}{1}}% The depth to which the Part mini table of contents displays headings; 0 for chapters only, 1 for chapters and sections and 2 for chapters, sections and subsections
      }};
      \node[anchor=north east] at (\paperwidth-1.5cm,-3.25cm){\parbox[t][][t]{15cm}{\strut\raggedleft\color{white}\fontsize{30}{30}\sffamily\bfseries#2}};
      \end{tikzpicture}};
      \end{tikzpicture}}%
      \@endpart}
      \def\@spart#1{%
      \startcontents%
      \phantomsection
      {\thispagestyle{empty}%
      \begin{tikzpicture}[remember picture,overlay]%
      \node at (current page.north west){\begin{tikzpicture}[remember picture,overlay]%
      \fill[ocre!20](0cm,0cm) rectangle (\paperwidth,-\paperheight);
      \node[anchor=north east] at (\paperwidth-1.5cm,-3.25cm){\parbox[t][][t]{15cm}{\strut\raggedleft\color{white}\fontsize{30}{30}\sffamily\bfseries#1}};
      \end{tikzpicture}};
      \end{tikzpicture}}
      \addcontentsline{toc}{part}{\texorpdfstring{%
      \setlength\fboxsep{0pt}%
      \noindent\protect\colorbox{ocre!40}{\strut\protect\parbox[c][.7cm]{\linewidth}{\Large\sffamily\protect\centering #1\quad\mbox{}}}}{#1}}%
      \@endpart}
      \def\@endpart{\vfil\newpage
      \if@twoside
      \if@openright
      \null
      \thispagestyle{empty}%
      \newpage
      \fi
      \fi
      \if@tempswa
      \twocolumn
      \fi}

      %—————————————————————————————-
      % CHAPTER HEADINGS
      %—————————————————————————————-

      % A switch to conditionally include a picture, implemented by Christian Hupfer
      \newif\ifusechapterimage
      \usechapterimagetrue
      \newcommand{\thechapterimage}{}%
      \newcommand{\chapterimage}[1]{\ifusechapterimage\renewcommand{\thechapterimage}{#1}\fi}%
      \newcommand{\autodot}{.}
      \def\@makechapterhead#1{%
      {\parindent \z@ \raggedright \normalfont
      \ifnum \c@secnumdepth >\m@ne
      \if@mainmatter
      \begin{tikzpicture}[remember picture,overlay]
      \node at (current page.north west)
      {\begin{tikzpicture}[remember picture,overlay]
      \node[anchor=north west,inner sep=0pt] at (0,0) {\ifusechapterimage\includegraphics[width=\paperwidth]{\thechapterimage}\fi};
      \draw[anchor=west] (\Gm@lmargin,-9cm) node [line width=2pt,rounded corners=15pt,draw=ocre,fill=white,fill opacity=0.5,inner sep=15pt]{\strut\makebox[22cm]{}};
      \draw[anchor=west] (\Gm@lmargin+.3cm,-9cm) node {\huge\sffamily\bfseries\color{black}\thechapter\autodot~#1\strut};
      \end{tikzpicture}};
      \end{tikzpicture}
      \else
      \begin{tikzpicture}[remember picture,overlay]
      \node at (current page.north west)
      {\begin{tikzpicture}[remember picture,overlay]
      \node[anchor=north west,inner sep=0pt] at (0,0) {\ifusechapterimage\includegraphics[width=\paperwidth]{\thechapterimage}\fi};
      \draw[anchor=west] (\Gm@lmargin,-9cm) node [line width=2pt,rounded corners=15pt,draw=ocre,fill=white,fill opacity=0.5,inner sep=15pt]{\strut\makebox[22cm]{}};
      \draw[anchor=west] (\Gm@lmargin+.3cm,-9cm) node {\huge\sffamily\bfseries\color{black}#1\strut};
      \end{tikzpicture}};
      \end{tikzpicture}
      \fi\fi\par\vspace*{270\p@}}}

      %——————————————-

      \def\@makeschapterhead#1{%
      \begin{tikzpicture}[remember picture,overlay]
      \node at (current page.north west)
      {\begin{tikzpicture}[remember picture,overlay]
      \node[anchor=north west,inner sep=0pt] at (0,0) {\ifusechapterimage\includegraphics[width=\paperwidth]{\thechapterimage}\fi};
      \draw[anchor=west] (\Gm@lmargin,-9cm) node [line width=2pt,rounded corners=15pt,draw=ocre,fill=white,fill opacity=0.5,inner sep=15pt]{\strut\makebox[22cm]{}};
      \draw[anchor=west] (\Gm@lmargin+.3cm,-9cm) node {\huge\sffamily\bfseries\color{black}#1\strut};
      \end{tikzpicture}};
      \end{tikzpicture}
      \par\vspace*{270\p@}}
      \makeatother

      %—————————————————————————————-
      % LINKS
      %—————————————————————————————-

      \usepackage{hyperref}
      \hypersetup{hidelinks,backref=true,pagebackref=true,hyperindex=true,colorlinks=false,breaklinks=true,urlcolor=ocre,bookmarks=true,bookmarksopen=false}

      \usepackage{bookmark}
      \bookmarksetup{
      open,
      numbered,
      addtohook={%
      \ifnum\bookmarkget{level}=0 % chapter
      \bookmarksetup{bold}%
      \fi
      \ifnum\bookmarkget{level}=-1 % part
      \bookmarksetup{color=ocre,bold}%
      \fi
      }
      }

      `

      File main

      `
      \documentclass[12pt,a4paper,oneside]{book}

      \usepackage[T1]{fontenc}
      \usepackage[utf8]{inputenc}
      \usepackage[english,italian]{babel}
      \usepackage[sfdefault]{roboto}

      \linespread{1.55}

      \usepackage{layaureo}

      \usepackage{tikz}
      \graphicspath{{Pictures/}}
      \usepackage{graphicx}

      \usepackage{enumitem}
      \setlist{nolistsep}
      \usepackage{booktabs}

      \usepackage{xcolor} % Required for specifying colors by name
      \definecolor{ocre}{RGB}{64,141,146} % Define the orange color used for highlighting throughout the book

      \usepackage[style=numeric,citestyle=numeric,sorting=nyt,sortcites=true,autopunct=true,babel=hyphen,hyperref=true,abbreviate=false,backref=true,backend=biber]{biblatex}

      \input{structure.tex}

      \usepackage{hyperref}
      \hypersetup{
      colorlinks,
      linkcolor=ocre,
      linktoc=all
      }

      \begin{document}

      \chapterimage{chapter_head_1.pdf} % Table of contents heading image

      \tableofcontents

      \pagestyle{plain}

      \frontmatter

      \chapterimage{prova.pdf} % Chapter heading image

      \input{capitoli/introduzione}
      \input{capitoli/finalnote}

      \mainmatter

      \input{capitoli/capitolo1}
      \input{capitoli/capitolo2}
      \input{capitoli/capitolo3}
      \input{capitoli/capitolo4}
      \input{capitoli/capitolo5}
      \input{capitoli/capitolo6}
      \input{capitoli/summary}
      \input{capitoli/acknowledgements}

      \input{capitoli/bibliografia}

      \end{document}

      `

      Se davvero sei in grado di comprendere i codici che ci mandi, allora sei sicuramente in grado di scovare eventuali errori o di apportare tutte le modifiche del caso.

      Io ho l’impressione che tu non sappia leggere quello che mandi. Faccio outing: non sono capace di leggerlo nemmeno io, o non completamente.

      Andare in cerca di sorgenti precotti in giro per la rete (pratica che ti accomuna ad alcune nostre conoscenze) e poi ricorrere a questo forum di aiuto non è una buona ricetta,
      non lo è stata in passato e non può cominciare a esserlo con te.

      Un codice minimo compilabile è un codice che chiunque può copiare, incollare nel proprio editor e comporre. Questo codice deve essere breve, il minimo indispensabile
      per replicare il problema. Noi non possiamo metterci a commentare tutti i tuoi [tt]\input[/tt], le chiamate alle immagini messe in cartelle nel tuo disco fisso, eccetera, eccetera.
      In nessun forum del mondo accetterebbero oltre il tuo primo messaggio.

      Ora ti faccio vedere un codice minimo compilabile che riproduce un errore:
      `\documentclass{article}

      \begin{document}

      \laTeX

      \end{document}`
      Puoi copiarlo, incollarlo nel tuo editor e comporlo. Otterrai lo stesso errore che ottengo io. Ebbene: a partire da questa situazione si può sperare di ricevere una mano, perché si sta parlando la stessa lingua.

      È quello che Ivan sta cercando di dirti da un pezzo.

      Ciao
      Tommaso

    • #117409
      Up
      0
      Down
      ::


      Il link non si vede.
      Tuttavia , non è normale che non funzioni. C’è un errore nel codice tikz, è vero.
      Non si tratta di stravolgere ma di semplificare il codice e renderlo minimale.

      Ciao
      Ivan

    • #117410
      Up
      0
      Down
      ::


      Comprendo il codice, ma non quello TiKZ preconfezionato … non so come dirlo …

      L’immagine va, basta cliccarci sopra …

    • #117411
      Up
      0
      Down
      ::

      dani94dc” post=117833
      Quello che posso chiedervi, a questo punto, per aggirare l’ostacolo è: si può creare , con un codice meno farraginoso (e più corto), lo stesso effetto grafico che ottengo nel mio?

      Spoiler

      http://imageshack.com/a/img924/1424/eWy3vN.png

      Sicuramente si può riprodurre. Ma è un orrore, sia lo stile del titolo, sia il font, sia l’interlinea.
      Scusami se sono sincero, ma per riprodurre una cosa del genere non ci perdo nemmeno un minuto.

      Se ami i layout scenografici, prova classicthesis+arsclassica. Ma non ci metto la mano sul fuoco che funzioni.
      Un’alternativa è usare la classe memoir. Da Terminale: texdoc memoirchapterstyle
      Probabilmente lo stile a p. 48 ti piacerà.

      Comunque ci sono infinite alternative migliori all’immagine che hai postato.
      Diciamo che anche una classe standard come book, che di per sé non è un esempio di bellezza tipografica, riesce ad essere migliore.

      Ciao
      Ivan

    • #117412
      Up
      0
      Down
      ::


      Un codice simile è questo:

      `
      \documentclass[svgnames]{report}
      \usepackage{tikz}
      \usepackage{kpfonts}
      \usepackage[explicit]{titlesec}
      \newcommand*\chapterlabel{}
      \titleformat{\chapter}
      {\gdef\chapterlabel{}
      \normalfont\sffamily\Huge\bfseries\scshape}
      {\gdef\chapterlabel{\thechapter\ }}{0pt}
      {\begin{tikzpicture}[remember picture,overlay]
      \node[yshift=-3cm] at (current page.north west)
      {\begin{tikzpicture}[remember picture, overlay]
      \draw[fill=LightSkyBlue] (0,0) rectangle
      (\paperwidth,3cm);
      \node[anchor=east,xshift=.9\paperwidth,rectangle,
      rounded corners=20pt,inner sep=11pt,
      fill=MidnightBlue]
      {\color{white}\chapterlabel#1};
      \end{tikzpicture}
      };
      \end{tikzpicture}
      }
      \titlespacing*{\chapter}{0pt}{50pt}{-60pt}

      \begin{document}
      \tableofcontents
      \chapter{Introduction}
      Text
      \chapter{Main}
      \section{Section}
      Text
      \begin{thebibliography}{99}
      \bibitem{Test} test reference
      \end{thebibliography}
      \end{document}
      `

      Si potrebbe inserire al posto del colore azzurrino un’ìmmagine? così ci metto quella che uso io.
      Sarebbe tutto più semplice no? ovviamente considerando che è più alta e non un bordino

    • #117413
      Up
      0
      Down
      ::


      Particolarmente orribile anche questo stile di capitolo. L’avevo già visto in rete, temo.
      Per aggiungere l’immagine metti questa riga alla fine dell’ambiente tikzpicture.
      `
      {\color{white}\chapterlabel#1};
      \node at (18,2) {\includegraphics{imgfile}};%<< aggiungere questa riga ` Dovrai aggiustare il posizionamento e le dimensioni dell'immagine. Ciao Ivan

    • #117414
      Up
      0
      Down
      ::


      è più complicato di quel che sembra …

    • #117415
      Up
      0
      Down
      ::


      Nella vita già è complicato fare cose belle. Fossi in te non perderei tempo per fare cose brutte.
      Ora, il tuo prof. può anche averti imposto il font Roboto. Di gente strana in giro ce n’è.
      Può anche averti imposto l’interlinea espansa (tu usi \linespread{1.55}). Pessima idea anche questa.
      Ma mai e poi mai mi convincerai che ti sta obbligando a usare quello stile di capitolo.
      Ipotizzo quindi che è una cosa che vuoi fare tu. Per carità, del tutto comprensibile se
      si trattasse di creare qualcosa di veramente bello. Ma in questo caso siamo ben lontani dal bello.
      Detto questo, il mio ultimo codice consente di inserire l’immagine che preferisci in qualsiasi posizione,
      basta usare l’argomento opzionale di \includegraphics e modificare opportunamente le coordinate,
      ovvero i numeri tra parentesi tonde. Certo bisogna conoscere il comando \includegraphics e un minimo
      anche tikz.

      Ciao
      Ivan

Visualizzazione 15 filoni di risposte
  • Devi essere connesso per rispondere a questo topic.

Go to top