diff --git a/.github/workflows/build_latex.yml b/.github/workflows/build_latex.yml new file mode 100644 index 0000000..b8556a6 --- /dev/null +++ b/.github/workflows/build_latex.yml @@ -0,0 +1,12 @@ +name: Build LaTeX document +on: [push] +jobs: + build_latex: + runs-on: ubuntu-latest + steps: + - name: Set up Git repository + uses: actions/checkout@v2 + - name: Install latex + run: sudo apt-get install -y texlive texlive-xetex texlive-fonts-extra latexmk + - name: Compile LaTeX document + run: latexmk -xelatex FieldGuide.tex diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml new file mode 100644 index 0000000..87e824f --- /dev/null +++ b/.github/workflows/create_release.yml @@ -0,0 +1,39 @@ +on: + push: + # Sequence of patterns matched against refs/tags + tags: + - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 + +name: Create Release + +jobs: + build: + name: Create Release + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Install latex + run: sudo apt-get install -y texlive texlive-xetex texlive-fonts-extra latexmk + - name: Compile LaTeX document + run: latexmk -xelatex FieldGuide.tex + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + asset_path: ./FieldGuide.pdf + asset_name: FieldGuide.pdf + asset_content_type: application/pdf \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index d2f173d..835d1b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,17 @@ # Changelog -## [1.0.1] - 2021-01-18 + +## v1.0.2 (2021-01-21) +- Added an Oxford comma +- Added font resources + + + +## v1.0.1 (2021-01-18) ### Fixed - Made non-central consistently noncentral -- Fixed LogLogistic relation to GenBetaPrime Kudos: Robert Calvert Jump +- Fixed LogLogistic relation to GenBetaPrime. Kudos: Robert Calvert Jump - Added changelog - Updated urls, http -> https - Fix inconsistent use of scale and location in ch 17 (#2) Kudos: Albert Alex Zevelev @@ -18,5 +25,5 @@ -## [1.0.0] - 2019-04-01 +## v1.0.0 (2019-04-01) First print edition. For version history see Acknowledgments (page 4). diff --git a/ChAcknowledgments.tex b/ChAcknowledgments.tex index b1840c1..3988ee3 100644 --- a/ChAcknowledgments.tex +++ b/ChAcknowledgments.tex @@ -145,7 +145,7 @@ 0.5 (2013-07-01) -Added uniform product, half generalized Pearson VII, half exponential power, GUD and q-type distributions. +Added uniform product, half generalized Pearson VII, half exponential power, GUD, and q-type distributions. Moved Pearson IV to own section. Fixed errors in inverse Gaussian. Added random variate generation to appendix. diff --git a/FieldGuide.cls b/FieldGuide.cls index 715c048..ab007b4 100644 --- a/FieldGuide.cls +++ b/FieldGuide.cls @@ -9,12 +9,12 @@ % ========== Process options ========== -\RequirePackage{etoolbox} % Prefer over ifthen +\RequirePackage{etoolbox} % Prefer over ifthen \RequirePackage{ifdraft} \newtoggle{formatArticle} \newtoggle{formatBook} -\newtoggle{formatNotes} % For book preview notes +\newtoggle{formatNotes} % For book preview notes \newtoggle{pagebackrefFlag} \newtoggle{annotateFlag} \newtoggle{stretchFlag} @@ -30,8 +30,9 @@ \DeclareOption{pagebackref}{\toggletrue{pagebackrefFlag}} \DeclareOption{annotate}{\toggletrue{annotateFlag}} \DeclareOption{monochrome}{\toggletrue{monochrome}} -\DeclareOption{nomacros}{\togglefalse{macros}} % Prevent automatic loading of macro package +\DeclareOption{nomacros}{\togglefalse{macros}} % Prevent automatic loading of macro package \DeclareOption{mediaeval}{\toggletrue{mediaeval}} % Trump Mediaeval font +\DeclareOption{nomediaeval}{\togglefalse{mediaeval}} % Trump Mediaeval font \DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}} @@ -43,76 +44,76 @@ % Book format. \iftoggle{formatBook}{ - \LoadClass[10pt]{article} % May not need twoside option here if it's in geometry. t - % woside article option + geometry package seem to generate many underfull vboxes for no obvious reason. - \RequirePackage[ - paperwidth=6in,paperheight=9in, - %paperwidth=156mm,paperheight=234mm, - textheight=7in, - textwidth=4.5in, -% footskip=27pt, headsep=15pt, headheight=12pt, - footskip=36pt, headsep=24pt, headheight=18pt, - centering, - twoside=true - ]{geometry} - \pdfpagewidth=6in - \pdfpageheight=9in - - -% \LoadClass[10pt]{article} % May not need twoside option here if it's in geometry. t -% % woside article option + geometry package seem to generate many underfull vboxes for no obvious reason. -% \RequirePackage[ -% paperwidth=7in,paperheight=10in, -% textheight=8in, -% textwidth=5in, -%% footskip=27pt, headsep=15pt, headheight=12pt, -% footskip=36pt, headsep=24pt, headheight=18pt, -% centering, -% twoside=true -% ]{geometry} -% \pdfpagewidth=7in -% \pdfpageheight=10in + \LoadClass[10pt]{article} % May not need twoside option here if it's in geometry. + % twoside article option + geometry package seem to generate many underfull vboxes for no obvious reason. + \RequirePackage[ + paperwidth=6in,paperheight=9in, + %paperwidth=156mm,paperheight=234mm, + textheight=7in, + textwidth=4.5in, +% footskip=27pt, headsep=15pt, headheight=12pt, + footskip=36pt, headsep=24pt, headheight=18pt, + centering, + twoside=true + ]{geometry} + \pdfpagewidth=6in + \pdfpageheight=9in + + +% \LoadClass[10pt]{article} % May not need twoside option here if it's in geometry. t +% % woside article option + geometry package seem to generate many underfull vboxes for no obvious reason. +% \RequirePackage[ +% paperwidth=7in,paperheight=10in, +% textheight=8in, +% textwidth=5in, +%% footskip=27pt, headsep=15pt, headheight=12pt, +% footskip=36pt, headsep=24pt, headheight=18pt, +% centering, +% twoside=true +% ]{geometry} +% \pdfpagewidth=7in +% \pdfpageheight=10in % A5 page size compromise between book 3x9in, and ipad 3:4 aspect ratio. -% \RequirePackage[a5paper, -% textheight=6.5in, -% textwidth=4.5in, % aspect ratio sqrt(2) -% footskip=36pt, -% headsep=18pt, -% headheight=18pt, -% centering]{geometry} -% \pdfpagewidth=5.83in -% \pdfpageheight=8.26in - - - % According to Lulu publishing, last page of a book should be completely blank. - % Also make sure even number of pages - \AtEndDocument{\clearpage\thispagestyle{empty}~\ifodd\value{page}\clearpage\thispagestyle{empty}~\fi} - \toggletrue{stretchFlag} - \toggletrue{bookHeader} +% \RequirePackage[a5paper, +% textheight=6.5in, +% textwidth=4.5in, % aspect ratio sqrt(2) +% footskip=36pt, +% headsep=18pt, +% headheight=18pt, +% centering]{geometry} +% \pdfpagewidth=5.83in +% \pdfpageheight=8.26in + + + % According to Lulu publishing, last page of a book should be completely blank. + % Also make sure even number of pages + \AtEndDocument{\clearpage\thispagestyle{empty}~\ifodd\value{page}\clearpage\thispagestyle{empty}~\fi} + \toggletrue{stretchFlag} + \toggletrue{bookHeader} } \iftoggle{formatNotes}{ - \LoadClass[10pt]{article} - \RequirePackage[paperwidth=8.5in,paperheight=11in, textheight=9.5in, textwidth=4.5in, % - top=2.5cm, bottom=2.5cm, - %footskip=36pt, headsep=24pt, headheight=18pt, - centering]{geometry} - \pdfpagewidth=8.5in - \pdfpageheight=11in - \toggletrue{stretchFlag} - \toggletrue{bookHeader} + \LoadClass[10pt]{article} + \RequirePackage[paperwidth=8.5in,paperheight=11in, textheight=9.5in, textwidth=4.5in, % + top=2.5cm, bottom=2.5cm, + %footskip=36pt, headsep=24pt, headheight=18pt, + centering]{geometry} + \pdfpagewidth=8.5in + \pdfpageheight=11in + \toggletrue{stretchFlag} + \toggletrue{bookHeader} } \iftoggle{formatArticle}{ - % Article format - \LoadClass[twocolumn,twoside,10pt,letterpage]{article} - \setlength{\columnsep}{0.5cm} - \RequirePackage[paperwidth=8.5in,paperheight=11in, right=1.75cm, left=1.75cm, % - top=2cm, bottom=2cm, centering]{geometry} + % Article format + \LoadClass[twocolumn,twoside,10pt,letterpage]{article} + \setlength{\columnsep}{0.5cm} + \RequirePackage[paperwidth=8.5in,paperheight=11in, right=1.75cm, left=1.75cm, % + top=2cm, bottom=2cm, centering]{geometry} } @@ -123,25 +124,23 @@ % ========== FONTS ========== \RequirePackage{setspace} -\iftoggle{stretchFlag}{ +\iftoggle{stretchFlag}{ % Book \newcommand{\normalstretch}{\setstretch{1.1}} - \newcommand{\tightstretch}{\setstretch{1.0}} + \newcommand{\tightstretch}{\setstretch{1.0}} \normalstretch } { % Article \newcommand{\normalstretch}{\setstretch{1.0}} - \newcommand{\tightstretch}{\setstretch{0.9}} % Test + \newcommand{\tightstretch}{\setstretch{0.9}} % Test \normalstretch } -% TODO: Clean up. Toggle not needed +% TODO: Clean up. Toggle not used \iftoggle{mediaeval}{ % Trump Mediaeval font looks better with extra line spacing - %TODO: But do these actually get used anywhere? - \RequirePackage{fontspec} \RequirePackage[OT1]{fontenc} @@ -151,16 +150,19 @@ \RequirePackage{amsthm,amsmath} \RequirePackage{amssymb} - % Check to see if this font is installed system-wide - \IfFontExistsTF{Trump Mediaeval LT Std}{% - % Need bold font - \setromanfont[Mapping=tex-text, Scale=0.95,AutoFakeSlant]{Trump Mediaeval LT Std} + % Check to see if this font is installed + \IfFontExistsTF{TrumpMediaevalLTStd-Roman.otf}{% + + \setromanfont{TrumpMediaevalLTStd-Roman.otf}[ + Mapping=tex-text, + Scale=0.95, + BoldFont=TrumpMediaevalLTStd-Bold.otf, + AutoFakeSlant] + % Diacritics=Decompose not supported for this font - % Hack: accent \=a needed for Sankhya, not working with this font. Using $\bar{\text{a}}$ instead. + % Hack: accent \=a needed for Sankhya, not working with this font. Using $\bar{\text{a}}$ instead. % FIXME: ALSO Birkh\:{a}user broken - % TODO: Change scale to 0.95? - % Fix various accents that don't appear in this font. \DeclareTextAccent{\`}{EU1}{"0060} %grave \DeclareTextAccent{\'}{EU1}{180} %acute @@ -182,11 +184,9 @@ % ACCENT TEST STRING % \`{a}\'{a}\^{a}\~{a}\"{a}\H{a}\r{a}\v{a}\u{a}\={a}\.{a} - % French spacing uses the same space as used between words. - % English spacing uses an en-space (half an em-space). - %\frenchspacing } { + % Fallback font \RequirePackage{charter} } @@ -203,44 +203,41 @@ % To DO : Sort?\ RequirePackage[square,comma, numbers, sort]{natbib} \RequirePackage[square,comma, numbers, sort&compress]{natbib} +% ========== Citation and Bibliography format ========== \iftoggle{pagebackrefFlag}{ - - % ========== Citation and Bibliography format ========== - % = Page back refs. = - % Do not compress when using pagebackref's - \RequirePackage[square,comma, numbers]{natbib} - \bibliographystyle{gecbib} - - \RequirePackage[ - pagebackref, - breaklinks - %unicode - ]{hyperref} - \hypersetup{ - colorlinks=true, - urlcolor= MidnightBlue, - linkcolor= MidnightBlue, - citecolor= MidnightBlue - } - \renewcommand*{\backrefalt}[4]{% - \ifcase #1 % - No citations.% use \relax if you do not want the "No citations" message - \or - (page #4).% - \else - (pages #4).% - \fi% - } -} { - % ========== Citation and Bibliography format ========== - % = No Page back refs. = - - \RequirePackage[square,comma, numbers,compress]{natbib} - \bibliographystyle{gecbib} - - \RequirePackage[breaklinks]{hyperref} - \hypersetup{colorlinks=true, urlcolor= MidnightBlue, - linkcolor= MidnightBlue, citecolor= MidnightBlue} + % Page back refs. + % Do not compress when using pagebackref's + \RequirePackage[square,comma, numbers]{natbib} + \bibliographystyle{gecbib} + + \RequirePackage[ + pagebackref, + breaklinks + %unicode + ]{hyperref} + \hypersetup{ + colorlinks=true, + urlcolor= MidnightBlue, + linkcolor= MidnightBlue, + citecolor= MidnightBlue + } + \renewcommand*{\backrefalt}[4]{% + \ifcase #1 % + No citations.% use \relax if you do not want the "No citations" message + \or + (page #4).% + \else + (pages #4).% + \fi% + } +} { + % No Page back refs. + \RequirePackage[square,comma, numbers,compress]{natbib} + \bibliographystyle{gecbib} + + \RequirePackage[breaklinks]{hyperref} + \hypersetup{colorlinks=true, urlcolor= MidnightBlue, + linkcolor= MidnightBlue, citecolor= MidnightBlue} } %FI % FIXME, does this work? @@ -260,43 +257,43 @@ % \iffloatpage macro doesn't seem to work. (I think it used to?) \fancypagestyle{plain}{ - \renewcommand{\headrulewidth}{0pt} - \renewcommand{\footrulewidth}{0pt} - \fancyhead{} - \fancyfoot{} - - \iftoggle{bookHeader} { - \iffloatpage{ - \fancyhead[C]{} - \fancyfoot[C]{\small \scshape \titlemark} - } { - \fancyhead[C]{\nouppercase{\scshape\leftmark}} - \fancyfoot[C]{\small \scshape \titlemark } - } - - \fancyfoot[OR]{\small \thepage} - \fancyfoot[EL]{\small \thepage} - }{ - \fancyhead[C]{\small \scshape \titlemark } - \fancyfoot[C]{\small \thepage} - } + \renewcommand{\headrulewidth}{0pt} + \renewcommand{\footrulewidth}{0pt} + \fancyhead{} + \fancyfoot{} + + \iftoggle{bookHeader} { + \iffloatpage{ + \fancyhead[C]{} + \fancyfoot[C]{\small \scshape \titlemark} + } { + \fancyhead[C]{\nouppercase{\scshape\leftmark}} + \fancyfoot[C]{\small \scshape \titlemark } + } + + \fancyfoot[OR]{\small \thepage} + \fancyfoot[EL]{\small \thepage} + }{ + \fancyhead[C]{\small \scshape \titlemark } + \fancyfoot[C]{\small \thepage} + } } \fancypagestyle{chapter}{ - \renewcommand{\headrulewidth}{0pt} - \renewcommand{\footrulewidth}{0pt} - \fancyhead{} - \fancyfoot{} - - \iftoggle{bookHeader} { -% \fancyfoot[C]{\small \itshape \titlemark } - \fancyhead[C]{\small \scshape \titlemark} - \fancyfoot[OR]{\small \thepage} - \fancyfoot[EL]{\small \thepage} - } { - \fancyhead[C]{\small \scshape \titlemark} - \fancyfoot[C]{\small \thepage} - } + \renewcommand{\headrulewidth}{0pt} + \renewcommand{\footrulewidth}{0pt} + \fancyhead{} + \fancyfoot{} + + \iftoggle{bookHeader} { +% \fancyfoot[C]{\small \itshape \titlemark } + \fancyhead[C]{\small \scshape \titlemark} + \fancyfoot[OR]{\small \thepage} + \fancyfoot[EL]{\small \thepage} + } { + \fancyhead[C]{\small \scshape \titlemark} + \fancyfoot[C]{\small \thepage} + } } \pagestyle{plain} @@ -326,24 +323,24 @@ \begin{tabular}[t]{c}% \@author \end{tabular}\par}% - + \vskip 1em% {\large \@date}% \vskip 1em% - \@ifundefined{bespoke@abstract}{} { - {\large \bfseries \vspace{-8pt}}\par - \begin{quote}\noindent \bespoke@abstract \end{quote} - } - + \@ifundefined{bespoke@abstract}{} { + {\large \bfseries \vspace{-8pt}}\par + \begin{quote}\noindent \bespoke@abstract \end{quote} + } + \end{center}% \par \vskip 1.5em% %\hypersetup{ -% pdfauthor={\@author}, -% pdftitle={\@title}, -% pdfpagemode=UseOutlines +% pdfauthor={\@author}, +% pdftitle={\@title}, +% pdfpagemode=UseOutlines %} } @@ -353,13 +350,13 @@ \usepackage{sectsty} \iftoggle{monochrome}{ - \hypersetup{colorlinks=false} - \def\titlecolor{Black} - }{ - \def\titlecolor{BrickRed} - \sectionfont{\color{\titlecolor}} - \subsectionfont{\color{\titlecolor}} - \paragraphfont{\color{\titlecolor}} + \hypersetup{colorlinks=false} + \def\titlecolor{Black} + }{ + \def\titlecolor{BrickRed} + \sectionfont{\color{\titlecolor}} + \subsectionfont{\color{\titlecolor}} + \paragraphfont{\color{\titlecolor}} } % ========== Index ========== diff --git a/FieldGuide.pdf b/FieldGuide.pdf deleted file mode 100644 index 55943c9..0000000 Binary files a/FieldGuide.pdf and /dev/null differ diff --git a/FieldGuide.tex b/FieldGuide.tex index 7f868a0..896d953 100644 --- a/FieldGuide.tex +++ b/FieldGuide.tex @@ -124,7 +124,7 @@ \renewcommand{\@pnumwidth}{1.75em} % Enough room for triple digit page numbers \makeatother -\newcommand{\version}{v~1.0.1} +\newcommand{\version}{v~1.0.2} \renewcommand{\titlemark}{G.~E.~Crooks -- Field Guide to Probability Distributions} \renewcommand{\sectionmark}[1]{\markboth{{\thesection~~#1}}{}} @@ -176,7 +176,7 @@ \author{{\Large Gavin E. Crooks}} -\date{\vspace{1em}~{\version}~\\ ~\\ ~{\number\year}~\\ \vspace{3em}\includegraphics[scale=1.25]{pdfCauchyNB}} +\date{\vspace{1em}~{\version}~\\ ~\\ \vspace{3em}\includegraphics[scale=1.25]{pdfCauchyNB}} %\date{\vspace{1em}~{}~\\ ~\\ ~{}~\\ \vspace{3em}\includegraphics[scale=1.25]{pdfCauchyNB}} %\date{\vspace{1em}\version\\ ~\\ \number\year} \maketitle diff --git a/TrumpMediaevalLTStd-Bold.otf b/TrumpMediaevalLTStd-Bold.otf new file mode 100644 index 0000000..f1ff96a Binary files /dev/null and b/TrumpMediaevalLTStd-Bold.otf differ diff --git a/TrumpMediaevalLTStd-Roman.otf b/TrumpMediaevalLTStd-Roman.otf new file mode 100644 index 0000000..6de79ef Binary files /dev/null and b/TrumpMediaevalLTStd-Roman.otf differ