forked from APEXCalculus/APEXCalculus_Source
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlatexmlAlts.tex
More file actions
292 lines (247 loc) · 9.56 KB
/
latexmlAlts.tex
File metadata and controls
292 lines (247 loc) · 9.56 KB
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
% !TEX TS-program = XeLaTeX
% !TEX program = XeLaTeX
%\errorcontextlines 10000
% this is not standalone
% this is latexmlAlts to test if we need alternative latexml commands
\documentclass[oneside]{book}
%\input{headers/APEX_format}
%\usepackage{headers/apex_style}
%\input{headers/Header_Calculus}
% LaTeXML's hyperref overwrites these
\newcommand{\chapterautorefname}{Chap\-ter} % the default is lowercase
\newcommand{\sectionautorefname}{Sec\-tion} % the default is lowercase
\usepackage[marginparwidth=150pt]{geometry}
\usepackage{amsmath}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{enumitem}
\usepackage{multicol}
\usepackage{multirow}
\usepackage{makeidx}
\usepackage[font=small,justification=RaggedRight]{caption}
\usepackage{marginnote}
\usepackage{hyperref}
\newlist{sectionexercises}{enumerate}{1}
\newcounter{saveexercisenum}
\setlist[sectionexercises]{
label=\arabic*.,
ref=\arabic*, % ref overrides label
before=\setcounter{sectionexercisesi}{\value{saveexercisenum}},
after=\setcounter{saveexercisenum}{\value{sectionexercisesi}},
}
\setlength{\parskip}{2\baselineskip}
\makeindex
\begin{document}
\pagestyle{empty}
% https://github.com/latex3/hyperref/blob/main/hyperref.dtx
% we use lines 5316ff
% but line 5757(?) makes the defs act like provide command
\framebox[.14\linewidth][l]{\parbox{1pt}{Chap\-ter\\\chapterautorefname}}
\framebox[.14\linewidth][l]{\parbox{1pt}{Sec\-tion\\\sectionautorefname}}
150.0pt:\the\marginparwidth
\setlength{\marginparwidth}{150pt}
% html isn't allowed to have span[@colspan],
% which latexml likes to do in display math in marginpar if there aren't enough & in a row
% https://github.com/brucemiller/LaTeXML/issues/1763
\marginpar{\begin{align*}1R&1L\\1R\end{align*}} % missing &2L
\begin{align*}1R&1L\\1R\end{align*} % missing &2L
\marginpar{\begin{align*}1R&1L\\1R&\end{align*}} % missing 2L
\begin{align*}1R&1L\\1R&\end{align*} % missing 2L
\marginpar{\begin{align*}1R&&2R&2L\\1R&&2R&\end{align*}}
\begin{align*}1R&&2R&2L\\1R&&2R&\end{align*}
%inserting space:
\marginpar{\begin{align*}1R&\,&2R&2L\\1R&\,&2R&\end{align*}}
\begin{align*}1R&\,&2R&2L\\1R&\,&2R&\end{align*}
%adding a makebox:
\marginpar{\begin{align*}1R&\makebox[1pt]{}&2R&2L\\1R&\makebox[1pt]{}&2R&\end{align*}}
\begin{align*}1R&\makebox[1pt]{}&2R&2L\\1R&\makebox[1pt]{}&2R&\end{align*}
% get the spacing some other way:
\marginpar{\begin{align*}1R\qquad2R&2L\\1R\qquad2R&\end{align*}}
\begin{align*}1R\qquad2R&2L\\1R\qquad2R&\end{align*}
% see https://github.com/brucemiller/LaTeXML/issues/794
% see also issue 1196 - positioning is hard because it's combining tex and browser
% and now tikz matrices aren't working on talon?
%\noindent before\\
%\begin{tikzpicture}
% \matrix[row sep=3mm,column sep=3mm]{
% \node(left){L}; &&&&&& \node(right){R};\\\\\\\\
% \node(bottom){B};\\
% };
% \draw(left)--(right)(left)--(bottom);
%\end{tikzpicture}\quad
%\begin{tikzpicture}
% \matrix {
% & \node (A) {A}; \\
% \node{B};&& \node(C){C}; \\
% };
% \draw (A.south) -- (A|- C.south);
%\end{tikzpicture}\\
%after
Compare: % see 09_Parametric_Equations.tex
\[
\begin{gathered}\text{Choose}\\t\end{gathered}\quad
\tikz[>=latex,baseline=(current bounding box.center)]{\draw[->](0,.3)--(1,.6);\draw[->](0,-.3)--(1,-.6);}\quad
{\addtolength{\jot}{-.5ex}
\begin{gathered}
\text{Use a function}\\f\text{ to find }x\\\bigl(x=f(t)\bigr)\\~\\
\text{Use a function}\\g\text{ to find }y\\\bigl(y=g(t)\bigr)
\end{gathered}
}\quad
\tikz[>=latex,baseline=(current bounding box.center)]{\draw[->](0,.6)--(1,.3);\draw[->](0,-.6)--(1,-.3);}\quad
\begin{gathered}\text{Plot point}\\(x,y)\end{gathered}
\]
to:
\[
\begin{gathered}\text{Choose}\\t\end{gathered}\quad
\begin{gathered}
\rotatebox{-20}{\scalebox{2}{$\nearrow$}}\\
\rotatebox{20}{\scalebox{2}{$\searrow$}}
\end{gathered}\quad
{\addtolength{\jot}{-.5ex}
\begin{gathered}
\text{Use a function}\\f\text{ to find }x\\\bigl(x=f(t)\bigr)\\~\\
\text{Use a function}\\g\text{ to find }y\\\bigl(y=g(t)\bigr)
\end{gathered}
}\quad
\begin{gathered}
\rotatebox{20}{\scalebox{2}{$\searrow$}}\\
\rotatebox{-20}{\scalebox{2}{$\nearrow$}}
\end{gathered}\quad
\begin{gathered}\text{Plot point}\\(x,y)\end{gathered}
\]
to:
\begin{center}
\begin{tikzpicture}[>=latex]
\draw (0,0) node (A) [align=center] {Choose \\$t$}
(3,1) node[align=center] (B1) {Use a function\\ $f$ to find $x$\\$\bigl(x=f(t)\bigr)$}
(3,-1) node[align=center] (B2) {Use a function\\ $g$ to find $y$\\$\bigl(y=g(t)\bigr)$}
(6.25,0) node [align=center] (C) {Plot point \\ $(x,y)$};
\draw [->](A) --(B1);
\draw [->](A) --(B2);
\draw [->](B1) -- (C);
\draw [->](B2) -- (C);
\end{tikzpicture}
\end{center}
% see https://github.com/brucemiller/LaTeXML/issues/1710 for the linking
\begin{sectionexercises}
\item\label{myitem} Label should have a decimal point. This ref: \ref*{myitem} should not have a decimal point and should not be linked.
\end{sectionexercises}
in between
\begin{sectionexercises}
\item Should continue numbering. Label should have a decimal point.
\end{sectionexercises}
% see Eg1.3.8
% see https://github.com/brucemiller/LaTeXML/issues/1477
% and https://github.com/mathjax/MathJax/issues/487
% MathJax can't handle anything inside of text (<a> in this case)
\begin{equation}\label{eqlabel}
a+b=c\quad\text{my label is \ref{eqlabel}}\quad\text{I am \autoref*{eqlabel}}
\end{equation}
\begin{equation*}
a^2+b^2=c^2\quad\text{is the \href{https://en.wikipedia.org/wiki/Pythagorean_theorem}{Pythagorean theorem}}
\end{equation*}
% https://github.com/brucemiller/LaTeXML/issues/1708
My strut $\left(\rule{0pt}{30pt}\right)$.
\begin{tikzpicture}[>=stealth]
\begin{axis}[width=\marginparwidth,tick label style={font=\scriptsize},
minor x tick num=1,axis y line=middle,axis x line=middle,
ymin=-.1,ymax=3.1,xmin=-.1,xmax=7.1,xtick={2,4,6},ytick={1,2},name=myplot]
\addplot[draw={blue},smooth,thick,domain=0:2.7] ({\x*\x},{\x});
\fill[black] (axis cs:4,2) circle (1pt);
\draw[thin,dashed,gray,thick] (axis cs:0,1.5) -- (axis cs:2.25,1.5);
\draw[thin,dashed,gray,thick] (axis cs:0,2.5) -- (axis cs:6.25,2.5);
\draw[thin,dashed,draw={red},thick] (axis cs:2.25,0) -- (axis cs:2.25,1.5);
\draw[thin,dashed,draw={red},thick] (axis cs:6.25,0) -- (axis cs:6.25,2.5);
\draw (axis cs:-.1,1.75) node [right]{$\big\}\scriptstyle\epsilon = .5$};
\draw (axis cs:-.1,2.25) node [right]{$\big\}\scriptstyle\epsilon = .5$};
\fill[fill={red},draw={red}] (axis cs:2.25,1.5) circle (1pt);
\fill[fill={red},draw={red}] (axis cs:6.25,2.5) circle (1pt);
\draw (axis cs:3.125,.1) node [above,align=center,text width = 45pt] {\tiny width\\[-2pt] = 1.75\\[-3pt] $\overbrace{\makebox[20pt]{}}$};
\draw (axis cs:5.125,.1) node [above,align=center,text width = 45pt] {\tiny width\\[-2pt] = 2.25\\[-3pt] $\overbrace{\makebox[30pt]{}}$};
\draw (axis cs:4.3,1.35) node [align=center,text width = 80pt] {\footnotesize ... choose $\delta$ smaller than each of these};
\draw [->,thin] (axis cs:4,1) -- (axis cs:3,.8);
\draw [->,thin] (axis cs:4,1) -- (axis cs:5,.8);
\end{axis}
\node [right] at (myplot.right of origin) {\scriptsize $x$};
\node [above] at (myplot.above origin) {\scriptsize $y$};
\end{tikzpicture}
\begin{tikzpicture}[>=stealth]
\begin{axis}[width=\marginparwidth,tick label style={font=\scriptsize},
minor x tick num=1,axis y line=middle,axis x line=middle,
ymin=-.1,ymax=3.1,xmin=-.1,xmax=7.1,xtick={2,4,6},ytick={1,2},name=myplot]
\draw (axis cs:3.125,.1) node [above,align=center,text width = 45pt] {\tiny width\\[-2pt] = 1.75\\[-3pt] $\overbrace{\makebox[20pt]{}}$};
\draw (axis cs:3,2) node{stuff};
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}[width=\marginparwidth,ymin=0,ymax=3,xmin=0,xmax=7]
\draw (axis cs:3,1) node [align=center,text width = 45pt] {\tiny width\\= 1.75\\$\overbrace{\makebox[20pt]{}}$};
\draw (axis cs:3,2) node{stuff};
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}[width=\marginparwidth,ymin=0,ymax=3,xmin=0,xmax=7]
\draw (axis cs:3,1) node {$\overbrace{\makebox[20pt]{}}$};
\draw (axis cs:3,2) node{stuff};
\end{axis}
\end{tikzpicture}
$\overbrace{\makebox[1.8cm]{}}_a$
\tikz{\node{$\overbrace{\makebox[1.8cm]{}}_a$}}
% https://github.com/brucemiller/LaTeXML/issues/1712
\begin{minipage}{\linewidth}
This should not be centered\\
This should not be centered
\end{minipage}
\begin{minipage}{\linewidth}
This should not be centered
\begin{center}
This is the only thing that should be centered.
\end{center}
\end{minipage}
\begin{minipage}{\linewidth}
This should not be centered
\begin{centering}
This is the only thing that should be centered.\\
\end{centering}
\end{minipage}
\begin{minipage}{\linewidth}
This should not be centered
{\centering
This is the only thing that should be centered.\\
}
\end{minipage}
% https://github.com/brucemiller/LaTeXML/blob/master/lib/LaTeXML/Package/multicol.sty.ltxml
% latexml intentionally does nothing, since this is a styling question
% see https://github.com/brucemiller/LaTeXML/issues/1711
\begin{multicols}{2}
\begin{enumerate}
\item item one in two columns
\item item two in two columns
\end{enumerate}
\end{multicols}
% https://github.com/brucemiller/LaTeXML/issues/1861
\begin{gather*}
\text{now you see me}\\
\makebox[1pt]{now you still see me}
\end{gather*}
\begin{gather*}
\text{now you see me}\\
\makebox[0pt]{now you don't}
\end{gather*}
% https://github.com/brucemiller/LaTeXML/issues/1709
% see https://tex.stackexchange.com/a/364935/107497
\noindent
\begin{minipage}{.5\linewidth}%
\begin{tabular}{ c c }
item 1 & \multirow{2}{*}{item 2 should be at the bottom} \\
item 3
\end{tabular}
\end{minipage}%
\begin{minipage}{.5\linewidth}%
\begin{tabular}{ c c }
item 4 & \multirow{2}{*}{item 5 should be at the bottom} \\
item 6
\end{tabular}
\end{minipage}
\printindex
\end{document}