Skip to content

Commit

Permalink
debugging LaTeXML
Browse files Browse the repository at this point in the history
  • Loading branch information
teepeemm committed Oct 30, 2021
1 parent 8349b4b commit e4af4bf
Show file tree
Hide file tree
Showing 19 changed files with 246 additions and 70 deletions.
8 changes: 8 additions & 0 deletions apexNotes.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
9.6 principle of ratio test: a_n behaves like L^n

LaTeXML:
Eg 1.2.1 $\emph{something}$, Eg 2.4.8ff, T5.3.2pf, T5.4.1pf
T5.1.2&3 multicol, numbering
Some Patrick JMT is forcing viewing on YouTube. Drop for something else?
KI3.5.1 centered?
11.1.15ff side by side

1.0 figure placement
3.5 KI 1 break p2 ?
4.2 colors ?
5.4 Ex 3 h spacing ?
6.5 new fluid force video
7.1: one-to-one V. 15.5: one to one
12.3 F 5a color
13.2 T3 break p2 ?
Expand Down
4 changes: 4 additions & 0 deletions exercises/10-02-exset-06.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
\null\hfill
\begin{tikzpicture}
\draw [dashed] (-1.5,-.2) -- (2,-.2);
\ifbool{latexml}{
\draw (1.75,.65) node {$\scriptstyle\ell\textrm{ ft }\Biggl\{$};
}{
\draw (1.75,.65) node {\scriptsize $\ell$\ ft $\left\{\rule{0pt}{.8cm}\right.$};
}
\filldraw[thick,black,fill=gray!30] (-.5,0) -- (.5,0) -- (1,-1) -- (-1,-1)--cycle;
\draw (0,-.5) node {$p$ lb};
\draw [thick] (-1.5,1.5) -- (2,1.5);
Expand Down
18 changes: 18 additions & 0 deletions latexmlAlts.tex
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
\usepackage{graphicx}
\usepackage{tikz}
\usepackage{enumitem}
\usepackage{multicol}
\usepackage{hyperref}
\newlist{sectionexercises}{enumerate}{1}
\newcounter{saveexercisenum}[section]
Expand Down Expand Up @@ -112,11 +113,28 @@

A reference to \ref{probone} should have no decimal after number.

% see Eg1.3.8
\[a+b=c\quad\text{because \ref{probone}}\]

Stuff $\left\{\rule{0pt}{12pt}\right\}$. $\underbrace{\makebox[1.8cm]{}}_a$.

\begin{tabular}{cc}
here & \multirow{1.5}{*}{should be at the bottom}
% see https://tex.stackexchange.com/a/364935/107497
\end{tabular}

\parbox[t]{\linewidth}{\begin{multicols}{2}
\begin{enumerate}
\item\label{thm:d_const_mult_rule} $\frac{\dd}{\dd x}\bigl(cf(x) \bigr) = c\cdot \fp(x)$
\item\label{thm:d_sum_diff_rule} $\frac{\dd}{\dd x}\bigl(f(x)\pm g(x) \bigr) =$ \\
\null\qquad$\fp(x)\pm g'(x)$
\item $\frac{\dd}{\dd x}\bigl(C \bigr) = 0$
\setcounter{enumi}{0}
\item $\int c\cdot f(x)\dd x = c\cdot \int f(x)\dd x$
\item $\int \bigl(f(x)\pm g(x)\bigr)\dd x =$ \\
\null\qquad$\int f(x)\dd x\pm \int g(x)\dd x$
\item $\int 0\dd x = C$
\end{enumerate}
\end{multicols}}

\end{document}
16 changes: 16 additions & 0 deletions slurm-alone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,28 @@ printf '\\newcommand{\\thetitle}{Calculus}\n\\printincolor\n\\usethreeDgraphics\

singularity exec $singularitydir/latexml.sif $latexmldir/latexml --quiet --destination=$base.xml --nocomments $base

exit_code=$?

echo ""
echo "Job intermission at $(date)"
echo ""

if [ "$exit_code" -ne "0" ]; then
echo "latexml failed"
exit "$exit_code"
fi

singularity exec $singularitydir/latexml.sif $latexmldir/latexmlpost --split --destination=standaloneweb/index.html --javascript=LaTeXML-maybeMathJax.js $base.xml

exit_code=$?

echo ""
echo "Job ended at $(date)"
echo ""

if [ "$exit_code" -ne "0" ]; then
echo "latexmlpost failed"
exit "$exit_code"
fi

tar czf standaloneweb.tar.gz standaloneweb/
16 changes: 16 additions & 0 deletions slurm-apex.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,28 @@ printf '\\newcommand{\\thetitle}{Calculus}\n\\printincolor\n\\usethreeDgraphics\

singularity exec $singularitydir/latexml.sif $latexmldir/latexml --quiet --destination=$base.xml --nocomments $base

exit_code=$?

echo ""
echo "Job intermission at $(date)"
echo ""

if [ "$exit_code" -ne "0" ]; then
echo "latexml failed"
exit "$exit_code"
fi

singularity exec $singularitydir/latexml.sif $latexmldir/latexmlpost --split --destination=web/index.html $base.xml

exit_code=$?

echo ""
echo "Job ended at $(date)"
echo ""

if [ "$exit_code" -ne "0" ]; then
echo "latexmlpost failed"
exit "$exit_code"
fi

tar czf web.tar.gz web/
10 changes: 6 additions & 4 deletions standalone.bak.tex
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,21 @@

\mainmatter

\setcounter{chapter}{10}
\setcounter{chapter}{2}

\setcounter{section}{1}
\setcounter{section}{3}

%\apexchapter[text/01_Prerequisite]{Limits}{ch:label}

%This chapter introduces \textbf{sequences} and \textbf{series}, important mathematical constructions that are useful when solving a large variety of mathematical problems. The content of this chapter is considerably different from the content of the chapters before it. While the material we learn here definitely falls under the scope of ``calculus,'' we will make very little use of derivatives or integrals. Limits are extremely important, though, especially limits that involve infinity.
%
%One of the problems addressed by this chapter is this: suppose we know information about a function and its derivatives at a point, such as $f(1) = 3$, $\fp(1) = 1$, $\fp'(1) = -2$, $\fp''(1) = 7$, and so on. What can I say about $f(x)$ itself? Is there any reasonable approximation of the value of $f(2)$? The topic of Taylor Series addresses this problem, and allows us to make excellent approximations of functions when limited knowledge of the function is available.

\input{text/09_Parametric_Equations}
%\apexchapter[text/09_Conic_Sections]{Curves in the Plane}{chapter:planar_curves}

%\printexercises{exercises/14_04_exercises}
\input{text/02_Product_Quotient_Rules}

%\printexercises{exercises/14-03-exercises}

%\printexercises{standalone/standalone_exercises}

Expand Down
173 changes: 129 additions & 44 deletions standalone.tex
Original file line number Diff line number Diff line change
@@ -1,54 +1,139 @@
% !TEX TS-program = XeLaTeX
% !TEX program = XeLaTeX
%\errorcontextlines 10000

\RequirePackage[l2tabu, orthodox]{nag}
\documentclass[10pt]{book}

\input{headers/APEX_format}
\usepackage{headers/apex_style}
\input{headers/Header_Calculus}
% this is not standalone
% this is latexmlAlts to test if we need alternative latexml commands

\newcommand{\thetitle}{Standalone}
\documentclass[10pt]{book}

\printallanswers
\printincolor
\usetwoDgraphics
%\usethreeDgraphics
%\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{graphicx}
\usepackage{tikz}
\usepackage{enumitem}
\usepackage{multicol}
\usepackage{multirow}
\usepackage{hyperref}
\newlist{sectionexercises}{enumerate}{1}
\newcounter{saveexercisenum}[section]
\setlist[sectionexercises]{
label=\arabic*.,
ref=\arabic*, % ref overrides label
before=\setcounter{sectionexercisesi}{\value{saveexercisenum}},
after=\setcounter{saveexercisenum}{\value{sectionexercisesi}},
}

\begin{document}

%\frontmatter
%
%\input{text/front_matter_and_cover}

\mainmatter

\setcounter{chapter}{4}

\setcounter{section}{2}

%\apexchapter[text/01_Prerequisite]{Limits}{ch:label}

%This chapter introduces \textbf{sequences} and \textbf{series}, important mathematical constructions that are useful when solving a large variety of mathematical problems. The content of this chapter is considerably different from the content of the chapters before it. While the material we learn here definitely falls under the scope of ``calculus,'' we will make very little use of derivatives or integrals. Limits are extremely important, though, especially limits that involve infinity.
%
%One of the problems addressed by this chapter is this: suppose we know information about a function and its derivatives at a point, such as $f(1) = 3$, $\fp(1) = 1$, $\fp'(1) = -2$, $\fp''(1) = 7$, and so on. What can I say about $f(x)$ itself? Is there any reasonable approximation of the value of $f(2)$? The topic of Taylor Series addresses this problem, and allows us to make excellent approximations of functions when limited knowledge of the function is available.

%\apexchapter[text/09_Conic_Sections]{Curves in the Plane}{chapter:planar_curves}

\input{text/07_Shell_Method}

%\printexercises{exercises/14-03-exercises}

%\printexercises{standalone/standalone_exercises}

\appendix

\printsolutions{Standalone Solutions To All Problems}

%\printindex
%
%\backmatter
%
%\input{text/Inside_Cover_Of_The_Text_Material_Complete}
\pagestyle{empty}

\framebox[.14\linewidth][l]{\parbox{1pt}{Chapter\\\chapterautorefname}}
\framebox[.14\linewidth][l]{\parbox{1pt}{Section\\\sectionautorefname}}
\framebox[.14\linewidth][l]{\parbox{1pt}{150.0pt\\\the\marginparwidth}}

% todo tikz matrix spacing see https://github.com/brucemiller/LaTeXML/issues/794
\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}

\begin{sectionexercises}
\item\label{probone} A reference to \ref{probone} should have no decimal after number.
\end{sectionexercises}
in between
\begin{sectionexercises}
\item Should continue numbering.
\end{sectionexercises}

% see Eg1.3.8
\[a+b=c\quad\text{because \ref{probone}}\]

Stuff $\left\{\rule{0pt}{12pt}\right\}$. $\underbrace{\makebox[1.8cm]{}}_a$.

\begin{tabular}{cc}
here & \multirow{1.5}{*}{should be at the bottom}
% see https://tex.stackexchange.com/a/364935/107497
\end{tabular}

\parbox[t]{\linewidth}{\begin{multicols}{2}
\begin{enumerate}
\item\label{thm:d_const_mult_rule} $\frac{d}{d x}\bigl(cf(x) \bigr) = c\cdot f'(x)$
\item\label{thm:d_sum_diff_rule} $\frac{d}{d x}\bigl(f(x)\pm g(x) \bigr) =$ \\
\null\qquad$f'(x)\pm g'(x)$
\item $\frac{d}{d x}\bigl(C \bigr) = 0$
\setcounter{enumi}{0}
\item $\int c\cdot f(x)d x = c\cdot \int f(x)d x$
\item $\int \bigl(f(x)\pm g(x)\bigr)d x =$ \\
\null\qquad$\int f(x)d x\pm \int g(x)d x$
\item $\int 0d x = C$
\end{enumerate}
\end{multicols}}

\end{document}
5 changes: 5 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
.twoColumn > div , .threeColumn > div , .fourColumn > div {
display: inline-block;
margin-right: 2em;
}

iframe[seamless] {
border:0;
margin: 1ex 1em;
Expand Down
6 changes: 6 additions & 0 deletions text/01_Continuity.tex
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,10 @@ \section{Continuity}\label{sec:continuity}

This section formally defined what it means to be a continuous function. ``Most'' functions that we deal with are continuous, so often it feels odd to have to formally define this concept. Regardless, it is important, and forms the basis of the next chapter.

\ifbool{latexml}{
\printexercises{exercises/01-05-exercises}
}{}

\section*{Chapter Summary}

In this chapter we:
Expand All @@ -432,6 +436,8 @@ \section*{Chapter Summary}

These are just two quick examples of why we are interested in limits. Many students dislike this topic when they are first introduced to it, but over time an appreciation is often formed based on the scope of its applicability.

\ifbool{latexml}{}{
\printexercises{exercises/01-05-exercises}
}

% todo Find an interactive example of the bisection method where you specify the function and endpoints
12 changes: 8 additions & 4 deletions text/01_Limit_Definition.tex
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ \section{Epsilon-Delta Definition of a Limit}\label{sec:limit_def}
\draw (axis cs:-.1,2.25) node [right]{$\big\}\scriptstyle\epsilon = .5$};
\fill[fill={\colortwo},draw={\colortwo}] (axis cs:2.25,1.5) circle (1pt);
\fill[fill={\colortwo},draw={\colortwo}] (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[30pt]{}}$};
\draw (axis cs:5.125,.1) node [above,align=center,text width = 45pt] {\tiny width\\[-2pt] = 2.25\\[-3pt] $\overbrace{\makebox[39pt]{}}$};
\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);
Expand Down Expand Up @@ -138,7 +138,7 @@ \section{Epsilon-Delta Definition of a Limit}\label{sec:limit_def}
- (4\epsilon - \epsilon^2) < x-4 < (4\epsilon + \epsilon^2) &\qquad \textrm{ (Rewrite in the desired form)}
\end{align*}

The ``desired form'' in the last step is ``$-\emph{something} < x-4 < \emph{something}$.''
The ``desired form'' in the last step is ``$-\textit{something} < x-4 < \textit{something}$.''
Since we want this last interval to describe an $x$ tolerance around 4, we have that either $\delta \leq 4\epsilon - \epsilon^2$ or $\delta \leq 4\epsilon + \epsilon^2$, whichever is smaller: \[\delta \leq \min\{4\epsilon - \epsilon^2, 4\epsilon + \epsilon^2\}\text{.}\] Since $\epsilon > 0$, the minimum is $\delta \leq 4\epsilon - \epsilon^2$. That's the formula: given an $\epsilon$, set $\delta \leq 4\epsilon-\epsilon^2$.

We can check this for our previous values. If $\epsilon=0.5$, the formula gives
Expand Down Expand Up @@ -294,7 +294,11 @@ \section{Epsilon-Delta Definition of a Limit}\label{sec:limit_def}
\draw[thin,dashed,thick,draw={\colortwo}] (axis cs:1.73,0) -- (axis cs:1.73,3);
\draw[dotted,ultra thick,gray] (axis cs:2.2,0) -- (axis cs:2.2,4.84);
\draw[dotted,ultra thick,gray] (axis cs:1.8,0) -- (axis cs:1.8,3.24);
\draw (axis cs:-.1,4.5) node [right]{\scriptsize$\left.\rule{0pt}{12pt}\right\}\epsilon$};
\ifbool{latexml}{
\draw (axis cs:1.3,4.5) node [right]{$\scriptstyle\bigg\}\epsilon$};
}{
\draw (axis cs:1.3,4.5) node [right]{\scriptsize$\left.\rule{0pt}{12pt}\right\}\epsilon$};
}
\draw (axis cs:2.1,2.15) node [above] {\scriptsize$\delta$};
\draw (axis cs:2.1,2.05) node [above,scale=.35] {$\overbrace{\phantom{..........}}$};
\draw (axis cs:2.3,4.5) -- (axis cs: 3.2,4.5);
Expand Down
Loading

0 comments on commit e4af4bf

Please sign in to comment.