%added june 10, 2021 for making flar work %\ifdefined\HCode %\else %\pdfvariable compresslevel = 0 %\fi %%%%%%%%%%%%%%%%%%%%%%%% %added MAY 2, 2019. Must be first thing %march 2022. Not needed any more. see %https://tex.stackexchange.com/questions/638895/error-using-tikz-with-tex4ht-extra-else?noredirect=1#comment1592662_638895 %\ifdefined\HCode % \def\pgfsysdriver{pgfsys-dvisvgm4ht.def} %\fi %%%%%%%%%%%%%%% %lua code is loaded in here %\usepackage{listings,lstautogobble}% added lstautogobble oct 30,2020 %\usepackage{fancybox,fancyvrb,xcolor} %\definecolor{bg}{RGB}{255,255,226} %\input{my_lua_functions} %misc. function %\newcommand\mytexht{\ifdefined\HCode 1\else 0\fi} %\input{my_lua_code_format_5} %formating. \usepackage{tikz} \usepackage{tikz-qtree} \usetikzlibrary{quotes,angles,calc} \usetikzlibrary{arrows.meta} %see https://tex.stackexchange.com/questions/13715/how-to-suppress-overfull-hbox-warnings-up-to-some-maximum \hfuzz=5pt %CRITICAL packages \usepackage{amsmath} \usepackage{breqn} \input{my_listings_definitions} \usepackage{luacode} %make sure to use Latex:-Settings(leavespaceafterfunctionname = true) %in maple, else overcorrection will result due to maple adding \! now %\usepackage{mleftright} %\mleftright %remove above. Makes spacing too tight. \usepackage{amssymb} %DO NOT USE with gramond %2/3/2021 %%%%%%%%%%%%%%%%%%%%%%%%%%%%% makecell stuff %removed oct 10,2022. Causes problems. \usepackage{makecell} %make sure before arydshln %see https://tex.stackexchange.com/questions/563115/how-to-add-more-padding-to-table-rows-when-table-has-array-inside-it \setcellgapes{3pt} %added march 14,2021 %removed. It causes error when using m option for tabular. %see https://tex.stackexchange.com/questions/592057/error-when-using-m-option-in-tabular-after-adding-command-makegapedcells %%FROM https://tex.stackexchange.com/questions/319768/are-m-column-type-and-makecell-incompatible \makeatletter \renewcommand\mcell@classz{\@classx \@tempcnta \count@ \prepnext@tok \@addtopreamble{%\mcell@mstyle \ifcase\@chnum \hfil \mcell@agape{\d@llarbegin\insert@column\d@llarend}\hfil \or \hskip1sp \mcell@agape{\d@llarbegin\insert@column\d@llarend}\hfil \or \hfil\hskip1sp \mcell@agape{\d@llarbegin \insert@column\d@llarend}\or \mcell@agape{$\vcenter \@startpbox{\@nextchar}\insert@column\@endpbox$}\or \mcell@agape{\vtop \@startpbox{\@nextchar}\insert@column\@endpbox}\or \mcell@agape{\vbox \@startpbox{\@nextchar}\insert@column\@endpbox}% \fi \global\let\mcell@left\relax\global\let\mcell@right\relax }\prepnext@tok} \makeatletter \makegapedcells %added march 14,2021 %this needs to go AFTER patch %%%%%%%%%%%%%%%%%%%% %added sept 20,2020 to make vertical dashed lines in matrices %see https://tex.stackexchange.com/questions/351887/how-to-place-a-vertical-dashed-line-between-columns-of-a-matrix/351894 \iffalse %REMOVED on feb 27, 2020. Has bad effect %see https://tex.stackexchange.com/questions/69662/how-to-globally-change-the-spacing-around-equations %added 9/6/2019 \makeatletter \g@addto@macro\normalsize{% \setlength\abovedisplayskip{5pt} \setlength\belowdisplayskip{5pt} \setlength\abovedisplayshortskip{5pt} \setlength\belowdisplayshortskip{5pt} } \makeatother \fi \iffalse %causes problem. see https://tex.stackexchange.com/questions/667961/strange-interaction-between-breqn-and-code-that-changes-the-integration-sign-al %commented out dec 8, 2022 %see https://tex.stackexchange.com/questions/553382/improving-spacing-between-math-expressions-automatically %added july 13, 2020 % Give a nicer sqrt symbol. \usepackage{letltxmacro} \makeatletter \let\oldr@@t\r@@t \def\r@@t#1#2{% \setbox0=\hbox{$\oldr@@t#1{#2\,}$}\dimen0=\ht0 \advance\dimen0-0.2\ht0 \setbox2=\hbox{\vrule height\ht0 depth -\dimen0}% {\box0\lower0.4pt\box2}} \LetLtxMacro{\oldsqrt}{\sqrt} \renewcommand*{\sqrt}[2][\ ]{\oldsqrt[#1]{#2}\,} \makeatother \fi \setcounter{MaxMatrixCols}{30} \raggedbottom \usepackage[activate={true,nocompatibility},final,tracking=true,factor=1100,stretch=10,shrink=10]{microtype} \usepackage{graphicx} \DeclareGraphicsExtensions{.pdf,.PDF,.png,.PNG,.jpg,.jpeg,.JPG,.JPEG} \ifdefined\HCode \else \usepackage{animate} \fi \usepackage{etex} %adds more registers \ifdefined\HCode \usepackage{upquote} %to handle correct tex4ht to html conversion of ` \fi %see http://tex.stackexchange.com/questions/249280/matlab-prettifier-code-not-showing-correctly%force font to load %\ttfamily\rmfamily %see http://tex.stackexchange.com/questions/309492/why-font-missing-message-shows-up-when-using-standalone-and-import-packages-only %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usepackage{pgffor} \ifdefined\HCode \else \usepackage{pdfpages} \fi %see https://tex.stackexchange.com/questions/471587/you-cant-use-lastsavedimageresourcepages-in-vertical-mode-error-using-texli \makeatletter \def\pgffor@dots@value@process#1{% \expandafter\pgffor@dots@stripcontext#1\pgffor@@stop% \expandafter\pgffor@dots@charcheck\pgffor@dotsvalue\pgffor@@stop% \let#1=\pgffor@dotsvalue% } \makeatother %%%%%%%%%%%%%% %what is this for? to use H for figure \usepackage{float} \input{my_verbatim} \ifdefined\isLegal \usepackage[legalpaper, bindingoffset=0.2in,% left=1in,right=1in,top=1in,bottom=1in,% footskip=.25in]{geometry} \else \ifdefined\isTabloid \usepackage[papersize={17in, 11in}, bindingoffset=0.2in,% left=1in,right=1in,top=1in,bottom=1in,% footskip=.25in]{geometry} \else \usepackage[letterpaper,bindingoffset=0.2in,% left=0.9in,right=1in,top=1in,bottom=1in,% footskip=.25in]{geometry} \fi \fi %added 2/19/2022. To remove waring abut headheight too small \setlength{\headheight}{14pt} \ifdefined\HCode %do not use with tex4ht. see %https://tex.stackexchange.com/questions/511350/why-adding-pagestylefancy-gives-compile-error-with-tex4ht \else \usepackage{fancyhdr} \pagestyle{fancy} \fancyhf{} \fancyhead[R]{\thepage} \renewcommand\headrulewidth{0pt} \setlength{\headheight}{14.5pt} \addtolength{\topmargin}{-0.5pt} \fi %PRIVATE MACRO \usepackage{etoolbox} \newif\ifPRIVATE \IfFileExists{./private.tex} { \input{private} } { \newbool{private} \setbool{private}{true} } \ifbool{private}{\PRIVATEtrue}{\PRIVATEfalse} %DATE macro \usepackage[us,12hr]{datetime} \ifPRIVATE \newcommand{\dateMe}[1]{% \date{{\small #1} \hspace{.2in} {\tiny Compiled on \today\ at \currenttime} }} \else \newcommand{\dateMe}[1]{% \date{{\small #1} \hspace{.2in} {\tiny Compiled on \today\ at \currenttime \hspace{.2in} [public]} }} \fi %DATE macro \usepackage[us,12hr]{datetime} \ifPRIVATE \newcommand{\dateMeForTitle}[1]{% {\small #1} \hspace{.2in} {\tiny Compiled on \today\ at \currenttime} } \else \newcommand{\dateMeForTitle}[1]{% {\small #1} \hspace{.2in} {\tiny Compiled on \today\ at \currenttime \hspace{.2in} [public]} } \fi %%%%%%%%%%%%%%%%%%%%%% \iffalse %no longer will use. Switching to listings \newcommand\myfullpath[2]{\luadirect{myfullpath(\luastring{#1},\luastring{#2})}} \newcommand\myformat[4]{\luadirect{myformat(#1,#2,#3,#4)}} \newcommand\mytexht{\ifdefined\HCode 1\else 0\fi} \input{my_lua_functions} %misc. function \input{my_lua_code_format_4} %formating. \fi % % Added 2/18/16. Use this if first page of chanpter (in report class or book) is an IMAGE % to make it adjust the height automatically to avoid empty page. Not for sections, since % these do not start at new page in report. If using article class, then can use it for % section first page, since those start on new page % \usepackage{tikzpagenodes} \newlength{\vremaining} %use this ONLY for image on first page of chapter. Not section %http://tex.stackexchange.com/questions/294716/the-problem-of-empty-page-when-starting-new-chapter-with-an-image-on-first-page \newcommand{\getremaining}% {\begin{tikzpicture}[remember picture,overlay] \pgfextracty{\vremaining}{\pgfpointdiff{\pgfpointanchor{current page text area}{south}}% {\pgfpointorigin}} \global\vremaining=\vremaining \end{tikzpicture}\vspace{-\baselineskip}\newline}% place above image %Usage example %\getremaining\includegraphics[height=\vremaining]{hand_outs/handout_syllabus} %do NOT use with tex4ht. It breaks tex4ht \ifdefined\HCode %disable captionsetup so it does not breal latex I allready used it in with tex4ht \newcommand\captionsetup[1]{} \else \usepackage{caption} %added 2/18/16 for making caption in figure same size as image \fi %http://tex.stackexchange.com/questions/202046/width-of-the-caption-of-a-figure \usepackage{multirow} %added 2/21/16. To allow table with columns that span rows \usepackage{longtable} %2/24/16 does not work in two columns %see https://tex.stackexchange.com/questions/31672/column-and-row-padding-in-tables %\setlength{\tabcolsep}{0.5em} % for the horizontal padding %\renewcommand{\arraystretch}{1.4}% for the vertical padding %commented out on oct 28,2020 \ifdefined\HCode \else %see http://tex.stackexchange.com/questions/309604/tex-capacity-exceeded-when-using-breqn-package-with-a-separate-macro %needed to break long math expression with commands. To use do: % $\splitatcommas{a,b,c}$ % \newcommand{\splitatcommas}[1]{% \begingroup \begingroup\lccode`~=`, \lowercase{\endgroup \expandafter\def\expandafter~\expandafter{~\penalty0 \hspace{0pt plus 1em}}% }#1% \endgroup } \fi \setlength{\fboxsep}{6pt} %added 4/28/16 to increase spacing \usepackage[normalem]{ulem} %added 5/12/16 to underline things, \uline{..} \usepackage{array}%added 6/15/16 \usepackage[export]{adjustbox} \usepackage{makeidx} %added 5/14/16 \ifdefined\HCode \else \usepackage{bigstrut} %added 09302020, see https://tex.stackexchange.com/questions/564873/how-to-add-either-dashed-or-colored-vertical-line-in-array-but-without-using-a \fi %\usepackage[pdfencoding=auto]{hyperref} %removed pdfencoding, causing error with uni-code math %see https://tex.stackexchange.com/questions/514703/using-pdfencoding-auto-with-hyperref-cause-compile-error-when-using-unicode-math %used this now to see if it helps with math and verbatim in section header %removed it, do not like losing bookmarks in pdf %\usepackage[bookmarks=false]{hyperref} %\usepackage[unicode, bookmarks]{hyperref} %\usepackage[bookmarks,bookmarksopen,bookmarksdepth=3]{hyperref} %\usepackage[bookmarks,bookmarksdepth=3]{hyperref}%this makes PDF bookmarks show up to subsubsection in book %removed may 14, 2022. Does not work %\ifdefined\HCode %\usepackage{xr-hyper}%added april 30, 2022 %\fi \usepackage[colorlinks,allcolors=blue,linktocpage,bookmarks,bookmarksdepth=3]{hyperref} %see https://tex.stackexchange.com/questions/623377/how-to-increase-the-setting-dest-names-size-using-lualatex-on-tl-2021?noredirect=1#comment1556234_623377 \hypersetup{pageanchor=false} \usepackage{bookmark}%added may 26,2020 to get rid of %Package hyperref Warning: The anchor of a bookmark and its parent's must not %see https://tug.org/pipermail/texhax/2007-October/009123.html %to add underline \hypersetup{% colorlinks=false,% hyperlinks will be black %pdfborderstyle={/S/U/W 1}% border style will be underline of width 1pt urlbordercolor=blue% } %added oct 26, 2018. Some old latex files use this \makeatletter \providecommand{\currentimportpath}{\import@path} \makeatother %AUTHOR macro \newcommand{\authorMe}[0] {\author{\footnotesize \href{mailto:nma@12000.org}{Nasser M. Abbasi}}}% %added below on 5/6/16 \makeatletter %from http://tex.stackexchange.com/questions/3033/forcing-linebreaks-in-url \g@addto@macro{\UrlBreaks}{\UrlOrds} \makeatother \frenchspacing %added feb 2019 to prevent PDF reader from copying line numbers %of listing %see https://tex.stackexchange.com/questions/57151/how-do-i-prevent-conflicts-between-accsupp-and-hyperref %\usepackage{accsupp}% http://ctan.org/pkg/accsupp %\newcommand\emptyaccsupp[1]{\BeginAccSupp{ActualText={}}#1\EndAccSupp{}} %remove, since conflict with koma style \ifdefined\HCode \else \usepackage[raggedright,nobottomtitles]{titlesec} \fi \usepackage{rotating} %added sept 19, 2018 %see https://tex.stackexchange.com/questions/6081/reduce-space-between-enumerated-items %DO NOT USE with texthtm \ifdefined\HCode \else \usepackage{enumitem} \setlist{itemsep=.1em} \fi %added oct 27, 2018 \usepackage{tabularx} %\usepackage{tabu}%added 8/16/2019 \usepackage{booktabs}%added 8/16/2019 \setlength\heavyrulewidth{0.5ex} \aboverulesep=0ex \belowrulesep=0ex %see https://tex.stackexchange.com/questions/88929/vertical-table-lines-are-discontinuous-with-booktabs %added august 26, 2019 \ifdefined\HCode \else \usepackage{resizegather} \fi %%% FONTS %\usepackage{fourier}%nice %\usepackage[T1]{fontenc} %\ifdefined\HCode %\usepackage{fouriernc} %\usepackage[T1]{fontenc} %\else %\usepackage{fouriernc} %\usepackage[T1]{fontenc} %\usepackage[libertine]{newtxmath} %\usepackage{fourier}%nice %\usepackage[T1]{fontenc} %\usepackage{unicode-math} %\setmainfont{XITS}%nice %\setmathfont{XITS Math} %\setmainfont{STIX Two Text}%best %\setmathfont{STIX Two Math} %\setmainfont[Ligatures={Common,Rare,TeX}]{TeX Gyre Pagella}%best %\setmathfont[Scale=MatchUppercase]{Asana Math} %\setmainfont{TeX Gyre Bonum} %\setmathfont{TeX Gyre Bonum Math} %\setmainfont{TeX Gyre Pagella} %\setmathfont{TeX Gyre Pagella Math} %\setmainfont{TeX Gyre Schola} %\setmathfont{TeX Gyre Schola Math} %\setmainfont{TeX Gyre Termes} %\setmathfont{TeX Gyre Termes Math} %\setmainfont{DejaVu Serif} %\setmathfont{TeX Gyre DejaVu Math} %\setmainfont{XITS}%nice %\setmathfont{XITS Math} %\usepackage{unicode-math} %\setmainfont{Libertinus Serif} %\setmathfont{Libertinus Math} %\usepackage{unicode-math} %\setmainfont{XITS} %\setmathfont{XITS Math} %\setmathfont[range={"222B-"2233,"2A0B-"2A1C},StylisticSet=8]{XITS Math} %\setmainfont{XITS} %\setmathfont{XITS Math} %\setmathfont[range={"222B-"2233,"2A0B-"2A1C},StylisticSet=8]{XITS Math} %\fi %\renewcommand{\familydefault}{\sfdefault} %\usepackage[T1]{fontenc} %added sept 16, 2018 %\usepackage[subtle]{savetrees} %\usepackage[moderate]{savetrees} %added OCT 26, 2018 \usepackage{siunitx} %added OCT 28, 2018 \ifdefined\HCode \newcommand{\cprotect}{} \else \usepackage{cprotect} %only needed to latex \fi %added sept 16, 2018 \usepackage{parskip} \makeatletter %added march 9, 2020 so it works in minipage also \setlength{\parskip}{\medskipamount} \newcommand{\@minipagerestore}{\setlength{\parskip}{\medskipamount}} \makeatother %\setlength{\parindent}{0pt} %\setlength{\parskip}{0.7em} %see https://tex.stackexchange.com/questions/69662/how-to-globally-change-the-spacing-around-equations %%%% STANDALONE \usepackage{standalone} \usepackage{import} \usepackage{currfile} %\makeatletter %needed to be able to have href path adjusted in child files also. %in child files make sure to use \href{\currentimportpath index.pdf}. %\providecommand{\currentimportpath}{\import@path} %\makeatother %for floatBarrier until I remove them all \usepackage{placeins} \DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm} \DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit} %added oct 26, 2018 \usepackage{multicol} \setlength{\columnseprule}{0.1pt} \setlength{\columnsep}{10pt} \usepackage{xstring} %added nov 21, 2018 \usepackage{ifthen}%added nov 21, 2018 \usepackage{xfp} %added june 6, 2019. see https://tex.stackexchange.com/questions/494438/how-to-use-result-of-fpeval-computation-inline %put here on july 14, 2019 \usepackage{pifont} %http : // ctan.org/pkg/pifont \newcommand{\cmark}{\textcolor{blue}{\Large \ding{51}}} \newcommand{\xmark}{\textcolor{red}{\Large \ding{55}}} \newcommand{\notsure}{\ding{103}} % %%%%%%%%% %%%%%%%%%% MACROS %%%%%%%%%%% %% These commands added MAY 16 2019 to make LOCAL TOC %%to use them, just add the command \makeLocalChapterToc or %%\makeLocalSectionToc just below \chapter of \section \ifdefined\HCode \else \usepackage{tocloft} \usepackage{etoc} \fi % REMOVED THIS on 3/22/2022. It made things worst \iffalse %see https://tex.stackexchange.com/questions/633694/problem-with-localtableofcontents-from-package-etoc %to fix toc numbers %not good. breaks things \newlength{\chapterW} \settowidth{\chapterW}{9999} % width of the chapter number box \newlength{\pageW} \settowidth{\pageW}{99999} % width of the page number box \newlength{\snumberW} \settowidth{\snumberW}{999.999} % width of the section number box<<<< \newlength{\subnumberW} \settowidth{\subnumberW}{999.999.999} % width of the subsection number box<<<< \newcommand*{\DotsAndPage} {\nobreak\leaders\hbox{\normalsize\hbox to 1.75ex {\hss.\hss}}% make dots \hfill\nobreak\rlap{\makebox[\pageW]{\etocpage}}\par} \etocsetstyle{subsection} {} {\normalfont\addvspace{.5ex}\noindent\setlength{\leftskip}{\dimexpr \chapterW + \snumberW + 5.5em}\setlength{\rightskip}{2em}} {\llap{\makebox[\subnumberW][l]{\etocnumber}}\etocname\DotsAndPage} {} \etocsetstyle{section} {} {\normalfont\addvspace{.5ex}\noindent\setlength{\leftskip}{\dimexpr \chapterW + 3.5em}\setlength{\rightskip}{2em}} {\llap{\makebox[\snumberW][l]{\etocnumber}}\etocname\DotsAndPage} {} \etocsetstyle{chapter} {} {\bfseries\addvspace{.8ex}\setlength{\leftskip}{1.5em}\setlength{\rightskip}{2em}\noindent} {\llap{\makebox[\chapterW][l]{\etocnumber}}\etocname \hfill\nobreak\rlap{\makebox[\pageW]{\etocpage}}\par} {} \fi %%%%%%%%%%%% \newcommand{\makeLocalPartToc} { \ifdefined\HCode \else \etocsetnexttocdepth{0} \etocsettocstyle{\chapter*{Local contents}}{} \cftsecindent 0pt \localtableofcontents \fi } \newcommand{\makeLocalChapterToc} { \ifdefined\HCode \else \etocsetnexttocdepth{1} \etocsettocstyle{\section*{Local contents}}{} \cftsecindent 0pt \localtableofcontents \fi } \newcommand{\makeLocalSectionToc} { \ifdefined\HCode \else \etocsetnexttocdepth{2} \etocsettocstyle{\subsection*{Local contents}}{} \cftsubsecindent 0pt \localtableofcontents \fi } \newcommand{\makeLocalSubsectionToc} { \ifdefined\HCode \else \etocsetnexttocdepth{3} \etocsettocstyle{\subsubsection*{Local contents}}{} \cftsubsecindent 0pt \localtableofcontents \fi } %%%%%%%%%%% %DO NOT USE ANY MORE. Use BELOW version. %Added December 2019 %usage \readPDF{file} %make sure not to use file.pdf %this reads PDF pages into latex. %called like \readPDFCompressFirstPage{file_name} OR %called like \readPDFCompressFirstPage[factor]{file_name} %in both cases, #2 is the file_name and factor is #1. If called % uses \readPDFCompressFirstPage{file_name} then default is 0.75 % to shrink first page, else it will use whatever was supplied. As in %\readPDFCompressFirstPage[0.5]{file_name} \newcommand{\readPDFCompressFirstPage}[2][0.75] { \ifdefined\HCode \href{#2.pdf}{PDF} \else% \saveimageresource{#2.pdf}% \noindent\makebox[\textwidth]{% %\includegraphics[scale=#1,page=1,frame={\fboxrule} {-\fboxrule}]{#2} \includegraphics[width=#1\paperwidth,page=1,frame={\fboxrule} {-\fboxrule}]{#2} } \ifnum\the\lastsavedimageresourcepages>1 { \foreach \n in {2,...,\lastsavedimageresourcepages} % for lualatex { \noindent\makebox[\textwidth]{% %\includegraphics[scale=0.85,page=\n,frame={\fboxrule} {-\fboxrule}]{#2} \includegraphics[width=0.85\paperwidth,page=\n,frame={\fboxrule} {-\fboxrule}]{#2} }%make sure there is empty line below } } \fi \fi } %Added Jan 2020 %usage \readPDFV{file,firstPageCompression,otherPagesCompress} %make sure not to use file.pdf \newcommand{\readPDFV}[3] { \ifdefined\HCode \href{#1.pdf}{PDF} \else% \saveimageresource{#1.pdf}% \noindent\makebox[\textwidth]{% %\includegraphics[scale=#2,page=1,frame={\fboxrule} {-\fboxrule}]{#1} \includegraphics[width=#2\paperwidth,page=1,frame={\fboxrule} {-\fboxrule}]{#1} } \ifnum\the\lastsavedimageresourcepages>1 { \foreach \n in {2,...,\lastsavedimageresourcepages} % for lualatex { \noindent\makebox[\textwidth]{% %\includegraphics[scale=#3,page=\n,frame={\fboxrule} {-\fboxrule}]{#1} \includegraphics[width=#3\paperwidth,page=\n,frame={\fboxrule} {-\fboxrule}]{#1} }%make sure there is empty line below } } \fi \fi } %Added May 27 2020. new version USE THIS not the above % % TRY to see if I can replace all this by using \maxsizebox from adjustbox package % when I have time. june 10.2021 % %usage \getPDF{file,firstPageCompression,otherPagesCompress,frame} %make sure not to use file.pdf %if frame=1, adds frame around page. if frame=0 no frame added \newcommand{\getPDF}[4] { \ifdefined\HCode \href{#1.pdf}{PDF} \else% \IfEqCase{#4}% {% {1}% {% \saveimageresource{#1.pdf}% \noindent\makebox[\textwidth]{% %\includegraphics[scale=#2,page=1,frame={\fboxrule} {-\fboxrule}]{#1} \includegraphics[width=#2\paperwidth,page=1,frame={\fboxrule} {-\fboxrule}]{#1} } \ifnum\the\lastsavedimageresourcepages>1 { \foreach \n in {2,...,\lastsavedimageresourcepages} % for lualatex { \noindent\makebox[\textwidth]{% %\includegraphics[scale=#3,page=\n,frame={\fboxrule} {-\fboxrule}]{#1} \includegraphics[width=#3\paperwidth,page=\n,frame={\fboxrule} {-\fboxrule}]{#1} }%make sure there is empty line below } } \fi } {0}% {% \saveimageresource{#1.pdf}% \noindent\makebox[\textwidth]{% %\includegraphics[scale=#2,page=1]{#1} \includegraphics[width=#2\paperwidth,page=1]{#1} } \ifnum\the\lastsavedimageresourcepages>1 { \foreach \n in {2,...,\lastsavedimageresourcepages} % for lualatex { \noindent\makebox[\textwidth]{% %\includegraphics[scale=#3,page=\n]{#1} \includegraphics[width=#3\paperwidth,page=\n]{#1} }%make sure there is empty line below } } \fi } } \fi } %%%%%%%%%%%%%%%%%%%%%% %Added July 22, 2021. new version USE from now on. % % %usage \mypdfpages{file,command} %make sure not to use file.pdf \newcommand{\mypdfpages}[2] { \ifdefined\HCode \ifstrempty{#2}{\href{#1.pdf}{PDF}}{% #2 \href{#1.pdf}{PDF} } %\ifthenelse{}{}{} %\ifthenelse{\isundefined{#2}}{% % \href{#1.pdf}{PDF} % }{% % #2 % \href{#1.pdf}{PDF} % } \else% \saveimageresource{#1.pdf}% \includepdf[scale=0.8,pages=1,pagecommand=#2]{#1} \ifnum\the\lastsavedimageresourcepages>1 { \includepdf[scale=0.8,pages=2-,pagecommand={}]{#1} } \fi \fi } %%%%%%%%%%%%%%%%%%%%%% \newcommand{\readPDF}[1] { \ifdefined\HCode \href{#1.pdf}{PDF} \else% \saveimageresource{#1.pdf}% \foreach \n in {1,...,\lastsavedimageresourcepages} % for lualatex { \noindent\makebox[\textwidth]{% %\includegraphics[scale=0.85,page=\n,frame={\fboxrule} {-\fboxrule}]{#1} \includegraphics[width=0.85\paperwidth,page=\n,frame={\fboxrule} {-\fboxrule}]{#1} }%make sure there is empty line below } \fi } %%%%%%%%%%% %usage \readPDFSlidesCompressFirstPage{file} %make sure not to use file.pdf %this reads PDF pages into latex. \newcommand{\readPDFSlidesCompressFirstPage}[1] { \ifdefined\HCode \href{#1.pdf}{PDF} \else% \saveimageresource{#1.pdf}% \noindent\makebox[\textwidth]{% %\includegraphics[scale=0.6,page=1,frame={\fboxrule} {-\fboxrule}]{#1} \includegraphics[width=0.6\paperwidth,page=1,frame={\fboxrule} {-\fboxrule}]{#1} } \ifnum\the\lastsavedimageresourcepages>1 { \foreach \n in {2,...,\lastsavedimageresourcepages} % for lualatex { \noindent\makebox[\textwidth]{% %\includegraphics[scale=0.65,page=\n,frame={\fboxrule} {-\fboxrule}]{#1} \includegraphics[width=0.65\paperwidth,page=\n,frame={\fboxrule} {-\fboxrule}]{#1} }%make sure there is empty line below } } \fi \fi } %%%%%%%%%%%%%%%%%%%% \newcommand{\readPDFSlides}[1] { \ifdefined\HCode \href{#1.pdf}{PDF} \else% \saveimageresource{#1.pdf}% \foreach \n in {1,...,\lastsavedimageresourcepages} % for lualatex { \noindent\makebox[\textwidth]{% %\includegraphics[scale=0.65,page=\n,frame={\fboxrule} {-\fboxrule}]{#1} \includegraphics[width=0.65\paperwidth,page=\n,frame={\fboxrule} {-\fboxrule}]{#1} }%make sure there is empty line below } \fi } %%%%%%%%%%%%%%%% %added Nov 21, 2018. Use to add graphics, centered in HTML with frame %only for latex. Using frame in HTML makes the image not centered any more. %first argument is 1 or 0 if we want frame around image. Second %argument is magnification, 3rd argument is image file name. 4ht %argument is caption. %for example \addImage{1}{0.99}{images/1}{the Problem statement} \newcommand{\addImage}[4] { \begin{figure}[H] \centering \IfEqCase{#1}% {% {1}{% \ifstrempty{#4} { %\fbox{\includegraphics[scale=#2]{#3}} \fbox{\includegraphics[width=#2\textwidth]{#3}} } { %\fbox{\includegraphics[scale=#2]{#3}}\caption{#4} \fbox{\includegraphics[width=#2\textwidth]{#3}}\caption{#4} }% }% {0}{ \ifstrempty{#4} { %\includegraphics[scale=#2]{#3} \includegraphics[width=#2\textwidth]{#3} } { %\includegraphics[scale=#2]{#3}\caption{#4} \includegraphics[width=#2\textwidth]{#3}\caption{#4} } }% } \end{figure} }% %%%------------------------------------------ %DO NOT USE. Kept for old use. Use \getPDF instead %adds PDF as image or link. First argument is full path, second is file name %third is magnification. Like this %\addPDF{file/path}{file}{1.1} \newcommand{\addPDF}[3] {% \ifdefined\HCode \url{#1/#2.pdf} % \href{#1/#2.pdf}{#2.pdf} \else \saveimageresource{#1/#2.pdf} \foreach \n in {1,...,\lastsavedimageresourcepages} % for lualatex { \noindent\makebox[\textwidth]{% \includegraphics[width=#3\textwidth,page=\n]{#1/#2} %\includegraphics[scale=#3,page=\n]{#1/#2} } } \fi } %%%%%%%%---------------------------- %adds animated gif file to HTML only %first is file name second is size %example \addGIF{"file.gif"}{"300"} %this is meant to be called in \ifdefined\HCode ONLY %\newcommand{\addGIF}[2] %{ %\ifdefined\HCode %\HCode{ % %
  
% } %\fi %} %adds animated gif file to HTML only %first is file name second is size %example \addGIF{"file.gif"}{"300"} %this is meant to be called in \ifdefined\HCode ONLY \newcommand{\addGIF}[2] { \HCode{} } %New version. This uses libgif %first is file name second is size %example \addGIF{"file.gif"}{"300"}{"cover.png"}{var_name} %this is meant to be called in \ifdefined\HCode ONLY \newcommand{\addGIFX}[4] { \HCode{ \Hnewline
\Hnewline Pause\Hnewline Play\Hnewline Restart\Hnewline Step forward\Hnewline Step back\Hnewline } } %%%%%%%%%% added oct 24, 2020 %example use %\begin{align*} %U_1 &= \myadjustbox{ (-1)^{4-1} \int{ \frac{F(x) W_1(x) }{a W(x)} \, dx} }\\ % &=\myadjustbox{ (-1)^{3} \int{ \frac{ \left(e^{x} \left(\left(2+6 x \right) \cos \left(2 x \right)+3 \sin \left(2 x \right)\right)\right) \left(-8 e^{3 x} \sin \left(2 x \right)^{2} \cos \left(2 x \right) x -8 e^{3 x} \cos \left(2 x \right)^{3} x +4 e^{3 x} \sin \left(2 x \right)^{3}+4 e^{3 x} \sin \left(2 x \right) \cos \left(2 x \right)^{2}\right)}{\left(1\right) \left(64 e^{4 x} \sin \left(2 x \right)^{4}+128 e^{4 x} \sin \left(2 x \right)^{2} \cos \left(2 x \right)^{2}+64 e^{4 x} \cos \left(2 x \right)^{4}\right)} \, dx} }\\ %\end{align*} %needed to adjust my .cfg to tell mathjax about this. See %https://tex.stackexchange.com/questions/568244/how-to-make-tex4ht-ignore-some-commands-automatically \newcommand\myadjustbox[2][0.98]{% %default width: 0.9\textwidth \ifdefined\HCode {$\displaystyle #2$} \else \adjustbox{max width=#1\linewidth}{$\displaystyle #2$} \fi }{% } %%%%%% FONT %\usepackage[T1]{fontenc} %not needed with lualatex %\usepackage{lmodern} %USING THIS NOW %commented out oct 29. 2019 %\addtokomafont{sectioning}{\boldmath} %\usepackage{fixcmex} %example 1 see http://mirrors.ibiblio.org/CTAN/fonts/newtx/doc/newtxdoc.pdf \ifdefined\HCode \else \iffalse \usepackage[scaled=.85]{beramono}% used only by \mathtt \usepackage[type1]{cabin}% used only by \mathsf \usepackage{amsthm}% must be loaded before newtxmath \usepackage[upint,smallerops,varg,varvw,libertine]{newtxmath} % loads minlibertine because no other Roman text package was specified % so that \mathrm and \mathbf also use minlibertine %\usepackage[scr=rsfso]{mathalfa} \usepackage{mathalfa} \usepackage{bm}% load after all math to give access to bold math %Now load the otf text fonts using fontspec---won't affect math \usepackage[no-math]{fontspec} % process with XeLaTeX or LuaLaTeX \usepackage{libertine} \fi %\usepackage{fontspec} %\setmainfont{Times New Roman} %\newfontfamily\Verdana{Verdana}[Scale=MatchLowercase, % Ligatures=TeX] %\newfontfamily\Cambria{Cambria}[Scale=MatchLowercase, % Ligatures=TeX] %do not work on linux %\usepackage{unicode-math} %\setmainfont{Cambria} %\setmathfont{Cambria Math} %see https://tex.stackexchange.com/questions/100329/is-a-real-baskerville-font-available-for-latex %\usepackage{lmodern} % monospace font %\usepackage[scale=0.89]{tgheros} % Helvetica is too big %\usepackage[osf]{Baskervaldx} % tosf in text, tlf in math %\usepackage[baskervaldx,cmintegrals,bigdelims,vvarbb]{newtxmath} % math italic letters from Baskervaldx %\usepackage[cal=boondoxo]{mathalfa} % mathcal from STIX, unslanted a bit %try this %\usepackage{unicode-math} \iffalse %not too good \usepackage{unicode-math} \setmainfont{TeX Gyre Pagella} \setmathfont{TeX Gyre Pagella Math} \fi \iffalse %not too good \usepackage{unicode-math} \setmainfont{TeX Gyre Schola} \setmathfont{TeX Gyre Schola Math} \fi \iffalse %not too good \usepackage{unicode-math} \setmainfont{DejaVu Serif} \setmathfont{TeX Gyre DejaVu Math} \fi \iffalse %not too good \usepackage{unicode-math} \setmainfont{STIX} \setmathfont{STIX Math} \fi \iffalse %Ok \usepackage{unicode-math} \setmainfont[Ligatures={Common,Rare,TeX}]{TeX Gyre Pagella} \setmathfont[Scale=MatchUppercase]{Asana Math} \fi \iffalse %Ok \usepackage{unicode-math} \setmainfont{EBGaramond-Regular}[ BoldFont = EBGaramond-Bold, ItalicFont = EBGaramond-Italic, BoldItalicFont = EBGaramond-BoldItalic ] \setmathfont{Garamond Math}[Scale=MatchUppercase] \fi \iffalse %NICE!! %do not like it any more. bold math do not show \usepackage[osf]{Baskervaldx} % tosf in text, tlf in math \usepackage[vvarbb]{newtxmath} % math italic letters from Times \usepackage[cal=boondoxo]{mathalfa} % mathcal from STIX, unslanted a bit \fi \iffalse%now trying this. Nov 9, 2019. But do not like it too much \usepackage{amsmath} \usepackage{unicode-math} \setmainfont{TeX Gyre Termes} \setmathfont{TeX Gyre Termes Math} \fi %\setmathfont{Cambria Math} %\setmathfont{Libertinus Math} %like Asana little more %\setmathfont{TeX Gyre Termes Math} %\fi % %switching to this now %\usepackage[utf8]{inputenc} %\usepackage[lf]{Baskervaldx} % lining figures %\usepackage[bigdelims,vvarbb]{newtxmath} % math italic letters from Nimbus Roman %\usepackage[cal=boondoxo]{mathalfa} % mathcal from STIX, unslanted a bit %\renewcommand*\oldstylenums[1]{\textosf{#1}} % %\usepackage[garamond]{mathdesign} %not good %\usepackage[charter]{mathdesign} %\usepackage{kmath,kerkis} not good %\setmathfont[]{Cambria Math} %not that good %\setmathfont[]{Latin Modern Math} %using this now. Oct 29. 2019 but does not work on windows. \iffalse \usepackage[ math-style=ISO, bold-style=ISO, partial=upright, nabla=upright ]{unicode-math} \setmainfont{Libertinus Serif} \setsansfont{Libertinus Sans} \setmathfont{Libertinus Math} \fi \iffalse %use this. Looks good. \usepackage[T1]{fontenc} \usepackage[urw-garamond]{mathdesign} \usepackage[garamond]{mathdesign} \fi %\usepackage{ebgaramond} %too light \iffalse %OK \usepackage{tgpagella} % text only \usepackage{mathpazo} % math & text \fi %\usepackage{unicode-math} %\setmainfont{STIX Two Text} %\setmathfont{STIX Two Math} %\usepackage{lmodern} \fi %HCODE %\usepackage[T1]{fontenc} %\usepackage[english]{babel} %\usepackage[p,osf]{newtxtext} %\usepackage[upint,smallerops,varg,varvw]{newtxmath} %\usepackage[T1]{fontenc} %\usepackage{mathpazo,mathabx} %\usepackage{lmodern} %\usepackage[math]{anttor} %not good %\usepackage[T1]{fontenc} %\usepackage[english]{babel} \iffalse \ifdefined\HCode \else \usepackage{fontspec} \setmainfont{Times New Roman} \usepackage{unicode-math} \setmainfont{Times New Roman} \setmathfont{TeX Gyre Termes Math} \fi \fi \iffalse \ifdefined\HCode \else %this looks nice %\usepackage[urw-garamond]{mathdesign} %\usepackage{garamondx} %\usepackage{bm} %\fi \usepackage[garamond]{mathdesign} \fi \fi %\ifdefined\HCode %\else % Asana %\usepackage[mathit=sym,bold-style=ISO]{unicode-math} %\setmainfont[Ligatures={Common,Rare,TeX}]{TeX Gyre Pagella} %\setmathfont[Scale=MatchUppercase]{Asana Math} %\fi %\input{my_font} %this worked. see https://tex.stackexchange.com/questions/639226/use-computer-modern-font-in-lualatex %\usepackage{fontspec} %\setmainfont{NewCM10-Book} %try this. 5/3/2022 %asked about it at https://tex.stackexchange.com/questions/642816/how-to-make-text-boldness-match-math-when-using-lualatex-with-mlmodern-package \ifdefined\HCode \else \usepackage[T1]{fontenc} \usepackage{mlmodern} %see https://tex.stackexchange.com/questions/646333/size-of-integral-symbol-in-section-header-with-mlmodern \DeclareSymbolFont{largesymbols}{OMX}{cmex}{m}{n} \fi \iffalse %added these in 3/32/2021. this to fix problem with math in section headers \input{fix_links} \AtBeginDocument{\texorpdfOn}% % Activate the Lua function 'fix_headers' \fi %added this here so I do nothave to add it each time May 13,2021 \input{math_operators} %added 3/13/2022 moving to it. Away from verbatime write and javascript stuff %\usepackage{minted} %\ifdefined\HCode %\newminted[smallMintedText]{Text}{fontsize=\small} %\fi %added to make sure all log messages go to terminal as well. %\tracingonline=0 %\usepackage{trace} %added march 21, 2022 %\usepackage{courier} %addd march 29, 2022 %see https://tex.stackexchange.com/questions/314783/how-to-force-vertical-space-in-tex4ht-bigskip-and-vspace-have-no-effect/314854 \usepackage{myspaces} %see https://tex.stackexchange.com/questions/436063/spacing-between-number-and-text-in-toc \iffalse \ifdefined\HCode \else \usepackage{tocloft} \advance\cftsecnumwidth 1em\relax \advance\cftsubsecindent 1em\relax \advance\cftsubsecnumwidth 1em\relax \fi \fi %added april 29, 2022 %commented out, since can;t control the boldness level. it becomes %too bold. %\usepackage{pdfrender} %\pdfrender{StrokeColor=black,TextRenderingMode=2,LineWidth=1pt} %%%%%%%%%%%%%%%%%%%%% %see https://tex.stackexchange.com/questions/653676/how-to-make-a-table-of-fixed-width-in-tex4ht-not-fixed-column-width %this adds support to fixed width tables. \newenvironment{fixedtabular}[2]{\gdef\tablewidth{#2}\begin{tabular}{#1}}{\end{tabular}} % %supporting code is added to my nma_mathjax.cfg also. Both are needed % %%%%%%%%%%%%%%%%% reduce space between y and () when using \left( and \right) %https://tex.stackexchange.com/questions/654390/is-there-a-way-in-preamble-to-modify-reduce-the-white-space-between-letter-follo %added 8/18/2022 \Umathordinnerspacing\textstyle=0mu \Umathordinnerspacing\displaystyle=0mu %see https://tex.stackexchange.com/questions/12703/how-to-create-fixed-width-table-columns-with-text-raggedright-centered-raggedlef %use it in table as L{3in}|L{2in}| etc.. will make columns ragged right, which reads better \newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}p{#1}}