Skip to content

Commit

Permalink
probably working
Browse files Browse the repository at this point in the history
  • Loading branch information
teepeemm committed Oct 21, 2021
1 parent 0e95d42 commit dabe1ef
Show file tree
Hide file tree
Showing 4 changed files with 134 additions and 194 deletions.
4 changes: 3 additions & 1 deletion headers/APEX_format.tex
Original file line number Diff line number Diff line change
Expand Up @@ -356,11 +356,13 @@
\counterwithin*{sectionexercisesi}{section} % in case we have a exercise set before any exercises that would reset the save exercise enum
\setlist[sectionexercises]{
label=\arabic*.,
ref=\arabic*,
leftmargin=1.5em,
before=\setcounter{sectionexercisesi}{\value{saveexercisenum}},
after=\setcounter{saveexercisenum}{\value{sectionexercisesi}},
}
\ifbool{latexml}{}{
\setlist*[sectionexercises]{ref=\arabic*}
}

\newcommand{\printexercises}[1]{%
\writeToAnsFile{#1}% writeToAnsFile in sty (actually, down below)
Expand Down
159 changes: 77 additions & 82 deletions latexmlAlts.tex
Original file line number Diff line number Diff line change
Expand Up @@ -7,114 +7,109 @@

\documentclass[10pt]{book}

\input{headers/APEX_format}
\usepackage{headers/apex_style}
\input{headers/Header_Calculus}

\newcommand{\thetitle}{Standalone}

\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{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}
% \label{lxApexTOC}
% \tableofcontents
% \input{text/title_page}
% \input{text/copyright_page}
%\addtocontents{toc}{\protect\thispagestyle{empty}}%
%\input{text/preface}

\mainmatter

\part*{Calculus I}
\ifbool{latexml}{\addcontentsline{toc}{part}{Calculus I}}{}

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

Some intro stuff.
\chapterautorefname
\sectionautorefname
\figureautorefname
\appendixname
\the\marginparwidth
\the\defaultaddspace
\pagestyle{empty}

\section{The section}
\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}}

\begin{keyidea}[My Key Idea Title]\label{ki:label}
This is my key idea.
\end{keyidea}

% todo tikz matrices see https://github.com/brucemiller/LaTeXML/issues/794
% todo tikz matrix spacing see https://github.com/brucemiller/LaTeXML/issues/794
\noindent before\\
\begin{tikzpicture}
\matrix[row sep=1mm,column sep=3mm,ampersand replacement=\&]{
\&\&\& \node (tp1) {$-2$}; \&\& \node (tp2) {$2$}; \\[-1ex]
\node(linestart) {$x$}; \&\&\&\&\&\&\& \node(lineend) {}; \\[-1ex]
\&\node (fstart) {$x^2-4$}; \& \node {$+$}; \&\& \node {$-$}; \&\& \node {$+$}; \\
\matrix[row sep=3mm,column sep=3mm]{
\node(left){L}; &&&&&& \node(right){R};\\\\\\\\
\node(bottom){B};\\
};
\draw [<->] (linestart.east) -- (lineend);
\draw (fstart.south west) -- (lineend.west |- fstart.south);
\draw (fstart.east |- lineend) -- (fstart.east|-fstart.south);
\foreach \x in {1,2} {
\draw (tp\x|-linestart)+(0,5pt) -- (tp\x |- fstart.south);
}
\end{tikzpicture}

\begin{example}[Example Title]\label{ex:label}
This is my example. This is my example.
\solution
This is my example. This is my example. This is my example. This is my example. This is my example. This is my example. This is my example. This is my example. This is my example. This is my example. This is my example. This is my example. This is my example.
\end{example}
\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}
\begin{gathered}\nearrow\\\\\searrow\end{gathered}
\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}\\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}
\begin{gathered}\searrow\\\\\nearrow\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)$};
(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}

% this works fine; I just want an index to make sure that shows correctly
At one point we define $a_\mathrm{T}$
\index{at@$a_{\mathrm{T}}$}\index{unit tangent vector!at@$a_{\mathrm{T}}$}%

\printexercises{exercises/14_04_exercises}

\appendix

\showans\answrite
% showans will write the contents of Calculus.answers to the log
% in latexml, this needs to happen before closing

\printsolutions{Standalone Solutions To All Problems}

\printindex
\begin{sectionexercises}
\item\label{probone} problem should have decimal after number.
\end{sectionexercises}
in between
\begin{sectionexercises}
\item problem should have decimal after number. Should continue numbering.
\end{sectionexercises}

%\backmatter
%
%\input{text/Inside_Cover_Of_The_Text_Material_Complete}
A reference to \ref{probone} should have no decimal after number.

\end{document}
149 changes: 42 additions & 107 deletions standalone.tex
Original file line number Diff line number Diff line change
@@ -1,117 +1,52 @@
% !TEX TS-program = XeLaTeX
% !TEX program = XeLaTeX
%\errorcontextlines 10000

% this is not standalone
% this is latexmlAlts to test if we need alternative latexml commands

\RequirePackage[l2tabu, orthodox]{nag}
\documentclass[10pt]{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{graphicx}
\usepackage{tikz}
\usepackage{enumitem}
\usepackage{hyperref}
\newlist{sectionexercises}{enumerate}{1}
\newcounter{saveexercisenum}[section]
\setlist[sectionexercises]{
label=\arabic*.,
% ref=\arabic*,
before=\setcounter{sectionexercisesi}{\value{saveexercisenum}},
after=\setcounter{saveexercisenum}{\value{sectionexercisesi}},
}
\input{headers/APEX_format}
\usepackage{headers/apex_style}
\input{headers/Header_Calculus}

\newcommand{\thetitle}{Standalone}

\printallanswers
\printincolor
\usetwoDgraphics
%\usethreeDgraphics

\begin{document}

\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)\\\mbox{}\\
\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} problem should have decimal after number.
\end{sectionexercises}
in between
\begin{sectionexercises}
\item problem should have decimal after number. Should continue numbering.
\end{sectionexercises}

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

%\printexercises{exercises/14-03-exercises}
%\frontmatter
%
%\input{text/front_matter_and_cover}

\mainmatter

\setcounter{chapter}{10}

\setcounter{section}{1}

%\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}

\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}

\end{document}
16 changes: 12 additions & 4 deletions text/09_Parametric_Equations.tex
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,21 @@ \section{Parametric Equations}\label{sec:param_eqs}

\ifbool{latexml}{
\[
\begin{gathered}\text{Choose}\\t\end{gathered}
\begin{gathered}\nearrow\\\\\searrow\end{gathered}
\begin{gathered}\text{Choose}\\t\end{gathered}\quad
\begin{gathered}
\text{Use a function}\\f\text{ to find }x\\\bigl(x=f(t)\bigr)\\\\
\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}
\begin{gathered}\searrow\\\\\nearrow\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}
\]
}{
Expand Down

0 comments on commit dabe1ef

Please sign in to comment.