diff --git a/NOAA-quarto-book.tex b/NOAA-quarto-book.tex index 8b5385a..39e064b 100644 --- a/NOAA-quarto-book.tex +++ b/NOAA-quarto-book.tex @@ -8,7 +8,6 @@ open=any]{scrbook} \usepackage{amsmath,amssymb} -\usepackage{lmodern} \usepackage{iftex} \ifPDFTeX \usepackage[T1]{fontenc} @@ -19,6 +18,10 @@ \defaultfontfeatures{Scale=MatchLowercase} \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1} \fi +\usepackage{lmodern} +\ifPDFTeX\else + % xetex/luatex font selection +\fi % Use upquote if available, for straight quotes in verbatim environments \IfFileExists{upquote.sty}{\usepackage{upquote}}{} \IfFileExists{microtype.sty}{% use microtype if available @@ -112,35 +115,43 @@ \makeatletter \def\fps@figure{htbp} \makeatother +% definitions for citeproc citations +\NewDocumentCommand\citeproctext{}{} +\NewDocumentCommand\citeproc{mm}{% + \begingroup\def\citeproctext{#2}\cite{#1}\endgroup} +\makeatletter + % allow citations to break across lines + \let\@cite@ofmt\@firstofone + % avoid brackets around text for \cite: + \def\@biblabel#1{} + \def\@cite#1#2{{#1\if@tempswa , #2\fi}} +\makeatother \newlength{\cslhangindent} \setlength{\cslhangindent}{1.5em} \newlength{\csllabelwidth} \setlength{\csllabelwidth}{3em} -\newlength{\cslentryspacingunit} % times entry-spacing -\setlength{\cslentryspacingunit}{\parskip} -\newenvironment{CSLReferences}[2] % #1 hanging-ident, #2 entry spacing - {% don't indent paragraphs - \setlength{\parindent}{0pt} +\newenvironment{CSLReferences}[2] % #1 hanging-indent, #2 entry-spacing + {\begin{list}{}{% + \setlength{\itemindent}{0pt} + \setlength{\leftmargin}{0pt} + \setlength{\parsep}{0pt} % turn on hanging indent if param 1 is 1 \ifodd #1 - \let\oldpar\par - \def\par{\hangindent=\cslhangindent\oldpar} + \setlength{\leftmargin}{\cslhangindent} + \setlength{\itemindent}{-1\cslhangindent} \fi % set entry spacing - \setlength{\parskip}{#2\cslentryspacingunit} - }% - {} + \setlength{\itemsep}{#2\baselineskip}}} + {\end{list}} \usepackage{calc} -\newcommand{\CSLBlock}[1]{#1\hfill\break} -\newcommand{\CSLLeftMargin}[1]{\parbox[t]{\csllabelwidth}{#1}} -\newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{#1}\break} +\newcommand{\CSLBlock}[1]{\hfill\break#1\hfill\break} +\newcommand{\CSLLeftMargin}[1]{\parbox[t]{\csllabelwidth}{\strut#1\strut}} +\newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{\strut#1\strut}} \newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1} \usepackage[default]{opensans} \fontseries{lc}\selectfont \makeatletter -\makeatother -\makeatletter \@ifpackageloaded{bookmark}{}{\usepackage{bookmark}} \makeatother \makeatletter @@ -179,16 +190,10 @@ \newcommand*\listoflistings{\listof{codelisting}{List of Listings}} \makeatother \makeatletter -\@ifpackageloaded{caption}{}{\usepackage{caption}} -\@ifpackageloaded{subcaption}{}{\usepackage{subcaption}} -\makeatother -\makeatletter -\@ifpackageloaded{tcolorbox}{}{\usepackage[many]{tcolorbox}} -\makeatother -\makeatletter -\@ifundefined{shadecolor}{\definecolor{shadecolor}{rgb}{.97, .97, .97}} \makeatother \makeatletter +\@ifpackageloaded{caption}{}{\usepackage{caption}} +\@ifpackageloaded{subcaption}{}{\usepackage{subcaption}} \makeatother \usepackage{hyphenat} @@ -210,7 +215,6 @@ \usepackage[pagecolor=none]{pagecolor} - % Set the titlepage font families @@ -221,10 +225,6 @@ % Set the coverpage font families - - - - \ifLuaTeX \usepackage{selnolig} % disable illegal ligatures \fi @@ -272,8 +272,7 @@ \newcommand{\titlelocationbottom}{7in} \newcommand{\titlealign}{left} -\begin{scope} -{% +\begin{scope}{% \fontsize{30}{36.0}\selectfont \node[anchor=north west, align=left, rotate=0] (Title1) at ($(current page.south west)+(\titlelocationleft,\titlelocationbottom)$) [text width = 5in] {\textcolor{black}{\bfseries{\nohyphens{NOAA @@ -327,6 +326,20 @@ } \end{scope} +% Date +\newcommand{\datelocationleft}{6in} +\newcommand{\datelocationbottom}{2in} +\newcommand{\datelocationalign}{left} + +\begin{scope} +{% +\fontsize{20}{24.0}\selectfont + \node[anchor=north west, align=left, rotate=0] (Date1) at % +($(current page.south west)+(\datelocationleft,\datelocationbottom)$) [text width = 2.5in] {{\nohyphens{January +2023}}}; +} +\end{scope} + \end{tikzpicture} \clearpage \restoregeometry @@ -364,25 +377,23 @@ \newcommand{\affiliationstyle}[1]{{#1}} \newcommand{\titlepageauthorblock}{ -\authorstyle{Jane Doe{\textsuperscript{1}}, Eva -Nováková{\textsuperscript{2}} and Matti -Meikäläinen{\textsuperscript{3}}% - -}} +{\authorstyle{\nohyphens{Jane Doe}{\textsuperscript{1}}, \nohyphens{Eva +Nováková}{\textsuperscript{2}} and \nohyphens{Matti +Meikäläinen}{\textsuperscript{3}}}}} \newcommand{\titlepageaffiliationblock}{ \hangindent=1em \hangafter=1 -\affiliationstyle{ -{1}.~NOAA Fisheres, Northwest Fisheries Science Center -\par\hangindent=1em\hangafter=1% -{2}.~NOAA Fisheries, West Coast Regional Office -\par\hangindent=1em\hangafter=1% -{3}.~NOAA Fisheries, Southwest Fisheries Science Center +{\affiliationstyle{ +{1}.~NOAA Fisheres,~Northwest Fisheries Science Center +\par\hangindent=1em\hangafter=1{2}.~NOAA Fisheries,~West Coast Regional +Office +\par\hangindent=1em\hangafter=1{3}.~NOAA Fisheries,~Southwest Fisheries +Science Center \vspace{1\baselineskip} -} +}} } \newcommand{\headerstyled}{% {} @@ -490,8 +501,7 @@ \setcounter{page}{1} \end{frontmatter} -%%%%% end titlepage extension code\ifdefined\Shaded\renewenvironment{Shaded}{\begin{tcolorbox}[borderline west={3pt}{0pt}{shadecolor}, sharp corners, boxrule=0pt, enhanced, breakable, frame hidden, interior hidden]}{\end{tcolorbox}}\fi - +%%%%% end titlepage extension code \renewcommand*\contentsname{Table of contents} { \setcounter{tocdepth}{1} @@ -502,8 +512,7 @@ \mainmatter \bookmarksetup{startatroot} -\hypertarget{executive-summary}{% -\chapter*{Executive Summary}\label{executive-summary}} +\chapter*{Executive Summary}\label{executive-summary} \addcontentsline{toc}{chapter}{Executive Summary} \markboth{Executive Summary}{Executive Summary} @@ -524,8 +533,7 @@ \chapter*{Executive Summary}\label{executive-summary}} \bookmarksetup{startatroot} -\hypertarget{set-up}{% -\chapter{Set-up}\label{set-up}} +\chapter{Set-up}\label{set-up} This is a template for a simple Quarto book output to html, PDF or docx format. It includes a GitHub Action that will build the website @@ -539,6 +547,8 @@ \chapter{Set-up}\label{set-up}} files. Note, you do not need to make changes to your Rmd files unless your need Quarto features like cross-references. +\section{GitHub Set-up}\label{github-set-up} + \begin{itemize} \item Click the green ``use template'' button to make a repository with this @@ -561,8 +571,9 @@ \chapter{Set-up}\label{set-up}} \bookmarksetup{startatroot} -\hypertarget{customize}{% -\chapter{Customize}\label{customize}} +\chapter{Customize}\label{customize} + +\section{Edit and add your pages}\label{edit-and-add-your-pages} Edit the qmd or md files in the \texttt{content} folder. qmd files can include code (R, Python, Julia) and lots of Quarto markdown bells and @@ -591,8 +602,7 @@ \chapter{Customize}\label{customize}} it makes it easy for Quarto convert your qmd file to other formats (like into a presentation). -\hypertarget{add-your-pages-the-project}{% -\section{Add your pages the project}\label{add-your-pages-the-project}} +\section{Add your pages the project}\label{add-your-pages-the-project} \begin{itemize} \tightlist @@ -602,15 +612,15 @@ \section{Add your pages the project}\label{add-your-pages-the-project}} \bookmarksetup{startatroot} -\hypertarget{customization}{% -\chapter{Customization}\label{customization}} +\chapter{Customization}\label{customization} + +\section{Quarto documentation}\label{quarto-documentation} Quarto allow many bells and whistles to make nice output. Read the documentation here \href{https://quarto.org/docs/guide/}{Quarto documentation}. -\hypertarget{examples}{% -\section{Examples}\label{examples}} +\section{Examples}\label{examples} Looking at other people's Quarto code is a great way to figure out how to do stuff. Most will have a link to a GitHub repo where you can see @@ -633,8 +643,7 @@ \section{Examples}\label{examples}} \bookmarksetup{startatroot} -\hypertarget{rendering}{% -\chapter{Rendering}\label{rendering}} +\chapter{Rendering}\label{rendering} The repo includes a GitHub Action that will render (build) the website automatically when you make changes to the files. It will be pushed to @@ -643,22 +652,23 @@ \chapter{Rendering}\label{rendering}} But when you are developing your content, you will want to render it locally. +\section{Step 1. Make sure you have a recent +RStudio}\label{step-1.-make-sure-you-have-a-recent-rstudio} + Have you updated RStudio since about August 2022? No? Then update to a newer version of RStudio. In general, you want to keep RStudio updated and it is required to have a recent version to use Quarto. -\hypertarget{step-2.-clone-and-create-rstudio-project}{% \section{Step 2. Clone and create RStudio -project}\label{step-2.-clone-and-create-rstudio-project}} +project}\label{step-2.-clone-and-create-rstudio-project} First, clone the repo onto your local computer. How? You can click File \textgreater{} New Project and then select ``Version Control''. Paste in the url of the repository. That will clone the repo on to your local computer. When you make changes, you will need to push those up. -\hypertarget{step-3.-render-within-rstudio}{% \section{Step 3. Render within -RStudio}\label{step-3.-render-within-rstudio}} +RStudio}\label{step-3.-render-within-rstudio} RStudio will recognize that this is a Quarto project by the presence of the \texttt{\_quarto.yml} file and will see the ``Build'' tab. Click the @@ -672,11 +682,12 @@ \section{Step 3. Render within \bookmarksetup{startatroot} -\hypertarget{r-markdown}{% -\chapter{R Markdown}\label{r-markdown}} +\chapter{R Markdown}\label{r-markdown} You can include R Markdown files in your project. +\section{R Markdown}\label{r-markdown-1} + This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see \url{http://rmarkdown.rstudio.com}. @@ -701,20 +712,67 @@ \chapter{R Markdown}\label{r-markdown}} Max. :25.0 Max. :120.00 \end{verbatim} -\hypertarget{including-plots}{% -\section{Including Plots}\label{including-plots}} +\section{Including Plots}\label{including-plots} -You can also embed plots, for example: +You can also embed plots and reference them, like so +Figure~\ref{fig-pressure}. -\includegraphics{content/rmarkdown_files/figure-pdf/pressure-1.pdf} +\begin{figure} + +\centering{ + +\includegraphics{content/rmarkdown_files/figure-pdf/fig-pressure-1.pdf} + +} + +\caption{\label{fig-pressure}Plot of pressure} + +\end{figure}% Note that the \texttt{echo\ =\ FALSE} parameter was added to the code chunk to prevent printing of the R code that generated the plot. +\section{Including Tables}\label{including-tables} + +You can also embed tables and reference them with Table~\ref{tbl-iris}. + +\begin{Shaded} +\begin{Highlighting}[] +\FunctionTok{library}\NormalTok{(knitr)} +\FunctionTok{kable}\NormalTok{(}\FunctionTok{head}\NormalTok{(iris))} +\end{Highlighting} +\end{Shaded} + +\begin{table} + +\caption{\label{tbl-iris}Iris Data} + +\centering{ + +\begin{longtable}[]{@{}rrrrl@{}} +\toprule\noalign{} +Sepal.Length & Sepal.Width & Petal.Length & Petal.Width & Species \\ +\midrule\noalign{} +\endhead +\bottomrule\noalign{} +\endlastfoot +5.1 & 3.5 & 1.4 & 0.2 & setosa \\ +4.9 & 3.0 & 1.4 & 0.2 & setosa \\ +4.7 & 3.2 & 1.3 & 0.2 & setosa \\ +4.6 & 3.1 & 1.5 & 0.2 & setosa \\ +5.0 & 3.6 & 1.4 & 0.2 & setosa \\ +5.4 & 3.9 & 1.7 & 0.4 & setosa \\ +\end{longtable} + +\addtocounter{table}{-1} + +} + +\end{table}% + \bookmarksetup{startatroot} -\hypertarget{rendering-with-code}{% -\chapter{Rendering with Code}\label{rendering-with-code}} +\chapter{Rendering with Code}\label{rendering-with-code} You can have code (R, Python or Julia) in your qmd file. You will need to have these installed on your local computer, but presumably you do @@ -738,6 +796,8 @@ \chapter{Rendering with Code}\label{rendering-with-code}} 1.056 1.326 \end{verbatim} +\section{Modify the GitHub Action}\label{modify-the-github-action} + You will need to change the GitHub Action in \texttt{.github/workflows} to install these and any needed packages in order for GitHub to be able to render your webpage. The GitHub Action install R since I used that in @@ -757,9 +817,8 @@ \chapter{Rendering with Code}\label{rendering-with-code}} don't do this, but if you are not using the action (because it keeps failing), then you don't need GitHub to run it. -\hypertarget{render-locally-and-publish-to-gh-pages-branch}{% \section{Render locally and publish to gh-pages -branch}\label{render-locally-and-publish-to-gh-pages-branch}} +branch}\label{render-locally-and-publish-to-gh-pages-branch} To render locally and push up to the \texttt{gh-pages} branch, open a terminal window and then \texttt{cd} to the directory with the Quarto @@ -771,8 +830,7 @@ \section{Render locally and publish to gh-pages \bookmarksetup{startatroot} -\hypertarget{references}{% -\chapter{References}\label{references}} +\chapter{References}\label{references} Quarto has powerful references functionality. You can easily insert citations from Zotero libraries that you maintain in the cloud (on @@ -803,15 +861,14 @@ \chapter{References}\label{references}} \bookmarksetup{startatroot} -\hypertarget{references-1}{% -\chapter*{References}\label{references-1}} +\chapter*{References}\label{references-1} \addcontentsline{toc}{chapter}{References} \markboth{References}{References} -\hypertarget{refs}{} +\phantomsection\label{refs} \begin{CSLReferences}{1}{0} -\leavevmode\vadjust pre{\hypertarget{ref-ansley1981}{}}% +\bibitem[\citeproctext]{ref-ansley1981} Ansley, H. L. H., and C. D. Davis. 1981. {``Migration and Standing Stock of Fishes Associated with Artificial and Natural Reefs on Georgia{'}s Outer Continental Shelf.''} Brunswick, Georgia, USA. diff --git a/QTDublinIrish.otf b/QTDublinIrish.otf new file mode 100755 index 0000000..6067986 Binary files /dev/null and b/QTDublinIrish.otf differ diff --git a/_extensions/nmfs-opensci/titlepage/_author-affiliation-themes.tex b/_extensions/nmfs-opensci/titlepage/_author-affiliation-themes.tex index 8f150b0..1602ea2 100644 --- a/_extensions/nmfs-opensci/titlepage/_author-affiliation-themes.tex +++ b/_extensions/nmfs-opensci/titlepage/_author-affiliation-themes.tex @@ -13,64 +13,64 @@ $endif$ $if(titlepage-style-code.author.plain)$ \newcommand{\titlepageauthorblock}{ -\authorstyle{$for(by-author)$$by-author.name.literal$$sep$$titlepage-theme.author-sep$$endfor$\\} +$if(titlepage-theme.author-color)$\textcolor{$titlepage-theme.author-color$}$endif${\authorstyle{$for(by-author)$\nohyphens{$by-author.name.literal$}$sep$$titlepage-theme.author-sep$$if(titlepage-theme.author-space-between)$~\\ \vspace{$titlepage-theme.author-space-between$}$endif$$endfor$\\}} } $endif$ $if(titlepage-style-code.author.plain-with-and)$ \newcommand{\titlepageauthorblock}{ -\authorstyle{$if(by-author/allbutlast)$$for(by-author/allbutlast)$$by-author.name.literal$$sep$$titlepage-theme.author-sep$ $endfor$$for(by-author/last)$ and $by-author.name.literal$$endfor$$else$$for(by-author/last)$$by-author.name.literal$$endfor$$endif$} +$if(titlepage-theme.author-color)$\textcolor{$titlepage-theme.author-color$}$endif${\authorstyle{$if(by-author/allbutlast)$$for(by-author/allbutlast)$\nohyphens{$by-author.name.literal$}$sep$$titlepage-theme.author-sep$ $if(titlepage-theme.author-space-between)$~\\ \vspace{$titlepage-theme.author-space-between$}$endif$$endfor$$for(by-author/last)$ and \nohyphens{$by-author.name.literal$}$endfor$$else$$for(by-author/last)$\nohyphens{$by-author.name.literal$}$if(titlepage-theme.author-space-between)$~\\ \vspace{$titlepage-theme.author-space-between$}$endif$$endfor$$endif$}} } $endif$ $if(titlepage-style-code.author.superscript)$ \newcommand{\titlepageauthorblock}{ -\authorstyle{$for(by-author)$$by-author.name.literal$$for(by-author.affiliations)${\textsuperscript{$it.number$}}$sep${\textsuperscript{,}}$endfor$$if(by-author.email)$$if(by-author.affiliations)$\textsuperscript{,}$endif${\textsuperscript{*}}$endif$$sep$$titlepage-theme.author-sep$ $endfor$} +$if(titlepage-theme.author-color)$\textcolor{$titlepage-theme.author-color$}$endif${\authorstyle{$for(by-author)$\nohyphens{$by-author.name.literal$}$for(by-author.affiliations)${\textsuperscript{$it.number$}}$sep${\textsuperscript{,}}$endfor$$if(by-author.email)$$if(by-author.affiliations)$\textsuperscript{,}$endif${\textsuperscript{*}}$endif$$sep$$titlepage-theme.author-sep$ $if(titlepage-theme.author-space-between)$~\\ \vspace{$titlepage-theme.author-space-between$}$endif$$endfor$}} } $endif$ $if(titlepage-style-code.author.superscript-with-and)$ \newcommand{\titlepageauthorblock}{ -\authorstyle{$if(by-author/allbutlast)$$for(by-author/allbutlast)$$by-author.name.literal$$for(by-author.affiliations)${\textsuperscript{$it.number$}}$sep$\textsuperscript{,}$endfor$$if(by-author.email)$$if(by-author.affiliations)$\textsuperscript{,}$endif${\textsuperscript{*}}$endif$$sep$$titlepage-theme.author-sep$ $endfor$$for(by-author/last)$ and $by-author.name.literal$$for(by-author.affiliations)${\textsuperscript{$it.number$}}$sep$\textsuperscript{,}$endfor$$if(by-author.email)$$if(by-author.affiliations)$\textsuperscript{,}$endif${\textsuperscript{*}}$endif$$endfor$% -$else$% -$for(by-author/last)$$by-author.name.literal$$for(by-author.affiliations)${\textsuperscript{$it.number$}}$sep$\textsuperscript{,}$endfor$$if(by-author.email)$$if(by-author.affiliations)$\textsuperscript{,}$endif${\textsuperscript{,*}}$endif$$endfor$$endif$ -}} +$if(titlepage-theme.author-color)$\textcolor{$titlepage-theme.author-color$}$endif${\authorstyle{$if(by-author/allbutlast)$$for(by-author/allbutlast)$\nohyphens{$by-author.name.literal$}$for(by-author.affiliations)${\textsuperscript{$it.number$}}$sep$\textsuperscript{,}$endfor$$if(by-author.email)$$if(by-author.affiliations)$\textsuperscript{,}$endif${\textsuperscript{*}}$endif$$sep$$titlepage-theme.author-sep$ $if(titlepage-theme.author-space-between)$~\\ \vspace{$titlepage-theme.author-space-between$}$endif$$endfor$$for(by-author/last)$ and $if(titlepage-theme.author-space-between)$~\\ \vspace{$titlepage-theme.author-space-between$}$endif$\nohyphens{$by-author.name.literal$}$for(by-author.affiliations)${\textsuperscript{$it.number$}}$sep$\textsuperscript{,}$endfor$$if(by-author.email)$$if(by-author.affiliations)$\textsuperscript{,}$endif${\textsuperscript{*}}$endif$$endfor$$else$$for(by-author/last)$\nohyphens{$by-author.name.literal$}$for(by-author.affiliations)${\textsuperscript{$it.number$}}$sep$\textsuperscript{,}$endfor$$if(by-author.email)$$if(by-author.affiliations)$\textsuperscript{,}$endif${\textsuperscript{,*}}$endif$$endfor$$endif$}}} $endif$ $if(titlepage-style-code.author.author-address)$ \newcommand{\titlepageauthorblock}{ -\authorstyle{ -$for(by-author)$$by-author.name.literal$$if(by-author.affiliations)$,~$for(by-author.affiliations)$$by-author.affiliations.name$$if(by-affiliations.department)$,~$by-author.affiliations.department$$endif$$if(by-affiliations.address)$,~$by-author.affiliations.address$$endif$$sep$;~$endfor$$endif$$if(by-author.email)$~$by-author.email$$endif$$sep$\\ -$endfor$}} +$if(titlepage-theme.author-color)$\textcolor{$titlepage-theme.author-color$}$endif${\authorstyle{ +$for(by-author)$$by-author.name.literal$$if(by-author.affiliations)$$titlepage-theme.affiliation-sep$$for(by-author.affiliations)$$by-author.affiliations.name$$if(by-author.affiliations.department)$$titlepage-theme.affiliation-sep$$by-author.affiliations.department$$endif$$if(by-author.affiliations.address)$$titlepage-theme.affiliation-sep$$for(by-author.affiliations.address)$$by-author.affiliations.address$$sep$$titlepage-theme.affiliation-sep$$endfor$$endif$$sep$$titlepage-theme.affiliation-sep$$endfor$$endif$$if(by-author.email)$$titlepage-theme.affiliation-sep$$by-author.email$$endif$$sep$\\ +$if(titlepage-theme.author-space-between)$\vspace{$titlepage-theme.author-space-between$}$endif$$endfor$}}} $endif$ $if(titlepage-style-code.author.two-column)$ +\newcommand{\titlepageauthorblock}{ \newlength{\miniA} \setlength{\miniA}{0pt} \newlength{\namelen} $for(by-author)$\settowidth{\namelen}{$by-author.name.literal$}\setlength{\miniA}{\maxof{\miniA}{\namelen}}$endfor$ \setlength{\miniA}{\miniA+0.05\textwidth} \newlength{\miniB} -\setlength{\miniB}{0.9\textwidth-\miniA} -\newcommand{\titlepageauthorblock}{ +\setlength{\miniB}{0.99\textwidth - \miniA} \begin{minipage}{\miniA} \begin{flushleft} -\authorstyle{$for(by-author)$$by-author.name.literal$$sep$\\ $endfor$} +$if(titlepage-theme.author-color)$\textcolor{$titlepage-theme.author-color$}$endif${\authorstyle{$for(by-author)$$by-author.name.literal$$sep$\\ $if(titlepage-theme.author-space-between)$ +\vspace{$titlepage-theme.author-space-between$}$endif$$endfor$}} \end{flushleft} \end{minipage} -~ \begin{minipage}{\miniB} \begin{flushright} -\affiliationstyle{$for(by-author)$$for(by-author.affiliations/first)$$by-author.affiliations.name$ +$if(titlepage-theme.affiliation-color)$\textcolor{$titlepage-theme.affiliation-color$}$endif${\affiliationstyle{$for(by-author)$$for(by-author.affiliations/first)$$by-author.affiliations.name$ $endfor$$sep$\\ -$endfor$\\} +$if(titlepage-theme.affiliation-space-between)$\vspace{$titlepage-theme.affiliation-space-between$} +$endif$$endfor$\\}} \end{flushright} -\end{minipage} -} +\end{minipage}} $endif$ +$if(titlepage-style-code.affiliation.none)$ +\newcommand{\titlepageaffiliationblock}{} +$endif$ $if(titlepage-style-code.affiliation.numbered-list)$ \newcommand{\titlepageaffiliationblock}{ \hangindent=1em \hangafter=1 -\affiliationstyle{ -$for(by-affiliation)${$it.number$}.~$if(by-affiliation.name)$$it.name$$endif$$if(by-affiliation.department)$$if(by-affiliation.name)$, $endif$$it.department$$endif$$if(by-affiliation.address)$$if(by-affiliation.name)$, $else$$if(by-affiliation.department)$, $endif$$endif$$it.address$$endif$% -$sep$\par\hangindent=1em\hangafter=1 +\affiliationstyle{$for(by-affiliation)${$it.number$}.~$if(by-affiliation.name)$$it.name$$endif$$if(by-affiliation.department)$$if(by-affiliation.name)$$titlepage-theme.affiliation-sep$$endif$$it.department$$endif$$if(by-affiliation.address)$$if(by-affiliation.name)$$titlepage-theme.affiliation-sep$$else$$if(by-affiliation.department)$$titlepage-theme.affiliation-sep$$endif$$endif$$it.address$$endif$% +$sep$\par\hangindent=1em\hangafter=1$if(titlepage-theme.affiliation-space-between)$ +\vspace{$titlepage-theme.affiliation-space-between$}$endif$ $endfor$ }} $endif$ @@ -78,9 +78,10 @@ \newcommand{\titlepageaffiliationblock}{ \hangindent=1em \hangafter=1 -\affiliationstyle{ -$for(by-affiliation)${$it.number$}.~$if(by-affiliation.name)$$it.name$$endif$$if(by-affiliation.department)$$if(by-affiliation.name)$, $endif$$it.department$$endif$$if(by-affiliation.address)$$if(by-affiliation.name)$, $else$$if(by-affiliation.department)$, $endif$$endif$$it.address$$endif$ -$sep$\par\hangindent=1em\hangafter=1% +{\affiliationstyle{ +$for(by-affiliation)${$it.number$}.~$if(by-affiliation.name)$$it.name$$endif$$if(by-affiliation.department)$$if(by-affiliation.name)$$titlepage-theme.affiliation-sep$$endif$$it.department$$endif$$if(by-affiliation.address)$$if(by-affiliation.name)$$titlepage-theme.affiliation-sep$$else$$if(by-affiliation.department)$$titlepage-theme.affiliation-sep$$endif$$endif$$it.address$$endif$ +$sep$\par\hangindent=1em\hangafter=1$if(titlepage-theme.affiliation-space-between)$ +\vspace{$titlepage-theme.affiliation-space-between$}$endif$ $endfor$ \vspace{1\baselineskip} @@ -89,6 +90,6 @@ $if(by-author.email)$ * \textit{Correspondence:}~$by-author.name.literal$~$by-author.email$ $endif$$endfor$$endif$ -} +}} } $endif$ diff --git a/_extensions/nmfs-opensci/titlepage/_coverpage.tex b/_extensions/nmfs-opensci/titlepage/_coverpage.tex index e1fb25a..a3caa47 100644 --- a/_extensions/nmfs-opensci/titlepage/_coverpage.tex +++ b/_extensions/nmfs-opensci/titlepage/_coverpage.tex @@ -35,11 +35,10 @@ \newcommand{\titlelocationbottom}{$coverpage-theme.title-bottom$} \newcommand{\titlealign}{$coverpage-theme.title-align$} -\begin{scope} -{% +\begin{scope}{% $if(coverpage-theme.title-fontsize)$\fontsize{$coverpage-theme.title-fontsize$}{$coverpage-theme.title-spacing$}\selectfont $endif$$if(coverpage-theme.title-fontfamily)$\coverpagetitlefont -$endif$\node[anchor=$coverpage-theme.title-anchor$, align=$coverpage-theme.title-align$, rotate=$coverpage-theme.title-rotate$] (Title1) at ($$(current page.south west)+(\titlelocationleft,\titlelocationbottom)$$) [text width = $coverpage-theme.title-width$] {$if(coverpage-theme.title-color)$\textcolor{$coverpage-theme.title-color$}$endif${$for(coverpage-theme.title-fontstyle)$\$coverpage-theme.title-fontstyle${$endfor$\nohyphens{$coverpage-title$}$for(coverpage-theme.title-fontstyle)$}$endfor$}}; +$endif$\node[anchor=$coverpage-theme.title-anchor$, align=$coverpage-theme.title-align$, rotate=$coverpage-theme.title-rotate$] (Title1) at ($$(current page.south west)+(\titlelocationleft,\titlelocationbottom)$$) [text width = $coverpage-theme.title-width$$if(coverpage-theme.title-node-spec)$, $coverpage-theme.title-node-spec$$endif$] {$if(coverpage-theme.title-color)$\textcolor{$coverpage-theme.title-color$}$endif${$for(coverpage-theme.title-fontstyle)$\$coverpage-theme.title-fontstyle${$endfor$\nohyphens{$coverpage-title$}$for(coverpage-theme.title-fontstyle)$}$endfor$}}; } \end{scope} $endif$ @@ -56,7 +55,7 @@ {% $if(coverpage-theme.author-fontsize)$\fontsize{$coverpage-theme.author-fontsize$}{$coverpage-theme.author-spacing$}\selectfont $endif$$if(coverpage-theme.author-fontfamily)$\coverpageauthorfont -$endif$\node[anchor=$coverpage-theme.author-anchor$, align=$coverpage-theme.author-align$, rotate=$coverpage-theme.author-rotate$] (Author1) at ($$(current page.south west)+(\authorlocationleft,\authorlocationbottom)$$) [text width = $coverpage-theme.author-width$] { +$endif$\node[anchor=$coverpage-theme.author-anchor$, align=$coverpage-theme.author-align$, rotate=$coverpage-theme.author-rotate$] (Author1) at ($$(current page.south west)+(\authorlocationleft,\authorlocationbottom)$$) [text width = $coverpage-theme.author-width$$if(coverpage-theme.author-node-spec)$, $coverpage-theme.author-node-spec$$endif$] { $if(coverpage-theme.author-color)$\textcolor{$coverpage-theme.author-color$}$endif$\coverauthorstyle{$for(coverpage-author)$$coverpage-author$$sep$$coverpage-theme.author-sep$$endfor$\\}}; } \end{scope} @@ -75,7 +74,7 @@ $if(coverpage-theme.header-fontsize)$\fontsize{$coverpage-theme.header-fontsize$}{$coverpage-theme.header-spacing$}\selectfont $endif$ $if(coverpage-theme.header-fontfamily)$\coverpageheaderfont $endif$\node[anchor=$coverpage-theme.header-anchor$, align=$coverpage-theme.header-align$, rotate=$coverpage-theme.header-rotate$] (Header1) at % -($$(current page.south west)+(\headerlocationleft,\headerlocationbottom)$$) [text width = $coverpage-theme.header-width$] {$if(coverpage-theme.header-color)$\textcolor{$coverpage-theme.header-color$}$endif${$for(coverpage-theme.header-fontstyle)$\$coverpage-theme.header-fontstyle${$endfor$\nohyphens{$coverpage-header$}$for(coverpage-theme.header-fontstyle)$}$endfor$}}; +($$(current page.south west)+(\headerlocationleft,\headerlocationbottom)$$) [text width = $coverpage-theme.header-width$$if(coverpage-theme.header-node-spec)$, $coverpage-theme.header-node-spec$$endif$] {$if(coverpage-theme.header-color)$\textcolor{$coverpage-theme.header-color$}$endif${$for(coverpage-theme.header-fontstyle)$\$coverpage-theme.header-fontstyle${$endfor$\nohyphens{$coverpage-header$}$for(coverpage-theme.header-fontstyle)$}$endfor$}}; } \end{scope} $endif$ @@ -93,7 +92,25 @@ $if(coverpage-theme.footer-fontsize)$\fontsize{$coverpage-theme.footer-fontsize$}{$coverpage-theme.footer-spacing$}\selectfont $endif$ $if(coverpage-theme.footer-fontfamily)$\coverpagefooterfont $endif$\node[anchor=$coverpage-theme.footer-anchor$, align=$coverpage-theme.footer-align$, rotate=$coverpage-theme.footer-rotate$] (Footer1) at % -($$(current page.south west)+(\footerlocationleft,\footerlocationbottom)$$) [text width = $coverpage-theme.footer-width$] {$if(coverpage-theme.footer-color)$\textcolor{$coverpage-theme.footer-color$}$endif${$for(coverpage-theme.footer-fontstyle)$\$coverpage-theme.footer-fontstyle${$endfor$\nohyphens{$coverpage-footer$}$for(coverpage-theme.footer-fontstyle)$}$endfor$}}; +($$(current page.south west)+(\footerlocationleft,\footerlocationbottom)$$) [text width = $coverpage-theme.footer-width$$if(coverpage-theme.footer-node-spec)$, $coverpage-theme.footer-node-spec$$endif$] {$if(coverpage-theme.footer-color)$\textcolor{$coverpage-theme.footer-color$}$endif${$for(coverpage-theme.footer-fontstyle)$\$coverpage-theme.footer-fontstyle${$endfor$\nohyphens{$coverpage-footer$}$for(coverpage-theme.footer-fontstyle)$}$endfor$}}; +} +\end{scope} +$endif$ +$endif$ +$if(coverpage-style-code.date.plain)$ +$if(coverpage-date)$ + +% Date +\newcommand{\datelocationleft}{$coverpage-theme.date-left$} +\newcommand{\datelocationbottom}{$coverpage-theme.date-bottom$} +\newcommand{\datelocationalign}{$coverpage-theme.date-align$} + +\begin{scope} +{% +$if(coverpage-theme.date-fontsize)$\fontsize{$coverpage-theme.date-fontsize$}{$coverpage-theme.date-spacing$}\selectfont +$endif$ $if(coverpage-theme.date-fontfamily)$\coverpagedatefont +$endif$\node[anchor=$coverpage-theme.date-anchor$, align=$coverpage-theme.date-align$, rotate=$coverpage-theme.date-rotate$] (Date1) at % +($$(current page.south west)+(\datelocationleft,\datelocationbottom)$$) [text width = $coverpage-theme.date-width$$if(coverpage-theme.date-node-spec)$, $coverpage-theme.date-node-spec$$endif$] {$if(coverpage-theme.date-color)$\textcolor{$coverpage-theme.date-color$}$endif${$for(coverpage-theme.date-fontstyle)$\$coverpage-theme.date-fontstyle${$endfor$\nohyphens{$coverpage-date$}$for(coverpage-theme.date-fontstyle)$}$endfor$}}; } \end{scope} $endif$ diff --git a/_extensions/nmfs-opensci/titlepage/_extension.yml b/_extensions/nmfs-opensci/titlepage/_extension.yml index 3181523..acefbc4 100644 --- a/_extensions/nmfs-opensci/titlepage/_extension.yml +++ b/_extensions/nmfs-opensci/titlepage/_extension.yml @@ -1,6 +1,7 @@ title: titlepage author: Eli Holmes -version: 3.3.3 +quarto-required: ">=1.1.0" +version: 3.3.10 contributes: format: pdf: @@ -15,3 +16,5 @@ contributes: - "_titlepage.tex" - "before-body.tex" - "pandoc.tex" + format-resources: + - "fonts/qualitype/opentype/QTDublinIrish.otf" diff --git a/_extensions/nmfs-opensci/titlepage/_title-themes.tex b/_extensions/nmfs-opensci/titlepage/_title-themes.tex index 8f7a166..a1c5c39 100644 --- a/_extensions/nmfs-opensci/titlepage/_title-themes.tex +++ b/_extensions/nmfs-opensci/titlepage/_title-themes.tex @@ -16,7 +16,7 @@ \vspace{\betweentitlesubtitle} { $if(titlepage-theme.subtitle-fontsize)$\fontsize{$titlepage-theme.subtitle-fontsize$}{$titlepage-theme.subtitle-spacing$}\selectfont -$endif${$for(titlepage-theme.subtitle-fontstyle)$\$titlepage-theme.subtitle-fontstyle${$endfor$\nohyphens{$subtitle$}$for(titlepage-theme.subtitle-fontstyle)$}$endfor$}\par +$endif$$if(titlepage-theme.subtitle-color)$\textcolor{$titlepage-theme.subtitle-color$}$endif${$for(titlepage-theme.subtitle-fontstyle)$\$titlepage-theme.subtitle-fontstyle${$endfor$\nohyphens{$subtitle$}$for(titlepage-theme.subtitle-fontstyle)$}$endfor$}\par }$endif$} $-- $if(titlepage-style-code.title.none)$ diff --git a/_extensions/nmfs-opensci/titlepage/_titlepage.tex b/_extensions/nmfs-opensci/titlepage/_titlepage.tex index cc617bf..e2ebe60 100644 --- a/_extensions/nmfs-opensci/titlepage/_titlepage.tex +++ b/_extensions/nmfs-opensci/titlepage/_titlepage.tex @@ -99,7 +99,7 @@ $else$$endif$} \newcommand{\affiliationblock}{$if(author)$ -{$if(titlepage-theme.afiliation-align)$\titlepageaffiliationalign +$if(titlepage-theme.affiliation-color)$\textcolor{$titlepage-theme.affiliation-color$}$endif${$if(titlepage-theme.affiliation-align)$\titlepageaffiliationalign $endif$$if(titlepage-theme.affiliation-fontfamily)$\titlepageaffiliationfont $endif$\titlepageaffiliationblock} @@ -114,7 +114,7 @@ $else$$endif$} \newcommand{\footerblock}{$if(titlepage-footer)$ -{$if(titlepage-theme.footer-align)$\titlepagefooteralign +$if(titlepage-theme.footer-color)$\textcolor{$titlepage-theme.footer-color$}$endif${$if(titlepage-theme.footer-align)$\titlepagefooteralign $endif$$if(titlepage-theme.footer-fontfamily)$\titlepagefooterfont $endif$\titlepagefooterblock} @@ -122,7 +122,7 @@ $else$$endif$} \newcommand{\dateblock}{$if(date)$ -{$if(titlepage-theme.date-align)$\titlepagedatealign +$if(titlepage-theme.date-color)$\textcolor{$titlepage-theme.date-color$}$endif${$if(titlepage-theme.date-align)$\titlepagedatealign $endif$$if(titlepage-theme.date-fontfamily)$\titlepagedatefont $endif$\titlepagedateblock} @@ -130,7 +130,7 @@ $else$$endif$} \newcommand{\headerblock}{$if(titlepage-header)$ -{$if(titlepage-theme.header-align)$\titlepageheaderalign +$if(titlepage-theme.header-color)$\textcolor{$titlepage-theme.header-color$}$endif${$if(titlepage-theme.header-align)$\titlepageheaderalign $endif$$if(titlepage-theme.header-fontfamily)$\titlepageheaderfont$endif$\titlepageheaderblock \vspace{$if(titlepage-theme.header-space-after)$$titlepage-theme.header-space-after$$else$0pt$endif$} diff --git a/_extensions/nmfs-opensci/titlepage/before-body.tex b/_extensions/nmfs-opensci/titlepage/before-body.tex index 836288b..2f483ec 100644 --- a/_extensions/nmfs-opensci/titlepage/before-body.tex +++ b/_extensions/nmfs-opensci/titlepage/before-body.tex @@ -36,3 +36,4 @@ $endif$ %%%%% end titlepage extension code + diff --git a/_extensions/nmfs-opensci/titlepage/coverpage-theme.lua b/_extensions/nmfs-opensci/titlepage/coverpage-theme.lua index 5698e62..82c0945 100644 --- a/_extensions/nmfs-opensci/titlepage/coverpage-theme.lua +++ b/_extensions/nmfs-opensci/titlepage/coverpage-theme.lua @@ -67,7 +67,7 @@ okvals: a text table of ok styles. e.g. {"right", "center"} This function gets the value of something like coverpage-theme.title-style and sets a value coverpage-theme.title-style.plain (for example). It also does error checking against okvals. "plain" is always ok and if no value is set then the style is set to plain. page: titlepage or coverpage -styleement: page, title, subtitle, header, footer, affiliation, etc +styleelement: page, title, subtitle, header, footer, affiliation, date, etc okvals: a text table of ok styles. e.g. {"plain", "two-column"} --]] local function set_style (page, styleelement, okvals) @@ -224,7 +224,8 @@ Set up the demos choice = pandoc.utils.stringify(m.coverpage) if choice == "great-wave" then if isEmpty(m['coverpage-bg-image']) then - m['coverpage-bg-image'] = script_path().."images/TheGreatWaveoffKanagawa.jpeg" +-- m['coverpage-bg-image'] = script_path().."images/TheGreatWaveoffKanagawa.jpeg" + m['coverpage-bg-image'] = "img/TheGreatWaveoffKanagawa.jpeg" end if isEmpty(m['coverpage-title']) then m['coverpage-title'] = "quarto_titlepages" @@ -232,7 +233,7 @@ Set up the demos if isEmpty(m['coverpage-footer']) then m['coverpage-footer'] = "Templates for title pages and covers" end - demovals = {["title-align"] = "right", ["title-fontsize"] = 30, ["title-fontfamily"] = "Palatino", ["title-fontstyle"] = {"textbf", "textit"}, ["title-bottom"] = "10in", ["author-style"] = "none", ["footer-fontsize"] = 20, ["footer-fontfamily"] = "Palatino", ["footer-fontstyle"] = {"textit"}, ["footer-align"] = "right", ["footer-bottom"] = "9.5in", ["page-html-color"] = "F6D5A8", ["bg-image-fading"] = "north"} + demovals = {["title-align"] = "right", ["title-fontsize"] = 40, ["title-fontfamily"] = "QTDublinIrish.otf", ["title-bottom"] = "10in", ["author-style"] = "none", ["footer-fontsize"] = 20, ["footer-fontfamily"] = "QTDublinIrish.otf", ["footer-align"] = "right", ["footer-bottom"] = "9.5in", ["page-html-color"] = "F6D5A8", ["bg-image-fading"] = "north"} for dkey, val in pairs(demovals) do if isEmpty(m['coverpage-theme'][dkey]) then m['coverpage-theme'][dkey] = val @@ -241,7 +242,8 @@ Set up the demos end if choice == "otter" then if isEmpty(m['coverpage-bg-image']) then - m['coverpage-bg-image'] = script_path().."images/otter-bar.jpeg" +-- m['coverpage-bg-image'] = script_path().."images/otter-bar.jpeg" + m['coverpage-bg-image'] = "img/otter-bar.jpeg" end if isEmpty(m['coverpage-title']) then m['coverpage-title'] = "Otters" @@ -257,8 +259,8 @@ Set up the demos end end --- set the coverpage values unless user passed them in - for key, val in pairs({"title", "author"}) do +-- set the coverpage values unless user passed them in as coverpage-key + for key, val in pairs({"title", "author", "date"}) do if isEmpty(m['coverpage-' .. val]) then if not isEmpty(m[val]) then m['coverpage-' .. val] = m[val] @@ -266,15 +268,19 @@ Set up the demos end end -- make a bit more robust to whatever user passes in for coverpage-author - for key, val in pairs(m['coverpage-author']) do - m['coverpage-author'][key] = getVal(m['coverpage-author'][key]) + if not isEmpty(m['coverpage-author']) then + for key, val in pairs(m['coverpage-author']) do + m['coverpage-author'][key] = getVal(m['coverpage-author'][key]) + end end -- fix "true" to figure out what was passed in if choice == "true" then - for key, val in pairs({"title", "author", "footer", "header"}) do + for key, val in pairs({"title", "author", "footer", "header", "date"}) do if not isEmpty(m['coverpage-' .. val]) then - m['coverpage-theme'][val .. "-style"] = "plain" + if isEmpty(m['coverpage-theme'][val .. "-style"]) then + m['coverpage-theme'][val .. "-style"] = "plain" + end else m['coverpage-theme'][val .. "-style"] = "none" end @@ -292,6 +298,7 @@ Error checking and setting the style codes set_style("coverpage", "footer", okvals) set_style("coverpage", "header", okvals) set_style("coverpage", "author", okvals) + set_style("coverpage", "date", okvals) if isEmpty(m['coverpage-bg-image']) then m['coverpage-bg-image'] = "none" -- need for stringify to work @@ -334,7 +341,7 @@ if page-fontsize was passed in or if fontsize passed in but not spacing --]] -- if not passed in then it will take page-fontsize and page-spacing - for key, val in pairs({"title", "author", "footer", "header"}) do + for key, val in pairs({"title", "author", "footer", "header", "date"}) do if getVal(m["coverpage-theme"][val .. "-style"]) ~= "none" then if not isEmpty(m["coverpage-theme"]["page-fontsize"]) then if isEmpty(m["coverpage-theme"][val .. "-fontsize"]) then @@ -344,7 +351,7 @@ if page-fontsize was passed in or if fontsize passed in but not spacing end end -- make sure spacing is set if user passed in fontsize - for key, val in pairs({"page", "title", "author", "footer", "header"}) do + for key, val in pairs({"page", "title", "author", "footer", "header", "date"}) do if not isEmpty(m['coverpage-theme'][val .. "-fontsize"]) then if isEmpty(m['coverpage-theme'][val .. "-spacing"]) then m['coverpage-theme'][val .. "-spacing"] = 1.2*getVal(m['coverpage-theme'][val .. "-fontsize"]) @@ -364,6 +371,18 @@ Set author sep character pandoc.RawInline("latex","\\\\")} end +--[[ +Set affiliation sep character +--]] + if isEmpty(m['coverpage-theme']["affiliation-sep"]) then + m['coverpage-theme']["affiliation-sep"] = pandoc.MetaInlines{ + pandoc.RawInline("latex",",~")} + end + if getVal(m['coverpage-theme']["affiliation-sep"]) == "newline" then + m['coverpage-theme']["affiliation-sep"] = pandoc.MetaInlines{ + pandoc.RawInline("latex","\\\\")} + end + --[[ Set the defaults for the coverpage alignments default coverpage alignment is left @@ -375,7 +394,7 @@ because coverpage uses tikzpicture, the alignments of the elements must be set for key, val in pairs({"page", "title", "author", "footer", "header", "logo", "date"}) do if not isEmpty(m["coverpage-theme"][val .. "-align"]) then okvals = {"right", "left", "center"} - if has_value({"title", "author", "footer", "header"}, val) then table.insert(okvals, "spread") end + if has_value({"title", "author", "footer", "header", "date"}, val) then table.insert(okvals, "spread") end ok = check_yaml (m["coverpage-theme"][val .. "-align"], "coverpage-theme: " .. val .. "-align", okvals) if not ok then error("") end else diff --git a/_extensions/nmfs-opensci/titlepage/mathjax.html b/_extensions/nmfs-opensci/titlepage/mathjax.html new file mode 100644 index 0000000..226a061 --- /dev/null +++ b/_extensions/nmfs-opensci/titlepage/mathjax.html @@ -0,0 +1,15 @@ + + + + \ No newline at end of file diff --git a/_extensions/nmfs-opensci/titlepage/pandoc.tex b/_extensions/nmfs-opensci/titlepage/pandoc.tex index 08c8f11..62b14cd 100644 --- a/_extensions/nmfs-opensci/titlepage/pandoc.tex +++ b/_extensions/nmfs-opensci/titlepage/pandoc.tex @@ -39,15 +39,6 @@ \usepackage[pagecolor=none]{pagecolor} $endif$ -$if(coverpage-title-fontfamily)$ -\usepackage{fontspec} -\newfontfamily{\coverpagetitlefont}{$coverpage-title-fontfamily$} -$endif$ -$if(coverpage-author-fontfamily)$ -\usepackage{fontspec} -\newfontfamily{\coverpageauthorfont}{$coverpage-author-fontfamily$} -$endif$ - $if(titlepage)$ % Set the titlepage font families $if(titlepage-theme.page-fontfamily)$ @@ -88,25 +79,26 @@ \usepackage{fontspec} \newfontfamily{\coverpagefont}{$coverpage-theme.page-fontfamily$} $endif$ - $if(coverpage-theme.title-fontfamily)$ \usepackage{fontspec} \newfontfamily{\coverpagetitlefont}{$coverpage-theme.title-fontfamily$} $endif$ - $if(coverpage-theme.author-fontfamily)$ \usepackage{fontspec} \newfontfamily{\coverpageauthorfont}{$coverpage-theme.author-fontfamily$} $endif$ - $if(coverpage-theme.footer-fontfamily)$ \usepackage{fontspec} \newfontfamily{\coverpagefooterfont}{$coverpage-theme.footer-fontfamily$} $endif$ - $if(coverpage-theme.header-fontfamily)$ \usepackage{fontspec} \newfontfamily{\coverpageheaderfont}{$coverpage-theme.header-fontfamily$} $endif$ +$if(coverpage-theme.date-fontfamily)$ +\usepackage{fontspec} +\newfontfamily{\coverpagedatefont}{$coverpage-theme.date-fontfamily$} +$endif$ $endif$ + diff --git a/_extensions/nmfs-opensci/titlepage/titlepage-theme.lua b/_extensions/nmfs-opensci/titlepage/titlepage-theme.lua index 8c8b135..7b1f8fb 100644 --- a/_extensions/nmfs-opensci/titlepage/titlepage-theme.lua +++ b/_extensions/nmfs-opensci/titlepage/titlepage-theme.lua @@ -11,6 +11,13 @@ local function getVal(s) return pandoc.utils.stringify(s) end +local function is_equal (s, val) + if isEmpty(s) then return false end + if getVal(s) == val then return true end + + return false +end + local function has_value (tab, val) for index, value in ipairs(tab) do if value == val then @@ -386,8 +393,8 @@ This function assigns the themevals to the meta data } m['titlepage-file'] = false + if isEmpty(m.titlepage) then m['titlepage'] = "plain" end if getVal(m.titlepage) == "false" then m['titlepage'] = "none" end - if isEmpty(m.titlepage) then mm['titlepage'] = "plain" end if getVal(m.titlepage) == "true" then m['titlepage'] = "plain" end if getVal(m.titlepage) == "none" then m['titlepage-true'] = false @@ -433,6 +440,9 @@ Error checking and setting the style codes set_style("titlepage", "author", okvals) okvals = {"none", "numbered-list", "numbered-list-with-correspondence"} set_style("titlepage", "affiliation", okvals) + if is_equal(m['titlepage-theme']["author-style"], "author-address") and is_equal(m['titlepage-theme']["author-align"], "spread") then + error("\n\nquarto_titlepages error: If author-style is two-column, then author-align cannot be spread.\n\n") + end --[[ Set the fontsize defaults @@ -464,6 +474,18 @@ Set author sep character m['titlepage-theme']["author-sep"] = pandoc.MetaInlines{ pandoc.RawInline("latex","\\\\")} end + +--[[ +Set affiliation sep character +--]] + if isEmpty(m['titlepage-theme']["affiliation-sep"]) then + m['titlepage-theme']["affiliation-sep"] = pandoc.MetaInlines{ + pandoc.RawInline("latex",",~")} + end + if getVal(m['titlepage-theme']["affiliation-sep"]) == "newline" then + m['titlepage-theme']["affiliation-sep"] = pandoc.MetaInlines{ + pandoc.RawInline("latex","\\\\")} + end --[[ Set vrule defaults diff --git a/_frontmatter.yml b/_frontmatter.yml index 3e014bd..e03ab68 100644 --- a/_frontmatter.yml +++ b/_frontmatter.yml @@ -57,17 +57,15 @@ format: author-left: 2.3in author-width: 5in author-bottom: 5in - footer-style: "colorbox" - footer-colorbox-fill: "blue" + footer-style: "plain" footer-fontsize: 8 footer-left: 6in footer-width: 2.5in - date-style: "colorbox" - date-colorbox-fill: "blue" + date-style: "plain" date-fontsize: 20 date-left: 6in date-width: 2.5in - date-align: "center" + date-bottom: 2in include-in-header: text: | \usepackage[default]{opensans} diff --git a/content/rmarkdown_files/figure-docx/pressure-1.png b/content/rmarkdown_files/figure-docx/pressure-1.png new file mode 100644 index 0000000..4d776ec Binary files /dev/null and b/content/rmarkdown_files/figure-docx/pressure-1.png differ diff --git a/content/rmarkdown_files/figure-html/pressure-1.png b/content/rmarkdown_files/figure-html/pressure-1.png new file mode 100644 index 0000000..016bbd9 Binary files /dev/null and b/content/rmarkdown_files/figure-html/pressure-1.png differ diff --git a/content/rmarkdown_files/figure-pdf/fig-pressure-1.pdf b/content/rmarkdown_files/figure-pdf/fig-pressure-1.pdf new file mode 100644 index 0000000..f95dde2 Binary files /dev/null and b/content/rmarkdown_files/figure-pdf/fig-pressure-1.pdf differ