preamble.tex 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. % package with esp-idf specific macros
  2. \usepackage{espidf}
  3. \setcounter{secnumdepth}{2}
  4. \setcounter{tocdepth}{2}
  5. \usepackage{amsmath,amsfonts,amssymb,amsthm}
  6. \usepackage{graphicx}
  7. %%% reduce spaces for Table of contents, figures and tables
  8. %%% it is used "\addtocontents{toc}{\vskip -1.2cm}" etc. in the document
  9. \usepackage[notlot,nottoc,notlof]{}
  10. \usepackage{color}
  11. \usepackage{transparent}
  12. \usepackage{eso-pic}
  13. \usepackage{lipsum}
  14. %%% Needed for displaying Chinese in English documentation
  15. \usepackage{xeCJK}
  16. \usepackage{footnotebackref} %%link at the footnote to go to the place of footnote in the text
  17. %% spacing between line
  18. \usepackage{setspace}
  19. \singlespacing
  20. \definecolor{myred}{RGB}{229, 32, 26}
  21. \definecolor{mygrayy}{RGB}{127, 127, 127}
  22. \definecolor{myblack}{RGB}{64, 64, 64}
  23. %%%%%%%%%%% datetime
  24. \usepackage{datetime}
  25. \newdateformat{MonthYearFormat}{%
  26. \monthname[\THEMONTH], \THEYEAR}
  27. %% RO, LE will not work for 'oneside' layout.
  28. %% Change oneside to twoside in document class
  29. \usepackage{fancyhdr}
  30. \pagestyle{fancy}
  31. \fancyhf{}
  32. % Header and footer
  33. \makeatletter
  34. \fancypagestyle{normal}{
  35. \fancyhf{}
  36. \fancyhead[L]{\nouppercase{\leftmark}}
  37. \fancyfoot[C]{\py@HeaderFamily\thepage \\ \href{https://www.espressif.com/en/company/documents/documentation_feedback?docId=4287&sections=&version=\idfReleaseName}{Submit Document Feedback}}
  38. \fancyfoot[L]{Espressif Systems}
  39. \fancyfoot[R]{\idfReleaseName}
  40. \renewcommand{\headrulewidth}{0.4pt}
  41. \renewcommand{\footrulewidth}{0.4pt}
  42. }
  43. \makeatother
  44. \renewcommand{\headrulewidth}{0.5pt}
  45. \renewcommand{\footrulewidth}{0.5pt}
  46. % Define a spacing for section, subsection and subsubsection
  47. % http://tex.stackexchange.com/questions/108684/spacing-before-and-after-section-titles
  48. \titlespacing*{\section}{0pt}{6pt plus 0pt minus 0pt}{6pt plus 0pt minus 0pt}
  49. \titlespacing*{\subsection}{0pt}{18pt plus 64pt minus 0pt}{0pt}
  50. \titlespacing*{\subsubsection}{0pt}{12pt plus 0pt minus 0pt}{0pt}
  51. \titlespacing*{\paragraph} {0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}
  52. \titlespacing*{\subparagraph} {0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}
  53. % Define the colors of table of contents
  54. % This is helpful to understand http://tex.stackexchange.com/questions/110253/what-the-first-argument-for-lsubsection-actually-is
  55. \definecolor{LochmaraColor}{HTML}{1020A0}
  56. % Hyperlinks
  57. \hypersetup{
  58. colorlinks = true,
  59. allcolors = {LochmaraColor},
  60. }
  61. \RequirePackage{tocbibind} %%% comment this to remove page number for following
  62. \addto\captionsenglish{\renewcommand{\contentsname}{Table of contents}}
  63. \addto\captionsenglish{\renewcommand{\listfigurename}{List of figures}}
  64. \addto\captionsenglish{\renewcommand{\listtablename}{List of tables}}
  65. % \addto\captionsenglish{\renewcommand{\chaptername}{Chapter}}
  66. %%reduce spacing for itemize
  67. \usepackage{enumitem}
  68. \setlist{nosep}
  69. %%%%%%%%%%% Quote Styles at the top of chapter
  70. \usepackage{epigraph}
  71. \setlength{\epigraphwidth}{0.8\columnwidth}
  72. \newcommand{\chapterquote}[2]{\epigraphhead[60]{\epigraph{\textit{#1}}{\textbf {\textit{--#2}}}}}
  73. %%%%%%%%%%% Quote for all places except Chapter
  74. \newcommand{\sectionquote}[2]{{\quote{\textit{``#1''}}{\textbf {\textit{--#2}}}}}
  75. % Insert 22pt white space before roc title. \titlespacing at line 65 changes it by -22 later on.
  76. \renewcommand*\contentsname{\hspace{0pt}Contents}
  77. % Define section, subsection and subsubsection font size and color
  78. \usepackage{sectsty}
  79. \definecolor{AllportsColor}{HTML}{A02010}
  80. \allsectionsfont{\color{AllportsColor}}
  81. \usepackage{titlesec}
  82. \titleformat{\section}
  83. {\color{AllportsColor}\LARGE\bfseries}{\thesection.}{1em}{}
  84. \titleformat{\subsection}
  85. {\color{AllportsColor}\Large\bfseries}{\thesubsection.}{1em}{}
  86. \titleformat{\subsubsection}
  87. {\color{AllportsColor}\large\bfseries}{\thesubsubsection.}{1em}{}
  88. \titleformat{\paragraph}
  89. {\color{AllportsColor}\large\bfseries}{\theparagraph}{1em}{}
  90. \titleformat{\subparagraph}
  91. {\normalfont\normalsize\bfseries}{\thesubparagraph}{1em}{}
  92. \titleformat{\subsubparagraph}
  93. {\normalfont\normalsize\bfseries}{\thesubsubparagraph}{1em}{}