Skip to content

Commit

Permalink
prepping for web version
Browse files Browse the repository at this point in the history
  • Loading branch information
teepeemm committed Jul 27, 2020
1 parent a7f7913 commit 68adc41
Show file tree
Hide file tree
Showing 45 changed files with 2,349 additions and 421 deletions.
330 changes: 137 additions & 193 deletions headers/APEX_format.tex

Large diffs are not rendered by default.

149 changes: 71 additions & 78 deletions headers/Header_Calculus.tex
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@

\newspecialbox{definition}{Def\-i\-ni\-tion}{60}
% draw = yellow!95!black!60 = Hsb( 60,.59,.97)
% topc = white!95!yellow = Hsb( 60,.05,1)
% botc = yellow!90!black!30 = Hsb( 60,.28,.97)

\newspecialbox{theorem}{The\-o\-rem}{120}
% draw = green!30!black!50 = Hsb(120,.23,.65)
% topc = white!95!green = Hsb(120,.05,1)
% botc = green!60!black!20 = Hsb(120,.13,.92)

\newspecialbox{keyidea}{Key I\-dea}{0}
% draw = red!30!black!50 = Hsb( 0,.23,.65)
% topc = white!95!red = Hsb( 0,.05,1)
% botc = red!60!black!20 = Hsb( 0,.13,.92)



\newtoggle{abridgeConics}
\toggletrue{abridgeConics}

Expand Down Expand Up @@ -62,40 +80,6 @@



\usepackage[newparttoc]{titlesec} % apparently conflicts with hyperref? :(
% but: ``unsolved is the anchor setting, missing with unnumbered section,
% perhaps problems with page breaks with numbered ones''
% if I'm not seeing those problems, maybe just continue
\usepackage{titletoc}

\newcommand{\leftparbox}[2]{\parbox[t]{#1}{\raggedright#2}}
% I couldn't get the raggedright to take otherwise

\titleformat{\part}[block]
{\Huge\bfseries\filcenter} % commands on the entire thing
{} % don't use a label
{0em} % space between (non?)label and title
{\thispagestyle{empty}} % command for the page
\titlecontents{part}[0pt]
{\vspace{3ex}}
{no numbered parts}
{\large\bfseries}
{\titlerule*[1em]{ }}

\titleformat{\chapter}[block]
{\hyphenpenalty=10000\relax\Huge\scshape\textsc} % commands on the entire thing
{\thechapter:} % the label
{.4em} % space between label and title
{\leftparbox{11em}} % command taking the title
[\addvspace{2ex}\titlerule] % afterward
\titlespacing*{\chapter}{0pt}{0pt}{2ex}

%\titleformat{\section}
% {\normalfont\Large\bfseries} % commands on the entire thing
% {\thesection} % the label
% {1em} % space between label and title
% {} % command taking the title (only actual difference)

\let\oldmainmatter\mainmatter
\renewcommand{\mainmatter}{%
\oldmainmatter
Expand Down Expand Up @@ -260,7 +244,12 @@
\caption{#2}\label{#3}}%
}
\usepackage[noadjust]{marginnote}
\ifbool{latexml}{
\newcommand{\ignoreoptional}[1][]{}
\newcommand{\marginnote}[1]{\marginpar{#1}\ignoreoptional}
}{
\usepackage[noadjust]{marginnote}
}
% \mnote[offset=0]{contents}
\newcommand*{\mnote}[2][0pt]{%
Expand Down Expand Up @@ -331,48 +320,50 @@
}
{}
%\usepackage[american]{babel}
\usepackage{polyglossia}
\setdefaultlanguage[variant=usmax]{english}
\renewcommand*{\englishhyphenmins}{22}
\AfterEndPreamble{
\hyphenation{%
an-ti-der-iv-a-tive
an-ti-der-iv-a-tives
app-rox-i-mate
cen-tered
chang-es
con-struc-tions
de-creas-es
Der-iv-a-tive
der-iv-a-tive
dis-place-ment
dis-tance
e-qual-ly
ex-am-ples
Func-tions
% Hô-pi-tal % doesn't hyphenate L'Hôpital's
im-pli-cit
in-dis-tin-guish-a-ble
in-fall-i-ble
% %L'Hô-pi-tal's % ' causes: ! Not a letter.
% % see https://tex.stackexchange.com/a/165091/107497 for fix and pitfalls
meth-od
of-ten
proc-ess
re-fer-ring
qua-dra-tic
sa-li-ent
se-quence
sketch-ing
smart-er
sub-sti-tute
The-o-rem
Trig-o-no-me-tric
trig-o-no-me-tric
wheth-er
}}
\ifbool{latexml}{
\usepackage[american]{babel}
}{
\usepackage{polyglossia}
\setdefaultlanguage[variant=usmax]{english}
\renewcommand*{\englishhyphenmins}{22}
\AfterEndPreamble{
\hyphenation{%
an-ti-der-iv-a-tive
an-ti-der-iv-a-tives
app-rox-i-mate
cen-tered
chang-es
con-struc-tions
de-creas-es
Der-iv-a-tive
der-iv-a-tive
dis-place-ment
dis-tance
e-qual-ly
ex-am-ples
Func-tions
% Hô-pi-tal % doesn't hyphenate L'Hôpital's
im-pli-cit
in-dis-tin-guish-a-ble
in-fall-i-ble
% %L'Hô-pi-tal's % ' causes: ! Not a letter.
% % see https://tex.stackexchange.com/a/165091/107497 for fix and pitfalls
meth-od
of-ten
proc-ess
re-fer-ring
qua-dra-tic
sa-li-ent
se-quence
sketch-ing
smart-er
sub-sti-tute
The-o-rem
Trig-o-no-me-tric
trig-o-no-me-tric
wheth-er
}}
}
% lets try to reduce bad boxes
\usepackage{microtype}
Expand Down Expand Up @@ -417,7 +408,9 @@
unicode,
pdflang=EN-US
}
\usepackage{bookmark}
\ifbool{latexml}{}{
\usepackage{bookmark}
}
% hyperref changes these
Expand Down
105 changes: 99 additions & 6 deletions headers/apex_style.sty
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,103 @@
% }%
%}}


\usepackage{titletoc}
\titlecontents{part}[0pt]
{\vspace{3ex}}
{no numbered parts}
{\large\bfseries}
{\titlerule*[1em]{ }}

% titlesec (and titleformat) is available to latexml,
% but the formatting leaks into the TOC and the header
\usepackage[newparttoc]{titlesec} % apparently conflicts with hyperref? :(
% but: ``unsolved is the anchor setting, missing with unnumbered section,
% perhaps problems with page breaks with numbered ones''
% if I'm not seeing those problems, maybe just continue

\newcommand{\leftparbox}[2]{\parbox[t]{#1}{\raggedright#2}}
% I couldn't get the raggedright to take otherwise

\titleformat{\part}[block]
{\Huge\bfseries\filcenter} % commands on the entire thing
{} % don't use a label
{0em} % space between (non?)label and title
{\thispagestyle{empty}} % command for the page

\titleformat{\chapter}[block]
{\hyphenpenalty=10000\relax\Huge\scshape\textsc} % commands on the entire thing
{\thechapter:} % the label
{.4em} % space between label and title
{\leftparbox{11em}} % command taking the title
[\addvspace{2ex}\titlerule] % afterward
\titlespacing*{\chapter}{0pt}{0pt}{2ex}

%\titleformat{\section}
% {\normalfont\Large\bfseries} % commands on the entire thing
% {\thesection} % the label
% {1em} % space between label and title
% {} % command taking the title (only actual difference)


\usepackage{tcolorbox}
\tcbuselibrary{breakable,skins,theorems}

\tcolorboxenvironment{example}{
empty,
size=minimal,
breakable,
parbox=false,
beforeafter skip=\boxskipamount,
enlargepage flexible=3\baselineskip,
lines before break=5,
before upper={\setlength{\parindent}{\saveparindent}\noindent},
boxsep=0pt,
bottom=.5ex,
overlay unbroken={
\node[xshift=-2\marginlinelength,yshift=-.5\baselineskip]
(start\arabic{example})at(frame.north west){};
\node[xshift=1em](stop\arabic{example})at(frame.south west){};
\draw[thick,\thelinecolor](start\arabic{example})|-(stop\arabic{example});
},
overlay first={
\node[xshift=-2\marginlinelength,yshift=-.5\baselineskip]
(start\arabic{example})at(frame.north west){};
\node[xshift=-2\marginlinelength,yshift=-2\baselineskip]
(stop\arabic{example})at(frame.south west){};
\draw[thick,\thelinecolor](start\arabic{example})--(stop\arabic{example});
},
overlay middle={
% a middle has only one on a page, so we don't need other suffixes
\node[xshift=-2\marginlinelength,yshift=.5\baselineskip]
(start)at(frame.north west){};
\node[xshift=-2\marginlinelength,yshift=-2\baselineskip]
(stop)at(frame.south west){};
\draw[thick,\thelinecolor](start)--(start|-stop);
},
overlay last={
\node[xshift=-2\marginlinelength,yshift=.5\baselineskip]
(start\arabic{example})at(frame.north west){};
\node[xshift=1em](stop\arabic{example})at(frame.south west){};
\draw[thick,\thelinecolor](start\arabic{example})|-(stop\arabic{example});
},
}

% large shrinkable space can conspire with a bad page break to cause text to overlap
% see https://tex.stackexchange.com/a/551585/107497 by Thomas F. Sturm
%\makeatletter
\def\tcb@split@force@last{%
\tcb@split@setstate@last%
\ifdim\tcb@h@total>\tcb@h@page\relax%
\gdef\tcb@after@lastbox{\clearpage}%
\tcbdimto\kvtcb@bbbottom{\kvtcb@bbbottom+\tcb@h@page-\tcb@h@total}%
\fi%
}
%\makeatother




% only in .ltxml
\newcommand{\iframe}[3]{}
\newcommand{\makeStyles}[2]{}
Expand Down Expand Up @@ -251,9 +348,7 @@
\refstepcounter{chapter}%
\pdfbookmark[chapter]{\thechapter\ #2}{#3}
\addtocounter{section}{-1}%
\ifbool{latexml}{}{%
\addtocontents{toc}{\protect\setcounter{tocdepth}{0}}%
}
\addtocontents{toc}{\protect\setcounter{tocdepth}{0}}%
\let\oldsection=\section
\bgroup
\renewcommand{\section}[1]{%
Expand All @@ -262,9 +357,7 @@
}
\input{#1}%
\egroup
\ifbool{latexml}{}{%
\addtocontents{toc}{\protect\setcounter{tocdepth}{1}}%
}
\addtocontents{toc}{\protect\setcounter{tocdepth}{1}}%
\restoregeometry
% the grouping intercepted the restoregeometry at the end of the prereq's exercises
\chapter*{\thechapter: #2}\label{#3}
Expand Down
11 changes: 5 additions & 6 deletions headers/apex_style.sty.ltxml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ use Scalar::Util qw(looks_like_number);

# fix some bugs
RawTeX('\setlength{\marginparwidth}{150pt}');
RawTeX('\setlength{\baselineskip}{12pt}');
RawTeX('\newlength{\defaultaddspace}');
RawTeX('\setlength{\defaultaddspace}{5pt}');

Expand Down Expand Up @@ -59,7 +58,7 @@ DefConstructor('\makeStyles{}{}',
'</ltx:resource>',
properties => sub {
return (
selector => '.ltx_theorem_'.UnTeX($_[1]).'Env',
selector => '.ltx_theorem_'.UnTeX($_[1]),
styles => &boxStyles(UnTeX($_[2]))
);
}
Expand Down Expand Up @@ -95,31 +94,31 @@ sub boxStyles {
}

DefMacro('\apexchapter []{}{}',
#'\setboolean{chapter_already_has_exercises}{false}'
'\chapter{#2}\label{#3}'
.'\ifx.#1.\else\addtocounter{section}{-1}\input{#1}\fi'
.'\section*{Chapter Introduction}');
.'\section*{Chapter Introduction}'
.'\addcontentsline{toc}{section}{Chapter Introduction}');


DefMacro('\myincludegraphicsthree{}{} Semiverbatim',
'\myincludegraphics[#2]{#3_3D}');
DefMacro('\myincludeasythree{}{} Semiverbatim','\myincludegraphics[#2]{#3}');

DefMacro('\vv {}','\vec #1');

DefMacro('\flushinner{}','{#1}');
DefMacro('\flushouter{}','{#1}');
DefMacro('\flushinnerequ{}','{#1}');
DefMacro('\flushouterequ{}','{#1}');

# some Macros we do need

DefMacro('\vv {}','\vec #1'); # provided by esvect
DefMacroI('\textcent',undef,"\x{00A2}");
DefMacro('\psBill'); # todo

# some macros we don't need
DefMacro('\testmargintop');
DefMacro('\testmarginbottom');
DefMacro('\packageinanswersection');


if(0==1){
Expand Down
Loading

0 comments on commit 68adc41

Please sign in to comment.