ITM-Thesis Class Repository
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

99 lines
3.1 KiB

  1. %************************************
  2. %1 Identification:
  3. \NeedsTeXFormat{LaTeX2e}
  4. \ProvidesClass{itmthesis}[2018/05/04 ITMorelia Thesis Class by Gerardo Marx]
  5. %************************************
  6. %2 Preliminary declarations
  7. %2.1 The basic class:
  8. \LoadClass{report}
  9. %2.2 Packages:
  10. \RequirePackage[utf8]{inputenc}
  11. \RequirePackage[colorlinks=true]{hyperref}
  12. \RequirePackage{blindtext}
  13. %2.2.1 Booleans
  14. \RequirePackage{ifthen}
  15. \newboolean{@drafting} % print version information on pages
  16. \newboolean{@spanish} % activates the spanish version at babel otherwise english
  17. %2.2.2 Colors
  18. \RequirePackage{xcolor}
  19. \definecolor{c1}{rgb}{0,0,1} % blue
  20. \hypersetup{
  21. linkcolor={c1}, % internal links
  22. citecolor={c1}, % citations
  23. urlcolor={c1} % external links/urls
  24. }
  25. %2.2.2 This package is essentially a replacement—partial or total—for the LATEX macros related with sections—namely titles, headers and contents.
  26. \RequirePackage{titlesec}
  27. %
  28. \RequirePackage{xargs} % needed for extended newcommand and others
  29. \RequirePackage{array} % needed for extended options for array
  30. \RequirePackage{amsmath}
  31. %2.3 Page settings:
  32. \RequirePackage[left=3cm,right=3cm,top=3cm,bottom=3cm]{geometry}
  33. %2.4 Macros and Commands:
  34. %2.4.1 Derivatives
  35. \newcommandx{\pd}[3][1=]{%
  36. \frac{\partial^{#1} #2}{\partial #3^{#1}}
  37. }
  38. %2.4.1 Dbf
  39. \renewcommand{\d}{{\rm d}}
  40. %2.5 Environments:
  41. %2.5.1 Arrays of equations:
  42. %************************************
  43. %3 Options:
  44. % 3.1 DeclareOptions
  45. % Option sintax
  46. % \DeclareOption{⟨option⟩}{⟨code⟩}
  47. %Code option:
  48. \DeclareOption{drafting}{
  49. %Code
  50. \setboolean{@drafting}{true}
  51. }
  52. \DeclareOption{spanish}{
  53. %Code
  54. \setboolean{@spanish}{true}
  55. \typeout{spanish to babel}
  56. }%end code option
  57. \ProcessOptions\relax
  58. % 3.2 PassOptionsToPackage
  59. %if sintax: \ifthenelse{⟨test⟩}{⟨then clause⟩}{⟨else clause⟩}
  60. % 3.2.1 drafting
  61. % 3.2.2 babel
  62. \ifthenelse{\boolean{@spanish}}%test
  63. { %then clause
  64. \@ifpackageloaded{babel}
  65. {\relax}{\RequirePackage[spanish]{babel}}%
  66. }
  67. {\relax}% else clause
  68. %************************************
  69. % 4 Declarations:
  70. %-------------------------------------
  71. %4.0 chapter
  72. \renewcommand{\thechapter}{\Roman{chapter}} %Roman enumeration
  73. \titleformat{\chapter}[display]%shape
  74. %{\bfseries\Huge\scshape}%Format applyed to the title
  75. {\Huge\filleft\sc}%Format applyed to the title
  76. {\filleft\sc{\chaptertitlename} \thechapter}%Label text and format
  77. {4ex}%Separation between Label and Title
  78. {}%Before code
  79. [\vspace{2ex}
  80. \titlerule]%After code
  81. %
  82. %4.1 section
  83. \titleformat{\section} % Customise the \section command
  84. {\Large\scshape\raggedright} % Make the \section headers large (\Large),
  85. % small capitals (\scshape) and left aligned (\raggedright)
  86. {}{0em} % Can be used to give a prefix to all sections, like 'Section ...'
  87. {} % Can be used to insert code before the heading
  88. [\titlerule] % Inserts a horizontal line after the heading
  89. %4.2 subsection
  90. \titleformat{\subsection}
  91. {\large\scshape\raggedright}
  92. {}{0em}
  93. {}