summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/asy-overview/asy_sty/asy_tut.sty
blob: 36a47bf1a911a1b1fd570b2f254b83216a4df568 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
% asy_tut.sty
%  Asymptote tutorial LaTeX style file for use by LaTeX files.
% 
% 2024-Mar-12 JH Init.

% \usepackage[utf8]{inputenc}
% \usepackage[osf,scaled=.92,loosest]{heuristica}
% \usepackage[heuristica,vvarbb,bigdelims]{newtxmath}
% \usepackage[T1]{fontenc}
% \renewcommand*\oldstylenums[1]{\textosf{#1}}

\AtBeginDocument{\let\widering\relax} % Get rid of Command \widering already defined.  Something to do with mf logo packages
\usepackage{fourier}
\usepackage[T1]{fontenc}

% Get MetaFont logo
\usepackage{mflogo}
\usepackage{metalogox}

\usepackage{../asy_sty/colors}

\usepackage{mathtools}
\usepackage{microtype}

% urls and path names
\usepackage[obeyspaces]{url}
% \DeclareUrlCommand\path{\urlstyle{tt}}

% Paper layout
\usepackage[letterpaper,
     top=1in, bottom=1in, textwidth=426pt, 
     includehead, ignorefoot]{geometry}

% Page headers
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead[L]{\thepage}
\fancyhead[C]{}
\fancyhead[R]{\textbf{The performance of new graduates}}
\fancyfoot[L,C,R]{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}

\fancyhead{} % clear all header fields
\fancyhead[RO,LE]{\textit{Page \thepage}}
\fancyhead[RE,LO]{\textit{\nouppercase\leftmark}}
\fancyfoot{} % clear all footer fields
\renewcommand{\headrulewidth}{0.0pt}
\renewcommand{\footrulewidth}{0.0pt}

% Between chapters, if there is an even page then make it empty
\let\origdoublepage\cleardoublepage
\newcommand{\clearemptydoublepage}{%
  \clearpage
  {\pagestyle{empty}\origdoublepage}%
}
\let\cleardoublepage\clearemptydoublepage

% Display of titles, including chapters and section headers
\usepackage{titlesec}
% General command
% \titleformat{⟨command ⟩}[⟨shape⟩]{⟨format⟩}{⟨label ⟩}{⟨sep⟩}{⟨before-code⟩}[⟨after-code⟩]
% \titlespacing*{⟨command ⟩}{⟨left⟩}{⟨before-sep⟩}{⟨after-sep⟩}[⟨right-sep⟩]
\titleformat{\chapter}[hang]{\LARGE\bfseries\color{bold_color}}{Chapter \thechapter:}{0.5em}{}
\titleformat{\section}[runin]{\bfseries\color{bold_color}}{}{0em}{}
% \titleformat{\subsection}[runin]{}{}{0.5em}{}

\titlespacing*{\chapter}
  {0pt}{-11ex plus .1ex minus .2ex}{3.5ex minus .1ex}

\assignpagestyle{\chapter}{empty}


% Use Minted for the source code listings
\usepackage{minted}
% Bug in minted gives weird spacing in using bgcolor
%   https://github.com/gpoore/minted/issues/220
% \usepackage{etoolbox}
% \AtBeginEnvironment{snugshade*}{\par\vspace{-\FrameSep}}
% \AfterEndEnvironment{snugshade*}{\par\vspace{-\FrameSep}}
% \BeforeBeginEnvironment{minted}{\par\vspace{-\baselineskip}}
% \AfterEndEnvironment{minted}{\par\vspace{-\baselineskip}}
\setminted[Asymptote]{linenos=true,
  % bgcolor=bgcolor,
  frame=leftline,
  fontsize=\footnotesize,
  stepnumber=5,stepnumberoffsetvalues=true, % number lines multiple of five
}
\setmintedinline[Asymptote]{
  fontsize=\small,
}
\setminted[TeX]{linenos=true,
  % bgcolor=bgcolor,
  frame=leftline,
  fontsize=\footnotesize,
  stepnumber=5,stepnumberoffsetvalues=true, % number lines multiple of five
}
\setmintedinline[TeX]{
  fontsize=\small,
}
\setminted[Bash]{% bgcolor=bgcolor,
  frame=leftline,
  fontsize=\footnotesize}
\setmintedinline[Bash]{
  fontsize=\small,
}
\setminted[Python]{% bgcolor=bgcolor,
  frame=leftline,
  fontsize=\footnotesize}
\setmintedinline[Python]{
  fontsize=\small,
}


% You are often advised to put hyperref last, or almost last
\usepackage[hidelinks,pdfa]{hyperref}
\hypersetup{
    bookmarks=false,         % show bookmarks bar?
    unicode=false,          % non-Latin characters in Acrobat’s bookmarks
    pdftoolbar=True,        % show Acrobat’s toolbar?
    pdfmenubar=True,        % show Acrobat’s menu?
    pdffitwindow=false,     % window fit to page when opened
    pdfstartview={FitH},    % fits the width of the page to the window
    pdftitle={First Impressions of Asymptote},    % title
    pdfauthor={Jim Hefferon},     % author
    pdfsubject={Asymptote},   % subject of the document
    pdfcreator={pdflatex},   % creator of the document
    pdfproducer={pdflatex}, % producer of the document
    pdfkeywords={Asymptote, mathematics, graphics}, % list of keywords
    pdfnewwindow=false,      % links in new PDF window
    colorlinks=true,       % false: boxed links; true: colored links
    linkcolor=name_color,          % color of internal links (change box color with linkbordercolor)
    citecolor=name_color,        % color of links to bibliography
    filecolor=name_color,         % color of file links
    urlcolor=name_color        % color of external links
}


% =============== Macros ===================
\newcommand{\Asy}{\textit{Asymptote}}

% ---------------------------------
% Vertically center graphics
% ex: \vcenteredhbox{\usegraphics{mygraph.png}}
% From http://tex.stackexchange.com/questions/7219/how-to-vertically-center-two-images
\newcommand*{\vcenteredhbox}[1]{\begingroup
\setbox0=\hbox{#1}\parbox{\wd0}{\box0}\endgroup}