Debian Codegraph @

texmf-dist/doc/latex/unamth-template/Latex/Macros/MacroFile1.tex

raw
1 % This file contains macros that can be called up from connected TeX files
2 % It helps to summarise repeated code, e.g. figure insertion (see below).
3
4 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5 % Colores de la UNAM %
6 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7 %Azul Pantone 541 -->(0,63,119) RGB
8 \definecolor{Azul}{RGB}{0,63,119}
9
10 %Oro Pantone 460 -->(234,221,150) RGB
11 \definecolor{Oro}{RGB}{234,221,150}
12
13
14 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
15 % Comandos para líneas %
16 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
17 %Se define un comando \colorvrule para hacer líneas verticales de color con 3 argumentos: color, ancho, alto
18 \newcommand{\colorvrule}[3]{
19 \begingroup\color{#1}\vrule width#2 height#3
20 \endgroup}
21
22 %Se define un comando \colorhrule para hacer líneas horizontales de color con 2 argumentos: color, ancho
23 \newcommand{\colorhrule}[2]{
24 \begingroup\color{#1}\hrule height#2
25 \endgroup}
26
27 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
28 % Comando para derivadas %
29 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
30 \newcommand{\derivada}[3][]{\ensuremath{\dfrac{\mbox{d}^{#1}#2}{\mbox{d}#3^{#1}}}}
31 %primer argumento(opcional): orden de la derivada
32 %segundo argumento: función a derivar
33 %tercer argumento: variable respecto a la que se deriva
34
35
36 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
37 % Comando para la exponencial %
38 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
39 \newcommand{\e}[1][]{\ensuremath{\mbox{e}^{#1}}}
40 %primer argumento(opcional): exponente de la exponencial
41
42
43
44
45 % insert a centered figure with caption and description
46 % parameters 1:filename, 2:title, 3:description and label
47 \newcommand{\figuremacro}[3]{
48 \begin{figure}[htbp]
49 \centering
50 \includegraphics[width=1\textwidth]{#1}
51 \caption[#2]{\textbf{#2} - #3}
52 \label{condicion}
53 \end{figure}
54 }
55
56 % insert a centered figure with caption and description AND WIDTH
57 % parameters 1:filename, 2:title, 3:description and label, 4: textwidth
58 % textwidth 1 means as text, 0.5 means half the width of the text
59 \newcommand{\figuremacroW}[4]{
60 \begin{figure}[htbp]
61 \centering
62 \includegraphics[width=#4\textwidth]{#1}
63 \caption[#2]{\textbf{#2} - #3}
64 \label{#1}
65 \end{figure}
66 }
67
68 % inserts a figure with wrapped around text; only suitable for NARROW figs
69 % o is for outside on a double paged document; others: l, r, i(inside)
70 % text and figure will each be half of the document width
71 % note: long captions often crash with adjacent content; take care
72 % in general: above 2 macro produce more reliable layout
73 \newcommand{\figuremacroN}[3]{
74 \begin{wrapfigure}{o}{0.5\textwidth}
75 \centering
76 \includegraphics[width=0.48\textwidth]{#1}
77 \caption[#2]{{\small\textbf{#2} - #3}}
78 \label{#1}
79 \end{wrapfigure}
80 }
81
82 % predefined commands by Harish
83 \newcommand{\PdfPsText}[2]{
84 \ifpdf
85 #1
86 \else
87 #2
88 \fi
89 }
90
91 \newcommand{\IncludeGraphicsH}[3]{
92 \PdfPsText{\includegraphics[height=#2]{#1}}{\includegraphics[bb = #3, height=#2]{#1}}
93 }
94
95 \newcommand{\IncludeGraphicsW}[3]{
96 \PdfPsText{\includegraphics[width=#2]{#1}}{\includegraphics[bb = #3, width=#2]{#1}}
97 }
98
99 \newcommand{\InsertFig}[3]{
100 \begin{figure}[!htbp]
101 \begin{center}
102 \leavevmode
103 #1
104 \caption{#2}
105 \label{#3}
106 \end{center}
107 \end{figure}
108 }
109
110
111
112
113
114
115
116 %%% Local Variables:
117 %%% mode: latex
118 %%% TeX-master: "~/Documents/LaTeX/CUEDThesisPSnPDF/thesis"
119 %%% End: