LaTeX forum ⇒ Theses, Books, Title pagesLegrand Orange Book vs THAI language

Classicthesis, Bachelor and Master thesis, PhD, Doctoral degree
MBIG
Posts: 2
Joined: Sat May 02, 2020 5:10 pm

Legrand Orange Book vs THAI language

Postby MBIG » Sat May 02, 2020 6:34 pm

I try to edit Legrand Orange Book for using THAI language many ways.
it has not worked correctly.
I guess FONT is a problem. I try to fix it but it has still not worked.

For the file "Main - How it works'',
Green box = it is good.
Red box = it is not good. It has not worked.

Has anybody an idea how to fix this?
Kind regards,
Attachments
Main - How it works.zip
(388.18 KiB) Downloaded 6 times

MBIG
Posts: 2
Joined: Sat May 02, 2020 5:10 pm

Postby MBIG » Mon May 04, 2020 7:07 am

I forgot to post MAIN and Structure files.

Main file is shown below.

Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. %%%
  2. % Compiling this template:
  3. % This template uses biber for its bibliography and makeindex for its index.
  4. % When you first open the template, compile it from the command line with the
  5. % commands below to make sure your LaTeX distribution is configured correctly:
  6. %
  7. % 1) pdflatex main
  8. % 2) makeindex main.idx
  9. % 3) biber main
  10. % 4) pdflatex main x 2
  11.  
  12. % Tool > User Choose one command of them
  13. % Alt + Shift + F2 - - - XeLatex
  14.  
  15. \documentclass[12pt,fleqn]{book} % Default font size and left-justified equations
  16.  
  17. \input{Structure.tex} % Insert the commands.tex file which contains the majority of the structure behind the template
  18.  
  19. %----------------------------------------------------------------------------------------
  20.  
  21. \begin{document}
  22.  
  23. \include{A_TitlePage}
  24. \include{B_Copyright}
  25. \include{C_TOCs}
  26. \include{D_Part01}
  27. \include{D_Chapter01}
  28. \include{D_Chapter02}
  29. \include{D_Part02}
  30. \include{D_Chapter03}
  31. \include{D_Chapter04}
  32. \include{D_Part03}
  33. \include{D_Chapter05}
  34. \include{D_Chapter06}
  35. \include{D_Part04}
  36. \include{E_Bib}
  37. \include{F_Index}
  38.  
  39. \end{document}



Structure file is shown below.

Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. %----------------------------------------------------------------------------------------
  2. % VARIOUS REQUIRED PACKAGES AND CONFIGURATIONS
  3. %----------------------------------------------------------------------------------------
  4.  
  5. \usepackage{graphicx} % Required for including pictures
  6. \graphicspath{{Pictures/}} % Specifies the directory where pictures are stored
  7.  
  8. \usepackage{lipsum} % Inserts dummy text
  9.  
  10. \usepackage{tikz} % Required for drawing custom shapes
  11.  
  12. \usepackage[thai,english]{babel} % English language/hyphenation
  13.  
  14. \usepackage{enumitem} % Customize lists
  15. \setlist{nolistsep} % Reduce spacing between bullet points and numbered lists
  16.  
  17. \usepackage{booktabs} % Required for nicer horizontal rules in tables
  18.  
  19. \usepackage{xcolor} % Required for specifying colors by name
  20.  
  21. % = = = Set Color
  22. \definecolor{ocre}{RGB}{0, 33, 165} % Define the color used for highlighting throughout the book
  23. % = = = End of Set Color
  24.  
  25. %----------------------------------------------------------------------------------------
  26. % MARGINS
  27. %----------------------------------------------------------------------------------------
  28.  
  29. \usepackage{geometry} % Required for adjusting page dimensions and margins
  30.  
  31. \geometry{
  32. paper=a4paper, % Paper size, change to letterpaper for US letter size
  33. top=3cm, % Top margin
  34. bottom=3cm, % Bottom margin
  35. left=3cm, % Left margin
  36. right=3cm, % Right margin
  37. headheight=14pt, % Header height
  38. footskip=1.4cm, % Space from the bottom margin to the baseline of the footer
  39. headsep=10pt, % Space from the top margin to the baseline of the header
  40. %showframe, % Uncomment to show how the type block is set on the page
  41. }
  42.  
  43. %----------------------------------------------------------------------------------------
  44. % FONTS
  45. %----------------------------------------------------------------------------------------
  46.  
  47. \usepackage{avant} % Use the Avantgarde font for headings
  48. %\usepackage{times} % Use the Times font for headings
  49. \usepackage{mathptmx} % Use the Adobe Times Roman as the default text font together with math symbols from the Sym­bol, Chancery and Com­puter Modern fonts
  50.  
  51. \usepackage{microtype} % Slightly tweak font spacing for aesthetics
  52. \usepackage[utf8x]{inputenc} % Required for including letters with accents
  53. \usepackage[T1]{fontenc} % Use 8-bit encoding that has 256 glyphs
  54.  
  55.  
  56. % = = = Start of THAI Font =======================================================================
  57.  
  58. %= ++++ xltxtra ++++
  59. \usepackage{xltxtra}
  60. \usepackage{fontspec} % Unicode
  61. \usepackage{xunicode}
  62.  
  63. \XeTeXlinebreaklocale “th_TH” % For adjust word
  64. \XeTeXlinebreakskip = 0pt plus 1pt %
  65.  
  66.  
  67. \renewcommand{\baselinestretch}{1.2} % Set line spacing
  68. \defaultfontfeatures{Scale=1.23}
  69.  
  70. %%% Trial 1 = MS Font
  71. \setmainfont[Script=Thai]{AngsanaUPC} %
  72.  
  73. %%% Trial 2 = Sipa Font (THAI Fonts)
  74. %%% <!-- m --><a class="postlink" href="http://www.thailibrary.in.th/wp-content/uploads/2010/09/Sipa_Font_Installer.zip">http://www.thailibrary.in.th/wp-content ... taller.zip</a><!-- m -->
  75. %\setmainfont[Script=Thai]{TH Kodchasal} % Opentype Font
  76.  
  77. % = = = End of THAI Font =======================================================================
  78.  
  79.  
  80. %----------------------------------------------------------------------------------------
  81. % BIBLIOGRAPHY AND INDEX
  82. %----------------------------------------------------------------------------------------
  83.  
  84. \usepackage[style=numeric,citestyle=numeric,sorting=nyt,sortcites=true,autopunct=true,babel=hyphen,hyperref=true,abbreviate=false,backref=true,backend=biber]{biblatex}
  85. \addbibresource{bibliography.bib} % BibTeX bibliography file
  86. \defbibheading{bibempty}{}
  87.  
  88. \usepackage{calc} % For simpler calculation - used for spacing the index letter headings correctly
  89. % = = = \usepackage{makeidx} % Required to make an index
  90. % = = = \makeindex % Tells LaTeX to create the files required for indexing
  91. \usepackage{imakeidx} % Required to make an index
  92. \makeindex[options=-s StyleInd.ist] % Tells LaTeX to create the files required for indexing by using StyleInd.ist
  93.  
  94. %----------------------------------------------------------------------------------------
  95. % MAIN TABLE OF CONTENTS
  96. %----------------------------------------------------------------------------------------
  97.  
  98. \usepackage{titletoc} % Required for manipulating the table of contents
  99.  
  100. \contentsmargin{0cm} % Removes the default margin
  101.  
  102. % PART HEADING
  103. % Part text styling (this is mostly taken care of in the PART HEADINGS section of this file)
  104. %%%\titlecontents{part}
  105. \titlecontents{part}
  106. [0cm] % Left indentation
  107. {\addvspace{20pt}\bfseries} %
  108. {}
  109. {\color{ocre}} % Formatting of numberless sections of part
  110. {}
  111.  
  112. % Chapter text styling - - - "chapter"
  113. %%%\titlecontents{chapter}
  114. \titlecontents{บทที่}
  115. [1.70cm] % Left indentation
  116. %%% [1.25cm] % Left indentation
  117. {\addvspace{12pt}\large\sffamily\bfseries}
  118. %%% \addvspace{12pt} = Spacing betwween Part and chapter
  119. %%% \large\sffamily\bfseries = font options for chapters
  120. {\color{ocre}\contentslabel[\Large\thecontentslabel]{1.25cm}\color{ocre}} % Formatting of numbered chapter
  121. {\color{ocre}} % Formatting of numberless sections of this type
  122. {\color{ocre}\normalsize\;\titlerule*[.5pc]{.}\;\thecontentspage}
  123. % Formatting of the filler to the right of the heading and the page number
  124.  
  125.  
  126. % Section text styling - - - "x.x"
  127. \titlecontents{หัวข้อ}
  128. %%%\titlecontents{section}
  129. [2.50cm] % Left indentation
  130. {\addvspace{3pt}\sffamily\bfseries} % Spacing and font options for sections
  131. {\contentslabel[\thecontentslabel]{1.25cm}} % Formatting of numbered sections of this type
  132. {} % Formatting of numberless sections of this type
  133. % = = = {\hfill\color{black}\thecontentspage} % Formatting of the filler to the right of the heading and the page number
  134. {\ \titlerule*[.5pc]{.}\;\thecontentspage} % Formatting of the filler to the right of the heading and the page number
  135.  
  136. % Subsection text styling
  137. \titlecontents{หัวข้อย่อย}
  138. %%% \titlecontents{subsection}
  139. [3.75cm] % Left indentation
  140. {\addvspace{1pt}\sffamily\small} % Spacing and font options for subsections
  141. {\contentslabel[\thecontentslabel]{1.25cm}} % Formatting of numbered sections of this type
  142. {} % Formatting of numberless sections of this type
  143. {\ \titlerule*[.5pc]{.}\;\thecontentspage} % Formatting of the filler to the right of the heading and the page number
  144.  
  145. % Figure text styling
  146. \titlecontents{รูปที่}
  147. %%% \titlecontents{figure}
  148. [1.25cm] % Left indentation
  149. {\addvspace{1pt}\sffamily\small} % Spacing and font options for figures
  150. {\thecontentslabel\hspace*{1em}} % Formatting of numbered sections of this type
  151. {} % Formatting of numberless sections of this type
  152. {\ \titlerule*[.5pc]{.}\;\thecontentspage} % Formatting of the filler to the right of the heading and the page number
  153.  
  154. % Table text styling
  155. \titlecontents{ตารางที่}
  156. %%% \titlecontents{table}
  157. [1.25cm] % Left indentation
  158. {\addvspace{1pt}\sffamily\small} % Spacing and font options for tables
  159. {\thecontentslabel\hspace*{1em}} % Formatting of numbered sections of this type
  160. {} % Formatting of numberless sections of this type
  161. {\ \titlerule*[.5pc]{.}\;\thecontentspage} % Formatting of the filler to the right of the heading and the page number
  162.  
  163. %----------------------------------------------------------------------------------------
  164. % MINI TABLE OF CONTENTS IN PART HEADS
  165. %----------------------------------------------------------------------------------------
  166.  
  167. % Chapter text styling
  168. \titlecontents{บทที่}
  169. %%% \titlecontents{lchapter}
  170. [0em] % Left indentation
  171. {\addvspace{15pt}\large\sffamily\bfseries} % Spacing and font options for chapters
  172. {\color{ocre}\contentslabel[\Large\thecontentslabel]{1.25cm}\color{ocre}} % Chapter number
  173. {}
  174. {\color{ocre}\normalsize\sffamily\bfseries\;\titlerule*[.5pc]{.}\;\thecontentspage} % Page number
  175.  
  176. % Section text styling
  177. \titlecontents{หัวข้อ}
  178. %%% \titlecontents{lsection}
  179. [0em] % Left indentation
  180. {\sffamily\small} % Spacing and font options for sections
  181. {\contentslabel[\thecontentslabel]{1.25cm}} % Section number
  182. {}
  183. {\color{black}\normalsize\sffamily\bfseries\;\titlerule*[.5pc]{.}\;\thecontentspage} % Page number
  184.  
  185. % Subsection text styling (note these aren't shown by default, display them by searchings this file for tocdepth and reading the commented text)
  186. \titlecontents{หัวข้อย่อย}
  187. %%% \titlecontents{lsubsection}
  188. [.5em] % Left indentation
  189. {\sffamily\footnotesize} % Spacing and font options for subsections
  190. {\contentslabel[\thecontentslabel]{1.25cm}}
  191. {}
  192. {\color{black}\normalsize\sffamily\bfseries\;\titlerule*[.5pc]{.}\;\thecontentspage} % Page number
  193.  
  194. %----------------------------------------------------------------------------------------
  195. % HEADERS AND FOOTERS
  196. %----------------------------------------------------------------------------------------
  197.  
  198. \usepackage{fancyhdr} % Required for header and footer configuration
  199.  
  200. \pagestyle{fancy} % Enable the custom headers and footers
  201.  
  202. \renewcommand{\chaptermark}[1]{\markboth{\sffamily\normalsize\bfseries\chaptername\ \thechapter.\ #1}{}} % Styling for the current chapter in the header
  203. \renewcommand{\sectionmark}[1]{\markright{\sffamily\normalsize\thesection\hspace{5pt}#1}{}} % Styling for the current section in the header
  204.  
  205. \fancyhf{} % Clear default headers and footers
  206. \fancyhead[LE,RO]{\sffamily\normalsize\thepage} % Styling for the page number in the header
  207. \fancyhead[LO]{\rightmark} % Print the nearest section name on the left side of odd pages
  208. \fancyhead[RE]{\leftmark} % Print the current chapter name on the right side of even pages
  209. %\fancyfoot[C]{\thepage} % Uncomment to include a footer
  210.  
  211. \renewcommand{\headrulewidth}{0.5pt} % Thickness of the rule under the header
  212.  
  213. % = = = Setup footnote format
  214. % = = = \renewcommand{\thefootnote}{\arabic{footnote}} % Arabic numerals, e.g., 1, 2, 3...
  215. % = = = \renewcommand{\thefootnote}{\roman{footnote}} % Roman numerals (lowercase), e.g., i, ii, iii...
  216. % = = = \renewcommand{\thefootnote}{\Roman{footnote}} % Roman numerals (uppercase), e.g., I, II, III...
  217. % = = = \renewcommand{\thefootnote}{\alph{footnote}} % Alphabetic (lowercase), e.g., a, b, c...
  218. % = = = \renewcommand{\thefootnote}{\Alph{footnote}} % Alphabetic (uppercase), e.g., A, B, C...
  219. \renewcommand{\thefootnote}{\fnsymbol{footnote}} % A sequence of nine symbols (try it and see!)
  220.  
  221.  
  222. \fancypagestyle{plain}{% Style for when a plain pagestyle is specified
  223. \fancyhead{}\renewcommand{\headrulewidth}{0pt}%
  224. }
  225.  
  226. % Removes the header from odd empty pages at the end of chapters
  227. \makeatletter
  228. \renewcommand{\cleardoublepage}{
  229. \clearpage\ifodd\c@page\else
  230. \hbox{}
  231. \vspace*{\fill}
  232. \thispagestyle{empty}
  233. \newpage
  234. \fi}
  235.  
  236. %----------------------------------------------------------------------------------------
  237. % THEOREM STYLES
  238. %----------------------------------------------------------------------------------------
  239.  
  240. \usepackage{amsmath,amsfonts,amssymb,amsthm} % For math equations, theorems, symbols, etc
  241.  
  242. \newcommand{\intoo}[2]{\mathopen{]}#1\,;#2\mathclose{[}}
  243. \newcommand{\ud}{\mathop{\mathrm{{}d}}\mathopen{}}
  244. \newcommand{\intff}[2]{\mathopen{[}#1\,;#2\mathclose{]}}
  245. \renewcommand{\qedsymbol}{$\blacksquare$}
  246. \newtheorem{notation}{Notation}[chapter]
  247.  
  248. % Boxed/framed environments
  249. \newtheoremstyle{ocrenumbox}% Theorem style name
  250. {0pt}% Space above
  251. {0pt}% Space below
  252. {\normalfont}% Body font
  253. {}% Indent amount
  254. {\small\bf\sffamily\color{ocre}}% Theorem head font
  255. {\;}% Punctuation after theorem head
  256. {0.25em}% Space after theorem head
  257. %
  258. %
  259. % = = = Theorem text (e.g. Theorem x.x)
  260. {\small\sffamily\color{black}\thmname{#1}\nobreakspace\thmnumber{\@ifnotempty{#1}{}\@upn{#2}} % Theorem text (e.g. Theorem 2.1)
  261. \thmnote{\nobreakspace\the\thm@notefont\sffamily\bfseries\color{black}---\nobreakspace#3.}} % Optional theorem note
  262.  
  263. \newtheoremstyle{blacknumex}% Theorem style name
  264. {5pt}% Space above
  265. {5pt}% Space below
  266. {\normalfont}% Body font
  267. {} % Indent amount
  268. {\small\bf\sffamily}% Theorem head font
  269. {\;}% Punctuation after theorem head
  270. {0.25em}% Space after theorem head
  271. {\small\sffamily{\tiny\ensuremath{\blacksquare}}\nobreakspace\thmname{#1}\nobreakspace\thmnumber{\@ifnotempty{#1}{}\@upn{#2}}% Theorem text (e.g. Theorem 2.1)
  272. \thmnote{\nobreakspace\the\thm@notefont\sffamily\bfseries---\nobreakspace#3.}}% Optional theorem note
  273.  
  274. \newtheoremstyle{blacknumbox} % Theorem style name
  275. {0pt}% Space above
  276. {0pt}% Space below
  277. {\normalfont}% Body font
  278. {}% Indent amount
  279. {\small\bf\sffamily}% Theorem head font
  280. {\;}% Punctuation after theorem head
  281. {0.25em}% Space after theorem head
  282. {\small\sffamily\thmname{#1}\nobreakspace\thmnumber{\@ifnotempty{#1}{}\@upn{#2}}% Theorem text (e.g. Theorem 2.1)
  283. \thmnote{\nobreakspace\the\thm@notefont\sffamily\bfseries---\nobreakspace#3.}}% Optional theorem note
  284.  
  285. % Non-boxed/non-framed environments
  286. \newtheoremstyle{ocrenum}% Theorem style name
  287. {5pt}% Space above
  288. {5pt}% Space below
  289. {\normalfont}% Body font
  290. {}% Indent amount
  291. {\small\bf\sffamily\color{ocre}}% Theorem head font
  292. {\;}% Punctuation after theorem head
  293. {0.25em}% Space after theorem head
  294. {\small\sffamily\color{black}\thmname{#1}\nobreakspace\thmnumber{\@ifnotempty{#1}{}\@upn{#2}}% Theorem text (e.g. Proposition x.x.x.x)
  295. \thmnote{\nobreakspace\the\thm@notefont\sffamily\bfseries\color{black}---\nobreakspace#3.}} % Optional theorem note
  296. \makeatother
  297.  
  298. % Defines the theorem text style for each type of theorem to one of the three styles above
  299. \newcounter{dummy}
  300. \numberwithin{dummy}{section}
  301. \theoremstyle{ocrenumbox}
  302. \newtheorem{theoremeT}[dummy]{Theorem}
  303. \newtheorem{problem}{Problem}[chapter]
  304. \newtheorem{exerciseT}{Exercise}[chapter]
  305. \theoremstyle{blacknumex}
  306. \newtheorem{exampleT}{Example}[chapter]
  307. \theoremstyle{blacknumbox}
  308. \newtheorem{vocabulary}{Vocabulary}[chapter]
  309. \newtheorem{definitionT}{Definition}[section]
  310. \newtheorem{corollaryT}[dummy]{Corollary}
  311. \theoremstyle{ocrenum}
  312. \newtheorem{proposition}[dummy]{Proposition}
  313.  
  314. %----------------------------------------------------------------------------------------
  315. % DEFINITION OF COLORED BOXES
  316. %----------------------------------------------------------------------------------------
  317.  
  318. \RequirePackage[framemethod=default]{mdframed} % Required for creating the theorem, definition, exercise and corollary boxes
  319.  
  320. % Theorem box
  321. \newmdenv[skipabove=8pt, %
  322. skipbelow=8pt, %
  323. backgroundcolor=ocre!10,
  324. linecolor=ocre,
  325. innerleftmargin=5pt,
  326. innerrightmargin=5pt,
  327. innertopmargin=5pt, %
  328. leftmargin=0cm,
  329. rightmargin=0cm,
  330. innerbottommargin=5pt]{tBox} %
  331.  
  332. % Exercise box
  333. \newmdenv[skipabove=8pt,
  334. skipbelow=8pt,
  335. rightline=false,
  336. leftline=true,
  337. topline=false,
  338. bottomline=false,
  339. backgroundcolor=ocre!10,
  340. linecolor=ocre,
  341. innerleftmargin=5pt,
  342. innerrightmargin=5pt,
  343. innertopmargin=5pt,
  344. innerbottommargin=5pt,
  345. leftmargin=0cm,
  346. rightmargin=0cm,
  347. linewidth=4pt]{eBox}
  348.  
  349. % Definition box
  350. \newmdenv[skipabove=8pt,
  351. skipbelow=8pt,
  352. rightline=false,
  353. leftline=true,
  354. topline=false,
  355. bottomline=false,
  356. backgroundcolor=ocre!10,
  357. linecolor=ocre,
  358. innerleftmargin=5pt,
  359. innerrightmargin=5pt,
  360. innertopmargin=5pt,
  361. leftmargin=0cm,
  362. rightmargin=0cm,
  363. linewidth=4pt,
  364. innerbottommargin=5pt]{dBox}
  365.  
  366. % Corollary box
  367. \newmdenv[skipabove=7pt,
  368. skipbelow=7pt,
  369. rightline=false,
  370. leftline=true,
  371. topline=false,
  372. bottomline=false,
  373. backgroundcolor=ocre!10,
  374. linecolor=ocre,
  375. innerleftmargin=5pt,
  376. innerrightmargin=5pt,
  377. innertopmargin=5pt,
  378. leftmargin=0cm,
  379. rightmargin=0cm,
  380. linewidth=4pt,
  381. innerbottommargin=5pt]{cBox}
  382.  
  383. % Creates an environment for each type of theorem and assigns it a theorem text style from the "Theorem Styles" section above and a colored box from above
  384. \newenvironment{theorem}{\begin{tBox}\begin{theoremeT}}{\end{theoremeT}\end{tBox}}
  385. \newenvironment{exercise}{\begin{eBox}\begin{exerciseT}}{\hfill{\color{ocre}\tiny\ensuremath{\blacksquare}}\end{exerciseT}\end{eBox}} % = = = color{ocre} = Color of tiny box
  386. \newenvironment{definition}{\begin{dBox}\begin{definitionT}}{\end{definitionT}\end{dBox}}
  387. \newenvironment{example}{\begin{exampleT}}{\hfill{\tiny\ensuremath{\blacksquare}}\end{exampleT}}
  388. \newenvironment{corollary}{\begin{cBox}\begin{corollaryT}}{\end{corollaryT}\end{cBox}}
  389.  
  390. %----------------------------------------------------------------------------------------
  391. % REMARK ENVIRONMENT
  392. %----------------------------------------------------------------------------------------
  393.  
  394. \newenvironment{remark}{\par\vspace{10pt}\small % Vertical white space above the remark and smaller font size
  395. \begin{list}{}{
  396. \leftmargin=35pt % Indentation on the left
  397. \rightmargin=25pt}\item\ignorespaces % Indentation on the right
  398. \makebox[-2.5pt]{\begin{tikzpicture}[overlay]
  399. \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
  400. \advance\baselineskip -1pt}{\end{list}\vskip5pt} % Tighter line spacing and white space after remark
  401.  
  402. %----------------------------------------------------------------------------------------
  403. % SECTION NUMBERING IN THE MARGIN
  404. %----------------------------------------------------------------------------------------
  405.  
  406. \makeatletter
  407. \renewcommand{\@seccntformat}[1]{\llap{\textcolor{black}{\csname the#1\endcsname}\hspace{1em}}}
  408. %%% \renewcommand{\section}{\@startsection{section}{1}{\z@}
  409. \renewcommand{\section}{\@startsection{section}{1}{\z@}
  410. {-4ex \@plus -1ex \@minus -.4ex}
  411. {1ex \@plus.2ex }
  412. {\normalfont\large\sffamily\bfseries}}
  413. \renewcommand{\subsection}{\@startsection {subsection}{2}{\z@}
  414. {-3ex \@plus -0.1ex \@minus -.4ex}
  415. {0.5ex \@plus.2ex }
  416. {\normalfont\sffamily\bfseries}}
  417. \renewcommand{\subsubsection}{\@startsection {subsubsection}{3}{\z@}
  418. {-2ex \@plus -0.1ex \@minus -.2ex}
  419. {.2ex \@plus.2ex }
  420. {\normalfont\small\sffamily\bfseries}}
  421. \renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}
  422. {-2ex \@plus-.2ex \@minus .2ex}
  423. {.1ex}
  424. {\normalfont\small\sffamily\bfseries}}
  425.  
  426. %----------------------------------------------------------------------------------------
  427. % PART HEADINGS
  428. %----------------------------------------------------------------------------------------
  429.  
  430. % Numbered part in the table of contents
  431. % = = = Size and Color of boxs
  432. \newcommand{\@mypartnumtocformat}[2]{%
  433. \setlength\fboxsep{0pt}
  434. %%% ocre!10 = Colored Box "Part Number", ocre = Colored Text and ocre!10 = Colored Box "Text of Part Number"
  435. \noindent\colorbox{ocre!10}{\strut\parbox[c][.7cm]{\ecart}{\color{ocre}\Large\sffamily\bfseries\centering#1}}\hskip\esp\colorbox{ocre!10}{\strut\parbox[c][.7cm]{\linewidth-\ecart-\esp}{\Large\sffamily\centering#2}}%
  436. }
  437.  
  438. % Unnumbered part in the table of contents
  439. \newcommand{\@myparttocformat}[1]{%
  440. \setlength\fboxsep{0pt}%
  441. \noindent\colorbox{ocre!10}{\strut\parbox[c][.7cm]{\linewidth}{\Large\sffamily\centering#1}}%
  442. }
  443.  
  444. \newlength\esp
  445. \setlength\esp{4pt}
  446. \newlength\ecart
  447. \setlength\ecart{1.2cm-\esp}
  448. \newcommand{\thepartimage}{}%
  449. \newcommand{\partimage}[1]{\renewcommand{\thepartimage}{#1}}%
  450. \def\@part[#1]#2{%
  451. \ifnum \c@secnumdepth >-2\relax%
  452. \refstepcounter{part}%
  453. \addcontentsline{toc}{part}{\texorpdfstring{\protect\@mypartnumtocformat{\thepart}{#1}}{\partname~\thepart\ ---\ #1}}
  454. \else%
  455. \addcontentsline{toc}{part}{\texorpdfstring{\protect\@myparttocformat{#1}}{#1}}%
  456. \fi%
  457. \startcontents%
  458. \markboth{}{}%
  459. {\thispagestyle{empty}%
  460. \begin{tikzpicture}[remember picture,overlay]%
  461. \node at (current page.north west){\begin{tikzpicture}[remember picture,overlay]%
  462. \fill[ocre!20](0cm,0cm) rectangle (\paperwidth,-\paperheight);
  463. \node[anchor=north] at (4cm,-3.25cm){\color{ocre!40}\fontsize{220}{100}\sffamily\bfseries\thepart};
  464. \node[anchor=south east] at (\paperwidth-1cm,-\paperheight+1cm){\parbox[t][][t]{8.5cm}{
  465. \printcontents{l}{0}{\setcounter{tocdepth}{1}}
  466. }};
  467. \node[anchor=north east] at (\paperwidth-1.5cm,-3.25cm){\parbox[t][][t]{15cm}{\strut\raggedleft\color{white}\fontsize{30}{30}\sffamily\bfseries#2}};
  468. \end{tikzpicture}};
  469. \end{tikzpicture}}%
  470. \@endpart}
  471. \def\@spart#1{%
  472. \startcontents%
  473. \phantomsection
  474. {\thispagestyle{empty}%
  475. \begin{tikzpicture}[remember picture,overlay]%
  476. \node at (current page.north west){\begin{tikzpicture}[remember picture,overlay]%
  477. \fill[ocre!20](0cm,0cm) rectangle (\paperwidth,-\paperheight);
  478. \node[anchor=north east] at (\paperwidth-1.5cm,-3.25cm){\parbox[t][][t]{15cm}{\strut\raggedleft\color{white}\fontsize{30}{30}\sffamily\bfseries#1}};
  479. \end{tikzpicture}};
  480. \end{tikzpicture}}
  481. \addcontentsline{toc}{part}{\texorpdfstring{%
  482. \setlength\fboxsep{0pt}%
  483. \noindent\protect\colorbox{ocre!40}{\strut\protect\parbox[c][.7cm]{\linewidth}{\Large\sffamily\protect\centering #1\quad\mbox{}}}}{#1}}%
  484. \@endpart}
  485. \def\@endpart{\vfil\newpage
  486. \if@twoside
  487. \if@openright
  488. \null
  489. \thispagestyle{empty}%
  490. \newpage
  491. \fi
  492. \fi
  493. \if@tempswa
  494. \twocolumn
  495. \fi}
  496.  
  497. %----------------------------------------------------------------------------------------
  498. % CHAPTER HEADINGS
  499. %----------------------------------------------------------------------------------------
  500.  
  501. % A switch to conditionally include a picture, implemented by Christian Hupfer
  502. \newif\ifusechapterimage
  503. \usechapterimagetrue
  504. \newcommand{\thechapterimage}{}%
  505. \newcommand{\chapterimage}[1]{\ifusechapterimage\renewcommand{\thechapterimage}{#1}\fi}%
  506. \newcommand{\autodot}{.}
  507. \def\@makechapterhead#1{%
  508. {\parindent \z@ \raggedright \normalfont
  509. \ifnum \c@secnumdepth >\m@ne
  510. \if@mainmatter
  511. \begin{tikzpicture}[remember picture,overlay]
  512. \node at (current page.north west)
  513. {\begin{tikzpicture}[remember picture,overlay]
  514. \node[anchor=north west,inner sep=0pt] at (0,0) {\ifusechapterimage\includegraphics[width=\paperwidth]{\thechapterimage}\fi};
  515. \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]{}};
  516. \draw[anchor=west] (\Gm@lmargin+.3cm,-9cm) node {\huge\sffamily\bfseries\color{black}\thechapter\autodot~#1\strut};
  517. \end{tikzpicture}};
  518. \end{tikzpicture}
  519. \else
  520. \begin{tikzpicture}[remember picture,overlay]
  521. \node at (current page.north west)
  522. {\begin{tikzpicture}[remember picture,overlay]
  523. \node[anchor=north west,inner sep=0pt] at (0,0) {\ifusechapterimage\includegraphics[width=\paperwidth]{\thechapterimage}\fi};
  524. \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]{}};
  525. \draw[anchor=west] (\Gm@lmargin+.3cm,-9cm) node {\huge\sffamily\bfseries\color{black}#1\strut};
  526. \end{tikzpicture}};
  527. \end{tikzpicture}
  528. \fi\fi\par\vspace*{270\p@}}}
  529.  
  530. %-------------------------------------------
  531.  
  532. \def\@makeschapterhead#1{%
  533. \begin{tikzpicture}[remember picture,overlay]
  534. \node at (current page.north west)
  535. {\begin{tikzpicture}[remember picture,overlay]
  536. \node[anchor=north west,inner sep=0pt] at (0,0) {\ifusechapterimage\includegraphics[width=\paperwidth]{\thechapterimage}\fi};
  537. \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]{}};
  538. \draw[anchor=west] (\Gm@lmargin+.3cm,-9cm) node {\huge\sffamily\bfseries\color{black}#1\strut};
  539. \end{tikzpicture}};
  540. \end{tikzpicture}
  541. \par\vspace*{270\p@}}
  542. \makeatother
  543.  
  544.  
  545. % = = = Reset Part from I to be 1 ...
  546.  
  547. \renewcommand{\thepart}{\arabic{part}} %Part Numbering in Arabic
  548. %\renewcommand{\thepart}{\Alph{part}} %Part Numbering in English Alphabet
  549.  
  550. \appto\appendix{%
  551. \renewcommand{\thepart}{\Alph{part}} % A,B,C
  552. \renewcommand{\theHpart}{\Alph{part}} % for hyperref
  553.  
  554.  
  555. \renewcommand{\thesection}{\Alph{section}}
  556. \renewcommand{\thesubsection}{A.\arabic{subsection}} % subsection A.1, A.2, A.3 ...
  557.  
  558.  
  559. \setcounter{part}{0}} %to restart with A
  560.  
  561. % = = = End Reset Part from I to be 1 ...
  562.  
  563.  
  564. %----------------------------------------------------------------------------------------
  565. % LINKS
  566. %----------------------------------------------------------------------------------------
  567.  
  568. \usepackage{hyperref}
  569. \hypersetup{hidelinks,backref=true,pagebackref=true,hyperindex=true,colorlinks=false,breaklinks=true,urlcolor=ocre,bookmarks=true,bookmarksopen=false}
  570.  
  571. \usepackage{bookmark}
  572. \bookmarksetup{
  573. open,
  574. numbered,
  575. addtohook={%
  576. \ifnum\bookmarkget{level}=0 % chapter
  577. \bookmarksetup{bold}%
  578. \fi
  579. \ifnum\bookmarkget{level}=-1 % part
  580. \bookmarksetup{color=ocre,bold}%
  581. \fi
  582. }
  583. }


Return to “Theses, Books, Title pages”

Who is online

Users browsing this forum: No registered users and 1 guest