├── references.qmd ├── .DS_Store ├── docs ├── robots.txt ├── site_libs │ ├── bootstrap │ │ └── bootstrap-icons.woff │ ├── kePrint-0.0.1 │ │ └── kePrint.js │ ├── tabwid-1.1.3 │ │ ├── tabwid.css │ │ └── tabwid.js │ ├── quarto-html │ │ ├── tippy.css │ │ ├── quarto-syntax-highlighting.css │ │ ├── anchor.min.js │ │ ├── popper.min.js │ │ └── tippy.umd.min.js │ ├── quarto-nav │ │ ├── headroom.min.js │ │ └── quarto-nav.js │ ├── lightable-0.0.1 │ │ └── lightable.css │ ├── clipboard │ │ └── clipboard.min.js │ └── quarto-search │ │ └── fuse.min.js ├── text │ ├── tips_files │ │ └── figure-html │ │ │ ├── fig-plot-1.png │ │ │ └── fig-chinook-1.png │ ├── figures_files │ │ └── figure-html │ │ │ └── fig-salmon-1.png │ └── figures.html ├── A-Quarto-Template-Repo-to-Create-Big-Reports-and-Very-Long-Title-Because-Long-Titles-are-Common.docx ├── A-Quarto-Template-Repo-to-Create-Big-Reports-and-Very-Long-Title-Because-Long-Titles-are-Common.pdf ├── sitemap.xml └── references.html ├── template.docx ├── images ├── logo.png └── doc-logo.png ├── data └── salmon.RData ├── partials ├── before-body1.tex ├── _two-column-longtable.tex ├── title1.tex ├── inheader.tex ├── before-body.tex └── before-body-elsevier.tex ├── .gitignore ├── QmdReport.Rproj ├── text ├── appendix_tables.qmd ├── figures.qmd ├── bibliography.bib ├── tables_in_a_for_loop.qmd ├── conclusion.qmd ├── tables.qmd ├── kable_flex.qmd ├── tips.qmd └── citations.qmd ├── references.bib ├── tables ├── Table_for_child.Rmd ├── Table_for_child2.Rmd ├── _Table_Counts.R ├── _common.R ├── Table_qt.Rmd ├── Table_Appendix.Rmd ├── Table_flex.Rmd └── Appendix_single_table.Rmd ├── figures └── Figure_salmon_ts.Rmd ├── preface.qmd ├── _quarto.yml ├── index.qmd └── README.md /references.qmd: -------------------------------------------------------------------------------- 1 | # References {.unnumbered} 2 | 3 | ::: {#refs} 4 | ::: 5 | -------------------------------------------------------------------------------- /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RVerse-Tutorials/QmdReport/main/.DS_Store -------------------------------------------------------------------------------- /docs/robots.txt: -------------------------------------------------------------------------------- 1 | Sitemap: https://rverse-tutorials.github.io/QmdReport/sitemap.xml 2 | -------------------------------------------------------------------------------- /template.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RVerse-Tutorials/QmdReport/main/template.docx -------------------------------------------------------------------------------- /images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RVerse-Tutorials/QmdReport/main/images/logo.png -------------------------------------------------------------------------------- /data/salmon.RData: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RVerse-Tutorials/QmdReport/main/data/salmon.RData -------------------------------------------------------------------------------- /images/doc-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RVerse-Tutorials/QmdReport/main/images/doc-logo.png -------------------------------------------------------------------------------- /partials/before-body1.tex: -------------------------------------------------------------------------------- 1 | 2 | \begin{frontmatter} 3 | \title{This is a test} 4 | \end{frontmatter} 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | .Rhistory 3 | .RData 4 | .Ruserdata 5 | 6 | /.quarto/ 7 | /_site/ 8 | /_book/ 9 | -------------------------------------------------------------------------------- /docs/site_libs/bootstrap/bootstrap-icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RVerse-Tutorials/QmdReport/main/docs/site_libs/bootstrap/bootstrap-icons.woff -------------------------------------------------------------------------------- /docs/text/tips_files/figure-html/fig-plot-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RVerse-Tutorials/QmdReport/main/docs/text/tips_files/figure-html/fig-plot-1.png -------------------------------------------------------------------------------- /docs/text/tips_files/figure-html/fig-chinook-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RVerse-Tutorials/QmdReport/main/docs/text/tips_files/figure-html/fig-chinook-1.png -------------------------------------------------------------------------------- /docs/text/figures_files/figure-html/fig-salmon-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RVerse-Tutorials/QmdReport/main/docs/text/figures_files/figure-html/fig-salmon-1.png -------------------------------------------------------------------------------- /docs/A-Quarto-Template-Repo-to-Create-Big-Reports-and-Very-Long-Title-Because-Long-Titles-are-Common.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RVerse-Tutorials/QmdReport/main/docs/A-Quarto-Template-Repo-to-Create-Big-Reports-and-Very-Long-Title-Because-Long-Titles-are-Common.docx -------------------------------------------------------------------------------- /docs/A-Quarto-Template-Repo-to-Create-Big-Reports-and-Very-Long-Title-Because-Long-Titles-are-Common.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RVerse-Tutorials/QmdReport/main/docs/A-Quarto-Template-Repo-to-Create-Big-Reports-and-Very-Long-Title-Because-Long-Titles-are-Common.pdf -------------------------------------------------------------------------------- /QmdReport.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: Default 4 | SaveWorkspace: Default 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: Sweave 13 | LaTeX: pdfLaTeX 14 | -------------------------------------------------------------------------------- /docs/site_libs/kePrint-0.0.1/kePrint.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function(){ 2 | if (typeof $('[data-toggle="tooltip"]').tooltip === 'function') { 3 | $('[data-toggle="tooltip"]').tooltip(); 4 | } 5 | if ($('[data-toggle="popover"]').popover === 'function') { 6 | $('[data-toggle="popover"]').popover(); 7 | } 8 | }); 9 | -------------------------------------------------------------------------------- /text/appendix_tables.qmd: -------------------------------------------------------------------------------- 1 | ```{r include=FALSE} 2 | library(knitr) 3 | library(flextable) 4 | opts_chunk$set(echo = FALSE) 5 | ``` 6 | 7 | 8 | 9 | ```{r child=here::here("tables", "Table_Appendix.Rmd")} 10 | ``` 11 | 12 | 13 | ```{=openxml} 14 | 15 | ``` 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /references.bib: -------------------------------------------------------------------------------- 1 | @article{knuth84, 2 | author = {Knuth, Donald E.}, 3 | title = {Literate Programming}, 4 | year = {1984}, 5 | issue_date = {May 1984}, 6 | publisher = {Oxford University Press, Inc.}, 7 | address = {USA}, 8 | volume = {27}, 9 | number = {2}, 10 | issn = {0010-4620}, 11 | url = {https://doi.org/10.1093/comjnl/27.2.97}, 12 | doi = {10.1093/comjnl/27.2.97}, 13 | journal = {Comput. J.}, 14 | month = may, 15 | pages = {97–111}, 16 | numpages = {15} 17 | } 18 | 19 | 20 | -------------------------------------------------------------------------------- /partials/_two-column-longtable.tex: -------------------------------------------------------------------------------- 1 | \usepackage{float} 2 | \makeatletter 3 | \let\oldlt\longtable 4 | \let\endoldlt\endlongtable 5 | \def\longtable{\@ifnextchar[\longtable@i \longtable@ii} 6 | \def\longtable@i[#1]{\begin{figure}[H] 7 | \onecolumn 8 | \begin{minipage}{0.5\textwidth} 9 | \oldlt[#1] 10 | } 11 | \def\longtable@ii{\begin{figure}[H] 12 | \onecolumn 13 | \begin{minipage}{0.5\textwidth} 14 | \oldlt 15 | } 16 | \def\endlongtable{\endoldlt 17 | \end{minipage} 18 | \twocolumn 19 | \end{figure}} 20 | \makeatother 21 | -------------------------------------------------------------------------------- /partials/title1.tex: -------------------------------------------------------------------------------- 1 | 2 | \begin{frontmatter} 3 | \title{$title$} 4 | \author[1]{Author A\thanks{A.A@university.edu}} 5 | \author[1]{Author B\thanks{B.B@university.edu}} 6 | \author[1]{Author C\thanks{C.C@university.edu}} 7 | \author[2]{Author D\thanks{D.D@university.edu}} 8 | \author[2]{Author E\thanks{E.E@university.edu}} 9 | \affil[1]{Department of Computer Science, \LaTeX\ University} 10 | \affil[2]{Department of Mechanical Engineering, \LaTeX\ University} 11 | % Don't want date printed 12 | \date{} 13 | 14 | 15 | \renewcommand\Authands{ and } 16 | \end{frontmatter} 17 | -------------------------------------------------------------------------------- /tables/Table_for_child.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | always_allow_html: true 3 | --- 4 | 5 | ```{r} 6 | tbl_cap <- paste("Cars with", {{value.to.match}}, "cylinders. These tables have cross-ref links via @tbl-xyz.") 7 | dt <- mtcars[, 1:4] %>% 8 | filter(cyl == {{value.to.match}}) %>% 9 | head(3) 10 | ``` 11 | 12 | 13 | ```{r} 14 | #| label: tbl-cyl{{value.to.match}} 15 | #| tbl-cap: !expr tbl_cap 16 | if(table.engine=="flextable") myflextable(dt) 17 | if(table.engine=="kbl") mykbl(dt) 18 | ``` 19 | -------------------------------------------------------------------------------- /tables/Table_for_child2.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | always_allow_html: true 3 | --- 4 | 5 | ```{r} 6 | tbl_cap <- paste("Cars with", {{value.to.match}}, "cylinders. These tables have cross-ref links via @tbl-xyz.") 7 | dt <- mtcars[, 1:4] %>% 8 | filter(cyl == {{value.to.match}}) %>% 9 | head(3) 10 | ``` 11 | 12 | 13 | ```{r} 14 | #| label: tbl-cyl{{value.to.match}}B 15 | #| tbl-cap: !expr tbl_cap 16 | if(table.engine=="flextable") myflextable(dt) 17 | if(table.engine=="kbl") mykbl(dt) 18 | ``` 19 | -------------------------------------------------------------------------------- /text/figures.qmd: -------------------------------------------------------------------------------- 1 | ```{r warning=FALSE, echo=FALSE, message=FALSE} 2 | knitr::opts_chunk$set(echo = FALSE, warning=FALSE, message=FALSE) 3 | library(knitr) 4 | library(xtable) 5 | library(flextable) 6 | library(dplyr) 7 | ``` 8 | 9 | # Figures intro 10 | 11 | This chapter shows a few simple examples of including figures and getting cross-referencing to work across formats (HTML, Word, PDF). 12 | 13 | ## `ggplot2` 14 | 15 | We can see in @fig-salmon that there are many time series. The number of panels is choosen automatically using {ggplot2}. 16 | 17 | ```{r child=here::here("figures", "Figure_salmon_ts.Rmd")} 18 | ``` 19 | 20 | ```{=openxml} 21 | 22 | ``` 23 | -------------------------------------------------------------------------------- /partials/inheader.tex: -------------------------------------------------------------------------------- 1 | \newcommand*{\plogo}{\fbox{$\mathcal{PL}$}} % Generic dummy publisher logo 2 | \usepackage[utf8]{inputenc} % Required for inputting international characters 3 | \usepackage[T1]{fontenc} % Output font encoding for international characters 4 | \usepackage{hyphenat} 5 | \usepackage{authblk} 6 | 7 | % for nicer tables 8 | \usepackage{booktabs} 9 | \usepackage{longtable} 10 | \usepackage{array} 11 | \usepackage{multirow} 12 | \usepackage{wrapfig} 13 | \usepackage{float} 14 | \usepackage{colortbl} 15 | \usepackage{pdflscape} 16 | \usepackage{tabu} 17 | \usepackage{threeparttable} 18 | \usepackage{threeparttablex} 19 | \usepackage[normalem]{ulem} 20 | \usepackage{makecell} 21 | \usepackage{xcolor} 22 | -------------------------------------------------------------------------------- /figures/Figure_salmon_ts.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Fig of salmon time series" 3 | author: "EE Holmes" 4 | --- 5 | 6 | ```{r include=FALSE} 7 | knitr::opts_chunk$set(echo = FALSE, warning=FALSE, message=FALSE) 8 | library(ggplot2) 9 | ``` 10 | 11 | ```{r load_data, echo=FALSE} 12 | load(here::here("data", "salmon.RData")) 13 | ``` 14 | 15 | 18 | 19 | ```{r fig-salmon, fig.cap="Plot of the data", fig.align='center'} 20 | ggplot(salmon, aes(x=YEAR, y=log(NUMBER_OF_SPAWNERS))) + 21 | geom_line() + 22 | facet_wrap(~COMMON_POPULATION_NAME) 23 | ``` 24 | 25 | 26 | -------------------------------------------------------------------------------- /tables/_Table_Counts.R: -------------------------------------------------------------------------------- 1 | ishtml <- knitr::is_html_output() 2 | ispdf <- knitr::is_latex_output() 3 | isword <- !ishtml & !ispdf 4 | 5 | fixcols <- function(x){ 6 | # fix _ and . in colname and make title format 7 | x <- stringr::str_replace_all(x, "_", " ") 8 | x <- stringr::str_replace_all(x, "[,]", " ") 9 | x <- stringr::str_to_title(x) 10 | x[x=="Esu"] <- "ESU" 11 | x[x=="Number Of Spawners"] <- "Spawners" 12 | x 13 | } 14 | 15 | wordnewpage <- 16 | '```{=openxml} 17 | 18 | ```' 19 | 20 | readTableCounts <- function(datafile){ 21 | filful <- here::here("data", datafile) 22 | modtime <- system(paste("git log -1 --format=%cd", filful), intern=TRUE) 23 | counts <- read.csv(filful, stringsAsFactors=FALSE) 24 | colnames(counts) <- fixcols(colnames(counts)) 25 | return(list(counts=counts, modtime=modtime)) 26 | } -------------------------------------------------------------------------------- /docs/site_libs/tabwid-1.1.3/tabwid.css: -------------------------------------------------------------------------------- 1 | .tabwid { 2 | font-size: initial; 3 | padding-bottom: 1em; 4 | } 5 | 6 | .tabwid table{ 7 | border-spacing:0px !important; 8 | border-collapse:collapse; 9 | line-height:1; 10 | margin-left:auto; 11 | margin-right:auto; 12 | border-width: 0; 13 | border-color: transparent; 14 | caption-side: top; 15 | } 16 | .tabwid-caption-bottom table{ 17 | caption-side: bottom; 18 | } 19 | .tabwid_left table{ 20 | margin-left:0; 21 | } 22 | .tabwid_right table{ 23 | margin-right:0; 24 | } 25 | .tabwid td, .tabwid th { 26 | padding: 0; 27 | } 28 | .tabwid a { 29 | text-decoration: none; 30 | } 31 | .tabwid thead { 32 | background-color: transparent; 33 | } 34 | .tabwid tfoot { 35 | background-color: transparent; 36 | } 37 | .tabwid table tr { 38 | background-color: transparent; 39 | } 40 | .katex-display { 41 | margin: 0 0 !important; 42 | } 43 | -------------------------------------------------------------------------------- /docs/site_libs/tabwid-1.1.3/tabwid.js: -------------------------------------------------------------------------------- 1 | document.addEventListener("DOMContentLoaded", function(event) { 2 | var els = document.querySelectorAll(".tabwid"); 3 | var tabwid_link = document.querySelector('link[href*="tabwid.css"]') 4 | if (tabwid_link === null) { 5 | const tabwid_styles = document.evaluate("//style[contains(., 'tabwid')]", document, null, XPathResult.ANY_TYPE, null ); 6 | tabwid_link = tabwid_styles.iterateNext(); 7 | } 8 | 9 | Array.prototype.forEach.call(els, function(template) { 10 | const dest = document.createElement("div"); 11 | template.parentNode.insertBefore(dest, template.nextSibling) 12 | dest.setAttribute("class", "flextable-shadow-host"); 13 | const fantome = dest.attachShadow({mode: 'open'}); 14 | fantome.appendChild(template); 15 | if (tabwid_link !== null) { 16 | fantome.appendChild(tabwid_link.cloneNode(true)); 17 | } 18 | }); 19 | }); 20 | 21 | -------------------------------------------------------------------------------- /tables/_common.R: -------------------------------------------------------------------------------- 1 | library(knitr) 2 | library(kableExtra) 3 | library(xtable) 4 | library(flextable) 5 | library(dplyr) 6 | 7 | ishtml <- knitr::is_html_output() 8 | ispdf <- knitr::is_latex_output() 9 | isword <- !ishtml & !ispdf 10 | if(ishtml) table.engine <- "kbl" 11 | if(isword) table.engine <- "flextable" 12 | if(ispdf) table.engine <- "kbl" 13 | 14 | myflextable <- function(x){ 15 | if(inherits(x, "data.frame")){ 16 | x <- flextable(x) 17 | } 18 | if(isword){ 19 | x <- x %>% font(fontname="Times New Roman", part="all") %>% 20 | fontsize(size=12) 21 | } 22 | n <- ncol_keys(x) 23 | x %>% 24 | autofit() %>% 25 | add_footer_row(values = "flextable", colwidths = n) 26 | } 27 | mykbl <- function(x, caption = NULL){ 28 | n <- ncol(x) 29 | x <- kbl(x, booktabs = TRUE, caption = caption) %>% 30 | kableExtra::footnote(general = "kable") %>% 31 | kable_styling(position = "center") 32 | if(n>8) kable_styling(x, latex_options = c("scale_down")) 33 | x 34 | } -------------------------------------------------------------------------------- /partials/before-body.tex: -------------------------------------------------------------------------------- 1 | 2 | 3 | \begin{frontmatter} 4 | 5 | \raggedleft % Right align the title page 6 | 7 | \rule{1pt}{\textheight} % Vertical line 8 | \hspace{0.05\textwidth} % Whitespace between the vertical line and title page text 9 | \parbox[b]{0.85\textwidth}{ % Paragraph box for holding the title page text, adjust the width to move the title page left or right on the page 10 | 11 | {\large\bfseries\nohyphens{$title$}}\\[2\baselineskip] % Title 12 | $if(subtitle)$ 13 | {\large\textit{$subtitle$}}\\[4\baselineskip] % Subtitle or further description 14 | $endif$ 15 | 16 | $if(by-author/allbutlast)$ 17 | $for(by-author/allbutlast)$ 18 | {\large{$by-author.name.literal$}}$sep$, 19 | $endfor$ 20 | $for(by-author/last)$ 21 | {and \large{$by-author.name.literal$}} 22 | $endfor$ 23 | $else$ 24 | ${by-author/last} 25 | $endif$ 26 | 27 | \vspace{0.5\textheight} % Whitespace between the title block and the publisher 28 | 29 | {\noindent The Publisher~~\plogo}\\[\baselineskip] % Publisher and logo 30 | } 31 | 32 | \end{frontmatter} -------------------------------------------------------------------------------- /tables/Table_qt.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Table qt" 3 | author: "EE Holmes" 4 | --- 5 | 6 | ```{r include=FALSE} 7 | knitr::opts_chunk$set(echo = FALSE, warning=FALSE, message=FALSE) 8 | library(gt) 9 | library(tidyverse) 10 | library(glue) 11 | 12 | ``` 13 | 14 | ```{r} 15 | # readTableCounts defined in _Table_Counts.R 16 | out <- readTableCounts("Lower_Columbia_River_Chinook.csv") 17 | modtime <- out$modtime 18 | counts <- out$counts 19 | ``` 20 | 21 | ```{r} 22 | #| label: tbl-qt 23 | #| tbl-cap: "Getting the auto-numbering to work is different with Quarto. See the code." 24 | 25 | # Define the start and end dates for the data range 26 | start_date <- "2010-06-07" 27 | end_date <- "2010-06-14" 28 | 29 | # Create a gt table based on preprocessed 30 | # `sp500` table data 31 | sp500 %>% 32 | filter(date >= start_date & date <= end_date) %>% 33 | select(-adj_close) %>% 34 | gt() %>% 35 | tab_header( 36 | title = "S&P 500", 37 | subtitle = glue("{start_date} to {end_date}") 38 | ) %>% 39 | fmt_date( 40 | columns = date, 41 | date_style = 3 42 | ) %>% 43 | fmt_currency( 44 | columns = c(open, high, low, close), 45 | currency = "USD" 46 | ) %>% 47 | fmt_number( 48 | columns = volume, 49 | suffixing = TRUE 50 | ) 51 | ``` -------------------------------------------------------------------------------- /partials/before-body-elsevier.tex: -------------------------------------------------------------------------------- 1 | 2 | \begin{frontmatter} 3 | \title{$title$} 4 | $for(by-author)$\author[$for(by-author.affiliations)$$it.number$$endfor$]{$by-author.name.literal$% 5 | $if(by-author.attributes.corresponding)$\corref{cor1}$endif$% 6 | $if(by-author.note.text)$\fnref{fn$by-author.note.number$}$endif$} 7 | $if(by-author.email)$ \ead{$by-author.email$} $endif$ 8 | $endfor$ 9 | $for(by-affiliation)$ 10 | \affiliation[$it.number$]{organization={$it.name$}, addressline={$it.address$}, city={$it.city$}, country={$it.country$}, postcode={$it.postal-code$}} 11 | 12 | $endfor$ 13 | 14 | \cortext[cor1]{Corresponding author} 15 | $for(by-author)$ 16 | $if(by-author.note.text)$\fntext[fn$by-author.note.number$]{$by-author.note.text$}$endif$ 17 | $endfor$ 18 | 19 | $if(abstract)$ 20 | \begin{abstract} 21 | $abstract$ 22 | \end{abstract} 23 | $endif$ 24 | 25 | $if(journal.graphical-abstract)$\begin{graphicalabstract} 26 | $journal.graphical-abstract$ 27 | \end{graphicalabstract} 28 | $endif$ 29 | 30 | $if(journal.highlights)$\begin{highlights} 31 | $for(journal.highlights)$\item $it$$endfor$ 32 | \end{highlights} 33 | $endif$ 34 | 35 | $if(keywords)$ 36 | \begin{keyword} 37 | $for(keywords/allbutlast)$$keywords$ \sep $endfor$ 38 | $for(keywords/last)$$keywords$$endfor$ 39 | \end{keyword} 40 | $endif$ 41 | \end{frontmatter} 42 | -------------------------------------------------------------------------------- /docs/site_libs/quarto-html/tippy.css: -------------------------------------------------------------------------------- 1 | .tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;white-space:normal;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:"";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1} -------------------------------------------------------------------------------- /tables/Table_Appendix.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Appendices of tables" 3 | --- 4 | 5 | 8 | 9 | ```{r include=FALSE} 10 | knitr::opts_chunk$set(echo = FALSE, warning=FALSE, message=FALSE) 11 | library(knitr) 12 | library(dplyr) # need this for %>% function 13 | library(flextable) 14 | ishtml <- knitr::is_html_output() 15 | ispdf <- knitr::is_latex_output() 16 | isword <- !ishtml & !ispdf 17 | ``` 18 | 19 | 21 | 22 | 24 | 25 | ```{r} 26 | # Set up 27 | nYr <- 2000:2010 28 | # So that I can later have many cvsfiles 29 | cvsfiles <- dir(here::here("data"), pattern = "\\.csv") 30 | ``` 31 | 32 | ```{r include=FALSE} 33 | out <- NULL 34 | for(cvsn in 1:2){ 35 | app.letter <- LETTERS[cvsn] 36 | cvsfile.to.use <- cvsfiles[cvsn] 37 | datafil <- here::here("data", cvsfile.to.use) 38 | tmp <- read.csv(datafil, stringsAsFactors=FALSE) 39 | ntbl <- tmp %>% distinct(COMMON_POPULATION_NAME) %>% nrow() 40 | 41 | for(table.num.to.print in 1:min(ntbl,2)){ 42 | out = c(out, knit_expand(here::here('tables', 'Appendix_single_table.Rmd'))) 43 | } 44 | } 45 | ``` 46 | `r paste(knit(text = out), collapse = '\n')` 47 | 48 | -------------------------------------------------------------------------------- /text/bibliography.bib: -------------------------------------------------------------------------------- 1 | % **************************************** 2 | % * File: SAMPLE.BIB * 3 | % **************************************** 4 | % * An invented bib file * 5 | % * For the sample texts * 6 | % * The order is unimportant and there * 7 | % * may be more entries than references * 8 | % * in the text * 9 | % **************************************** 10 | % 11 | @ARTICLE{smit54, 12 | AUTHOR = {J. G. Smith and H. K. Weston}, 13 | TITLE = {Nothing Particular in this Year's History}, 14 | YEAR = {1954}, 15 | JOURNAL = {J. Geophys. Res.}, 16 | VOLUME = {2}, 17 | PAGES = {14-15} 18 | } 19 | @BOOK{colu92, 20 | AUTHOR = {Christopher Columbus}, 21 | TITLE = {How {I} Discovered {America}}, 22 | YEAR = {1492}, 23 | PUBLISHER = {Hispanic Press}, 24 | ADDRESS = {Barcelona} 25 | } 26 | @ARTICLE{gree00, 27 | AUTHOR = {R. J. Green and U. P. Fred and W. P. Norbert}, 28 | TITLE = {Things that Go Bump in the Night}, 29 | YEAR = {1900}, 30 | JOURNAL = {Psych. Today}, 31 | VOLUME = {46}, 32 | PAGES = {345-678} 33 | } 34 | @ARTICLE{phil99, 35 | AUTHOR = {T. P. Phillips}, 36 | TITLE = {Possible Influence of the Magnetosphere on {American} History}, 37 | YEAR = {1999}, 38 | JOURNAL = {J. Oddball Res.}, 39 | VOLUME = {98}, 40 | PAGES = {1000-1003} 41 | } 42 | @ARTICLE{jame76, 43 | AUTHOR = {Kelly James and Harris, Jr., George and Wilby Wollops}, 44 | TITLE = {{American} Independence and Magnetism}, 45 | YEAR = {1776}, 46 | JOURNAL = {Revol. Tracts}, 47 | VOLUME = {32}, 48 | PAGES = {34-55} 49 | } -------------------------------------------------------------------------------- /tables/Table_flex.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Example flextable" 3 | author: "EE Holmes" 4 | output: 5 | html_document: 6 | df_print: paged 7 | word_document: 8 | reference_docx: here::here("template.dotx") 9 | --- 10 | 11 | 13 | 14 | ```{r warning=FALSE, echo=FALSE, message=FALSE} 15 | knitr::opts_chunk$set(echo = FALSE, warning=FALSE, message=FALSE) 16 | source(here::here("tables", "_common.R")) 17 | ``` 18 | 19 | 21 | 22 | 23 | ```{r} 24 | data(tli) 25 | library(flextable) 26 | fm3 <- glm(disadvg ~ ethnicty*grade, data = tli, family = binomial) 27 | ft <- as_flextable(xtable(anova(fm3)), hline.after = c(1)) 28 | ft <- ft %>% 29 | font(fontname="Times New Roman", part="all") %>% 30 | fontsize(size=12) 31 | ``` 32 | 33 | 34 | 35 | ```{r} 36 | #| label: tbl-flexchild 37 | #| tbl-cap: "This table is created in `Table_flex.Rmd`. flextable." 38 | ft 39 | ``` 40 | 41 | We can add a captions to a flextable with `set_caption` but then we won't have access to Quarto's cross-format (Word, HTML, PDF) cross-referencing engine. We can also use `tab.cap="caption"` in the chunk yaml but again we don't get the cross-referencing engine. 42 | 43 | ```{r eval=FALSE} 44 | #| echo: true 45 | set_caption(ft, 46 | caption = "a table caption with set_caption", 47 | style = "Table Caption") 48 | ``` 49 | 50 | -------------------------------------------------------------------------------- /preface.qmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: Preface 3 | --- 4 | 5 | ## Acknowledgements {.unlisted .unnumbered} 6 | 7 | Phasellus non diam posuere, laoreet velit sed, egestas felis. Etiam eget neque in tellus lacinia tincidunt. Pellentesque scelerisque odio velit, nec fringilla nibh iaculis non. Aenean sit amet nulla ipsum. Cras felis lacus, pulvinar ac nisi et, convallis pulvinar turpis. Morbi non nibh lacus. Morbi vitae lorem massa. Sed ut turpis vel felis posuere commodo lacinia ac mi. Donec finibus lectus sit amet elit finibus, vitae rhoncus ligula tincidunt. Phasellus vitae blandit lacus. Integer sed nisl fermentum, pulvinar mauris in, posuere enim. Proin sit amet semper urna. Vivamus aliquet rutrum diam ac luctus. 8 | 9 | ```{r include=FALSE} 10 | # include = FALSE means don't show code or any output (like warnings) 11 | # It is good to set up any knitr options that you want at the top of all your Rmds 12 | knitr::opts_chunk$set(echo = FALSE, warning=FALSE, message=FALSE) 13 | ``` 14 | 15 | 16 | 17 | ## Abstract {-} 18 | 19 | Phasellus non diam posuere, laoreet velit sed, egestas felis. Etiam eget neque in tellus lacinia tincidunt. Pellentesque scelerisque odio velit, nec fringilla nibh iaculis non. Aenean sit amet nulla ipsum. Cras felis lacus, pulvinar ac nisi et, convallis pulvinar turpis. Morbi non nibh lacus. Morbi vitae lorem massa. Sed ut turpis vel felis posuere commodo lacinia ac mi. Donec finibus lectus sit amet elit finibus, vitae rhoncus ligula tincidunt. Phasellus vitae blandit lacus. Integer sed nisl fermentum, pulvinar mauris in, posuere enim. Proin sit amet semper urna. Vivamus aliquet rutrum diam ac luctus. 20 | 21 | ```{=openxml} 22 | 23 | ``` 24 | 25 | 26 | -------------------------------------------------------------------------------- /_quarto.yml: -------------------------------------------------------------------------------- 1 | project: 2 | type: book 3 | output-dir: docs 4 | 5 | book: 6 | title: A Quarto Template Repo to Create Big Reports and Very Long Title Because Long Titles are Common 7 | subtitle: Some tips on creating reports with Quarto with a focus on tables and replicated tables and figures 8 | author: 9 | - name: Jane Doe 10 | affiliations: 11 | - name: University of XXX 12 | department: Department of YYY 13 | - name: Eva Nováková 14 | affiliations: 15 | - name: University of XXX 16 | department: Department of YYY 17 | - name: Matti Meikäläinen 18 | affiliations: 19 | - name: University of XXX 20 | department: Department of YYY 21 | chapters: 22 | - index.qmd 23 | - preface.qmd 24 | - text/tips.qmd 25 | - text/tables.qmd 26 | - text/tables_in_a_for_loop.qmd 27 | - text/kable_flex.qmd 28 | - text/figures.qmd 29 | - text/conclusion.qmd 30 | - references.qmd 31 | appendices: 32 | - text/appendix_tables.qmd 33 | 34 | site-url: https://rverse-tutorials.github.io/QmdReport/ 35 | repo-url: https://github.com/RVerse-Tutorials/QmdReport 36 | repo-actions: [edit, source, issue] 37 | search: true 38 | downloads: [pdf, docx] 39 | 40 | bibliography: references.bib 41 | 42 | execute: 43 | echo: false 44 | code-overflow: wrap 45 | 46 | format: 47 | docx: 48 | toc: true 49 | reference-doc: template.docx 50 | always_allow_html: true 51 | html: 52 | theme: cosmo 53 | toc: true 54 | code-fold: true 55 | code-tools: true 56 | pdf: 57 | documentclass: scrbook 58 | classoption: ["oneside"] 59 | template-partials: ["partials/before-body.tex"] 60 | keep-tex: true 61 | toc: true 62 | lof: true 63 | lot: true 64 | include-in-header: 65 | - partials/inheader.tex 66 | geometry: 67 | - a4paper 68 | 69 | 70 | -------------------------------------------------------------------------------- /docs/sitemap.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | https://rverse-tutorials.github.io/QmdReport/index.html 5 | 2023-04-27T00:18:55.127Z 6 | 7 | 8 | https://rverse-tutorials.github.io/QmdReport/preface.html 9 | 2023-04-27T00:18:55.131Z 10 | 11 | 12 | https://rverse-tutorials.github.io/QmdReport/text/tips.html 13 | 2023-04-27T00:18:55.139Z 14 | 15 | 16 | https://rverse-tutorials.github.io/QmdReport/text/tables.html 17 | 2023-04-27T00:18:55.150Z 18 | 19 | 20 | https://rverse-tutorials.github.io/QmdReport/text/tables_in_a_for_loop.html 21 | 2023-04-27T00:18:55.157Z 22 | 23 | 24 | https://rverse-tutorials.github.io/QmdReport/text/kable_flex.html 25 | 2023-04-27T00:18:55.172Z 26 | 27 | 28 | https://rverse-tutorials.github.io/QmdReport/text/figures.html 29 | 2023-04-27T00:18:55.177Z 30 | 31 | 32 | https://rverse-tutorials.github.io/QmdReport/text/conclusion.html 33 | 2023-04-27T00:18:55.180Z 34 | 35 | 36 | https://rverse-tutorials.github.io/QmdReport/references.html 37 | 2023-04-27T00:18:55.182Z 38 | 39 | 40 | https://rverse-tutorials.github.io/QmdReport/text/appendix_tables.html 41 | 2023-04-27T00:18:55.188Z 42 | 43 | 44 | https://rverse-tutorials.github.io/QmdReport/A-Quarto-Template-Repo-to-Create-Big-Reports-and-Very-Long-Title-Because-Long-Titles-are-Common.docx 45 | 2023-04-27T00:18:50.214Z 46 | 47 | 48 | https://rverse-tutorials.github.io/QmdReport/A-Quarto-Template-Repo-to-Create-Big-Reports-and-Very-Long-Title-Because-Long-Titles-are-Common.pdf 49 | 2023-04-27T00:18:54.743Z 50 | 51 | 52 | -------------------------------------------------------------------------------- /text/tables_in_a_for_loop.qmd: -------------------------------------------------------------------------------- 1 | --- 2 | always_allow_html: true 3 | --- 4 | # Tables in a for loop 5 | 6 | ```{r warning=FALSE, echo=FALSE, message=FALSE} 7 | knitr::opts_chunk$set(echo = FALSE, warning=FALSE, message=FALSE) 8 | source(here::here("tables", "_common.R")) 9 | ``` 10 | 11 | 12 | Outputting tables (or figure) in a for loop works fine in Quarto, but there is no way to set the table numbers dynamically and get all the cross-references working in Word, HTML and PDF. We really need that dynamic numbering and cross-reference feature in a big report. 13 | 14 | ## Example of tables produced in a for loop 15 | 16 | Look at the Code (link at top in HTML output) to see the `cat(knitr::knit_print(tab))` trick for getting your tables to appear. 17 | 18 | ```{r results='asis'} 19 | for(cyl in c(4,8)){ 20 | val <- paste("Cars with", cyl, "cylinders.") 21 | dt <- mtcars[,1:4] %>% 22 | filter(cyl == cyl) %>% 23 | head(2) 24 | if(table.engine=="flextable") 25 | tab <- myflextable(dt) %>% 26 | set_caption(paste(val, "We can set a caption but no way to cross-reference it")) 27 | if(table.engine=="kbl") 28 | tab <- mykbl(dt, caption = "We can set a caption but no way to cross-reference it") 29 | cat(knitr::knit_print(tab)) 30 | } 31 | ``` 32 | 33 | ## Getting the cross-reference links 34 | 35 | We have to use a bit of magic to get our dynamic table numbers and links using Quarto's cross-referencing. The trick is to use a child Rmd (or qmd) in a for loop. This trick can be used for figures too but I'll just show it here with tables. This code inspired from [this gist](https://gist.github.com/rmoff/a043676a2f084b81a434). 36 | 37 | We use `knit_expand()` and make a child Rmd that uses double curly braces like `{{value.to.match}}` in the code. That way the value at the time this Rmd was embedded can be referenced. Note that if `value.to.match` were a string (which it is not in this example), we would need to add quotes around `{{value.to.match}}` in our code. 38 | 39 | With this approach we get our numbered tables and we can reference the tables usual such as @tbl-cyl8 (note this is broken in Word output). Click on the Code link at top (HTML output) to see how it's done. 40 | 41 | ```{r include=FALSE} 42 | #| echo: true 43 | out = NULL 44 | for (value.to.match in c(4,8)) { 45 | out = c(out, knit_expand(here::here('tables', 'Table_for_child.Rmd'))) 46 | } 47 | ``` 48 | `r paste(knit(text = out), collapse = '\n')` 49 | 50 | ```{=openxml} 51 | 52 | ``` 53 | -------------------------------------------------------------------------------- /text/conclusion.qmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: Conclusion 3 | --- 4 | 5 | ## First off 6 | 7 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam commodo sit amet nibh non molestie. Maecenas hendrerit nisl velit, a condimentum enim lobortis sit amet. Ut vitae nunc sed mauris condimentum fermentum. Mauris pellentesque nec neque id elementum. Suspendisse a quam aliquam, facilisis urna venenatis, malesuada diam. Pellentesque in fringilla orci. Cras sed purus urna. Ut pharetra enim ut ligula egestas mattis. 8 | 9 | 10 | 11 | Phasellus non diam posuere, laoreet velit sed, egestas felis. Etiam eget neque in tellus lacinia tincidunt. Pellentesque scelerisque odio velit, nec fringilla nibh iaculis non. Aenean sit amet nulla ipsum. Cras felis lacus, pulvinar ac nisi et, convallis pulvinar turpis. Morbi non nibh lacus. Morbi vitae lorem massa. Sed ut turpis vel felis posuere commodo lacinia ac mi. Donec finibus lectus sit amet elit finibus, vitae rhoncus ligula tincidunt. Phasellus vitae blandit lacus. Integer sed nisl fermentum, pulvinar mauris in, posuere enim. Proin sit amet semper urna. Vivamus aliquet rutrum diam ac luctus. 12 | 13 | Quisque in nibh sit amet nunc mollis porttitor quis et mauris. Sed non condimentum leo, ac condimentum est. Duis ac venenatis nulla, et aliquet elit. Suspendisse potenti. Duis mollis dui at semper luctus. Maecenas euismod finibus condimentum. Fusce vitae gravida massa. Mauris metus est, pretium non semper vel, dictum vel augue. 14 | 15 | Curabitur tempus, leo quis volutpat rhoncus, turpis elit vehicula dolor, id tincidunt augue nunc at enim. In vel enim mattis, varius orci at, tempus ante. Morbi massa elit, pharetra ac libero at, porta tempus quam. Ut fringilla, tortor ac tristique euismod, magna felis vestibulum turpis, quis congue mauris leo nec felis. Aliquam viverra et nibh ut blandit. Praesent sed luctus odio. Pellentesque finibus velit dolor. Morbi ac pulvinar ex, id dapibus eros. Cras interdum arcu viverra auctor tristique. Suspendisse venenatis volutpat ultricies. 16 | 17 | Donec bibendum pharetra arcu vitae porttitor. Morbi ac quam nunc. Ut cursus dolor a mauris aliquet vulputate. Morbi elementum ullamcorper augue, et tincidunt libero facilisis posuere. Nam congue velit non elit sollicitudin aliquet. Donec lobortis nunc ligula, id sollicitudin erat rhoncus cursus. Ut egestas orci libero, eu malesuada ex sollicitudin sed. Sed ornare nunc eget massa scelerisque, nec egestas nulla commodo. Pellentesque efficitur accumsan ullamcorper. Nulla facilisi. Maecenas tristique luctus malesuada. Phasellus id enim maximus, tempus tellus eu, dignissim sapien. Integer et mauris in lectus condimentum pellentesque non a felis. 18 | 19 | ```{=openxml} 20 | 21 | ``` 22 | 23 | 24 | -------------------------------------------------------------------------------- /index.qmd: -------------------------------------------------------------------------------- 1 | # Open Issues 2 | 3 | ## April 26, 2023 update 4 | 5 | * Everything broken in the Aug 13, 2022 update is still broken. 6 | * flextable cross-refs and captions are still not working in Word output 7 | * The flextable 0.9.1 CRAN release broke PDF output in Quarto books. Known problem and fixed in the development version on GitHub (0.9.2) `devtools::install_github("davidgohel/flextable")` 8 | * gt (v0.9.0) cross-refs still broken in Word 9 | 10 | ## Aug 13, 2022 update 11 | 12 | I have mostly figured out workarounds for the table package issues. The remaining big issues are 13 | 14 | * For HTML, if you have two chapters (h1 level) in a single qmd it totally messes up the TOC. Word and PDF converters seem to figure it out ok and number things correctly. 15 | - I posted an issue https://github.com/quarto-dev/quarto-cli/issues/1712 16 | - This is important because we often don't know how many appendix chapters we will need. These are dynamically created based on the data. There is no good way to know this ahead of time. These report templates are used across very different regions and each region has a different number of appendices based on the number of, say, species or cities or whatever, in the region. 17 | * When I have appendices so `appendices: ` in my YAML, the HTML TOC is messed up. 18 | - see https://rverse-tutorials.github.io/QmdReport/ and look at TOC 19 | - why doesn't the HTML figure out that the appendix A title is CRchum.csv?? Word and PDF figure that out. 20 | * When I have `appendices: `, the PDF TOC and levels look right, but if I click on "Appendices" in the TOC, I go to References. 21 | - Look here to see what I mean [PDF version]( https://rverse-tutorials.github.io/QmdReport/A-Quarto-Template-Repo-to-Create-Big-Reports-and-Very-Long-Title-Because-Long-Titles-are-Common.pdf) 22 | - I would like to be able to have a `appendices.qmd` that I would go to. Maybe I can. I haven't tried. 23 | * No merge and knit option. :( so no memory across chapters. That is a "feature" in many cases but some report writers use memory across chapters heavily. 24 | 25 | ## Aug 11, 2022 update 26 | 27 | * flextable cross-refs don't work in pdf but kableExtra tables work and look better in some ways. So I use kableExtra for pdf's. 28 | * flextable is best for Word but cross-refs are broken. The Quarto dev team knows about the problem. 29 | * The Quarto {{include filename}} option for including files seems very limited or I don't know how to use it (most definitely true). The file has to be in same folder as the qmd that calls it. 30 | * The Quarto {{include filename}} breaks if the thing you call is calling `knit_expand()`. Why? So weird. I might be doing something wrong. 31 | * No merge and knit option. :( no sharing of variables across chapters 32 | * Can't have two chapters (h1 level) in a single qmd so can't dynamically create chapters (one qmd with many h1 levels where that qmd is created dynamically) 33 | * {gt} package and PDF table numbering don't mix! Breaks all numbering after a single `gt()` call. *Update. Fixed in the new gt update* 34 | 35 | ## Citation {.unnumbered} 36 | 37 | EE Holmes, 2022. Quarto Report Template. Northwest Fisheries Science Center. 38 | 39 | 40 | ```{=openxml} 41 | 42 | ``` 43 | -------------------------------------------------------------------------------- /text/tables.qmd: -------------------------------------------------------------------------------- 1 | --- 2 | always_allow_html: true 3 | --- 4 | 5 | ```{r warning=FALSE, echo=FALSE, message=FALSE} 6 | knitr::opts_chunk$set(echo = FALSE, warning=FALSE, message=FALSE) 7 | source(here::here("tables", "_common.R")) 8 | ``` 9 | 10 | # Tables intro 11 | 12 | This chapter shows a few simple examples of including tables and getting cross-referencing to work across formats (HTML, Word, PDF). See @sec-kableflexgt for more examples and comparisons of different table outputs. 13 | 14 | In this chapter, I am going to use {flextable} for Word and HTML and {kabelExtra} for PDF. See @sec-kableflexgt for a comparison of {flextable}, {kableExtra} and {gt}. There is a current problem that Quarto is not processing the cross-references with {flextable} into PDF and Word. But this is a known problem and they are working on it. {flextable} is the only table package that I have found the tends to work as expected across platforms. The {officer} package uses it so it works well with Word and works well with LaTeX. 15 | 16 | *Note, I am using some customized functions to be able have a uniform look for my tables. These are in `tables/_common.R`. 17 | 18 | 19 | ## Example table 20 | 21 | This is an example a table. We can reference @tbl-example (note this is broken in Word output) easily and it is auto-numbered. 22 | 23 | ```{r} 24 | #| label: tbl-example 25 | #| tbl-cap: "This is a simple table." 26 | dt <- mtcars[1:10, 1:6] 27 | if(table.engine=="flextable") myflextable(dt) 28 | if(table.engine=="kbl") mykbl(dt) 29 | ``` 30 | 31 | ## Including table files 32 | 33 | It is often good to have your files in separate files so that when you edit your tables, you only have to work on the table code. 34 | 35 | ````markdown 36 | `r ''````{r child=here::here("tables", "Table_flex.Rmd")} 37 | ``` 38 | ```` 39 | 40 | ```{r child=here::here("tables", "Table_flex.Rmd")} 41 | ``` 42 | 43 | 44 | ## Cross-references 45 | 46 | In Quarto, [table links](https://quarto.org/docs/authoring/cross-references.html#tables) use the table label `@tbl-tablabel` where `tablabel` is the label you put on the table chunk. In the text it looks like this @tbl-tablabel (note this is broken in Word output). The chunk yaml looks like this 47 | 48 | ``` 49 | #| label: tbl-tablabel 50 | #| tbl-cap: "my caption" 51 | ``` 52 | 53 | ```{r} 54 | #| label: tbl-tablabel 55 | #| tbl-cap: "This is a table with a number." 56 | tt <- ts(cumsum(1 + round(rnorm(100), 0)), 57 | start = c(1954, 7), frequency = 12) 58 | Month <- factor(cycle(tt), levels = 1:12, labels = month.abb) 59 | dt <- as.data.frame(tapply(tt, list(year = floor(time(tt)), month = Month), c)) 60 | dt <- dt %>% tibble::rownames_to_column("Year") 61 | if(table.engine=="flextable") myflextable(dt) 62 | if(table.engine=="kbl") mykbl(dt) 63 | ``` 64 | 65 | ## Dynamic table captions 66 | 67 | You can create captions dynamically. 68 | 69 | ```{r} 70 | #| echo: true 71 | dt <- mtcars[1:10, 1:6] 72 | tbl_cap <- paste("This is a dynamically created caption. The length of mtcars is", nrow(mtcars), "rows. Here we show", nrow(dt), "rows.") 73 | ``` 74 | 75 | Unfortunately you cannot dynamically create your chunk labels too. 76 | 77 | ```{r} 78 | #| label: tbl-test3 79 | #| tbl-cap: !expr tbl_cap 80 | if(table.engine=="flextable") myflextable(dt) 81 | if(table.engine=="kbl") mykbl(dt) 82 | ``` 83 | 84 | -------------------------------------------------------------------------------- /tables/Appendix_single_table.Rmd: -------------------------------------------------------------------------------- 1 | 2 | ```{r include=FALSE} 3 | knitr::opts_chunk$set(echo = FALSE, warning=FALSE, message=FALSE) 4 | require(knitr) 5 | require(dplyr) # need this for %>% function 6 | require(flextable) 7 | # this defines myflextable, mykbl, table.engine, ishtml 8 | source(here::here("tables", "_common.R")) 9 | ``` 10 | 11 | 12 | ```{r} 13 | # Just to make debugging easier 14 | tbl <- {{table.num.to.print}} 15 | csvfile <- "{{cvsfile.to.use}}" 16 | datafil <- here::here("data", csvfile) 17 | counts <- read.csv(datafil, stringsAsFactors=FALSE) 18 | modtime <- system(paste("git log -1 --format=%cd", datafil), intern=TRUE) 19 | ``` 20 | 21 | ```{r results='asis'} 22 | if(tbl==1) cat("# ", csvfile, "\n\n") 23 | ``` 24 | 25 | 26 | ```{r} 27 | fixcols <- function(x){ 28 | # fix _ and . in colname and make title format 29 | x <- stringr::str_replace_all(x, "_", " ") 30 | x <- stringr::str_replace_all(x, "[,]", " ") 31 | x <- stringr::str_to_title(x) 32 | x[x=="Esu"] <- "ESU" 33 | x[x=="Number Of Spawners"] <- "Spawners" 34 | x 35 | } 36 | ``` 37 | 38 | 39 | 40 | ```{r} 41 | wordnewpage <- 42 | '```{=openxml} 43 | 44 | ```' 45 | ``` 46 | 47 | 48 | 49 | ```{r} 50 | colnames(counts) <- fixcols(colnames(counts)) 51 | ``` 52 | 53 | 54 | 55 | ```{r} 56 | # These are all flextable functions 57 | tablecount <- function(data, cols="Spawners"){ 58 | dat <- data[, c("Year", cols)] 59 | f1 <- paste("** data file:", csvfile, "mod date:", modtime) 60 | f2 <- "* These spawner counts are from river redd surveys." 61 | if(table.engine=="flextable"){ 62 | tab <- dat %>% 63 | myflextable() %>% 64 | autofit() %>% 65 | add_footer(., Year = f2) %>% 66 | merge_at(., i = 1, j = 1:ncol(dat), part = "footer") %>% 67 | add_footer(., Year = f1) %>% 68 | merge_at(., i = 1, j = 1:ncol(dat), part = "footer") %>% 69 | colformat_num(., j=1, big.mark = "", na_str = "NA") %>% 70 | font(fontname="Times New Roman", part="all") %>% 71 | fontsize(size=10) %>% 72 | line_spacing(space = 1.0, part = "all") 73 | } 74 | if(table.engine=="kbl"){ 75 | tab <- 76 | dat %>% 77 | mykbl() %>% 78 | kableExtra::add_footnote(c(f1, f2), notation="none") 79 | } 80 | tab 81 | } 82 | ``` 83 | 84 | 85 | ```{r} 86 | popname <- unique(counts$`Common Population Name`)[tbl] 87 | dat <- subset(counts, `Common Population Name`==popname & Year %in% nYr) 88 | tbl_cap <- paste0("Spawners and fracwild from ", popname, " for ", min(dat$Year), " to ", max(dat$Year), ". ") 89 | ``` 90 | 91 | 92 | 93 | ```{r results='asis'} 94 | if(ishtml) cat("## ", popname, "\n\n") 95 | ``` 96 | 97 | ```{r} 98 | #| label: tbl-app{{app.letter}}{{table.num.to.print}} 99 | #| tbl-cap: !expr tbl_cap 100 | col <- c("Spawners", "Fracwild") 101 | tab <- tablecount(dat, cols=col) 102 | tab 103 | ``` 104 | 105 | ```{r results='asis'} 106 | if(isword) cat("\n", wordnewpage, "\n") 107 | if(ispdf) cat("\\newpage") 108 | ``` 109 | -------------------------------------------------------------------------------- /text/kable_flex.qmd: -------------------------------------------------------------------------------- 1 | --- 2 | always_allow_html: true 3 | --- 4 | 5 | ```{r warning=FALSE, echo=FALSE, message=FALSE} 6 | knitr::opts_chunk$set(echo = FALSE, warning=FALSE, message=FALSE) 7 | source(here::here("tables", "_common.R")) 8 | ``` 9 | 10 | # Kable vs Flex vs qt {#sec-kableflexgt} 11 | 12 | Here I compare a three different ways to make tables. Unfortunately the table numbers and cross-references are still not working as of Quarto version 1.2.335 (Feb 2023), but the developers are aware and a major revamp of cross-referencing is in the works to fix these problems. 13 | 14 | ```{r} 15 | tbl_cap <- "This should have a number that follows the other tables." 16 | dt <- (mtcars[1:10,]) 17 | f1 <- "Here is a footnote about this table" 18 | f2 <- "Here is a second footnote." 19 | ``` 20 | 21 | ## Kable 22 | 23 | Here is the {kable} table @tbl-kable. Word output is often not good looking. This is a known issue with `kable`. 24 | 25 | ```{r} 26 | #| label: tbl-kable 27 | #| tbl-cap: !expr paste("kable:", tbl_cap) 28 | #| echo: true 29 | library(knitr) 30 | library(kableExtra) 31 | # note hold_position not working in Quarto v1.0.38. 32 | kbl(dt, booktabs = TRUE) %>% 33 | kable_styling(latex_options = c("scale_down")) %>% 34 | kableExtra::footnote(symbol = c(f1, f2)) 35 | ``` 36 | 37 | ### `kable` quirks 38 | 39 | - Make sure to put `always_allow_html: true` in the yaml at the top of your Rmd or qmd file if outputting to Word. I can't figure out how to put it in the \` 40 | - Word output is often not good looking. This is a known issue with `kable` 41 | - Do not pass in caption to `kbl()` if you want to use Quarto's cross-reference engine. 42 | - `kbl(..., format="pandoc")` can help for Word if your templates stop working but destroys the PDF output. 43 | 44 | ## `flextable` 45 | 46 | Here is the {flextable} table @tbl-flex (note this is broken in Word output). {flextable} gives you a lot more control over your tables with a grammar format (like ggplot2). It also gives nice output to Word, PDF and HTML. Sadly in Quarto v1.2.335 cross-reference and table numbers for Word is broken, but the developers know about this. The {officer} package, which I think Quarto is leaning on for Word generation, use {flextable} so I am hoping that {flextable} gets moved into the RStudio suite. 47 | 48 | ```{r} 49 | #| label: tbl-flex 50 | #| tbl-cap: !expr paste("flextable:", tbl_cap) 51 | #| echo: true 52 | library(flextable) 53 | dt %>% 54 | flextable() %>% 55 | autofit() %>% 56 | flextable::footnote(i = 1, j = 1:2, 57 | value = as_paragraph(c(f1, f2)), 58 | ref_symbols = c("a", "b"), 59 | part = "header") %>% 60 | font(fontname="Times New Roman", part="all") %>% 61 | fontsize(size=12) 62 | ``` 63 | 64 | ### `flextable` quirks 65 | 66 | - Table numbers and cross-refs broken in Word. Known issue. 67 | 68 | ## `gt` 69 | 70 | Here is the {gt} table @tbl-gt (note this is broken in Word output). {gt} has many of the same features as {flextable} and is in the RStudio suite so maybe it'll get more Quarto support in the long run. But like {kable}, the Word output is not good. In addition, currently table captions are broken in Quarto Word output. 71 | 72 | 73 | ```{r} 74 | #| label: tbl-gt 75 | #| tbl-cap: !expr paste("gt:", tbl_cap) 76 | #| echo: true 77 | dt %>% 78 | gt::gt() %>% 79 | gt::tab_source_note(source_note = f1) %>% 80 | gt::tab_source_note(source_note = f2) %>% 81 | gt::tab_options( 82 | table.font.size = gt::px(18), 83 | table.font.names = "Times New Roman", 84 | data_row.padding = gt::px(1)) 85 | ``` 86 | 87 | ### `gt` quirks 88 | 89 | - I couldn't get {gt} to respect my font request for HTML unlike for {flextable} 90 | - The footnotes look bad in Word. But I don't know {gt} so probably my error. 91 | - Table captions and numbers broken in Word. 92 | 93 | ```{=openxml} 94 | 95 | ``` 96 | -------------------------------------------------------------------------------- /docs/site_libs/quarto-html/quarto-syntax-highlighting.css: -------------------------------------------------------------------------------- 1 | /* quarto syntax highlight colors */ 2 | :root { 3 | --quarto-hl-ot-color: #003B4F; 4 | --quarto-hl-at-color: #657422; 5 | --quarto-hl-ss-color: #20794D; 6 | --quarto-hl-an-color: #5E5E5E; 7 | --quarto-hl-fu-color: #4758AB; 8 | --quarto-hl-st-color: #20794D; 9 | --quarto-hl-cf-color: #003B4F; 10 | --quarto-hl-op-color: #5E5E5E; 11 | --quarto-hl-er-color: #AD0000; 12 | --quarto-hl-bn-color: #AD0000; 13 | --quarto-hl-al-color: #AD0000; 14 | --quarto-hl-va-color: #111111; 15 | --quarto-hl-bu-color: inherit; 16 | --quarto-hl-ex-color: inherit; 17 | --quarto-hl-pp-color: #AD0000; 18 | --quarto-hl-in-color: #5E5E5E; 19 | --quarto-hl-vs-color: #20794D; 20 | --quarto-hl-wa-color: #5E5E5E; 21 | --quarto-hl-do-color: #5E5E5E; 22 | --quarto-hl-im-color: #00769E; 23 | --quarto-hl-ch-color: #20794D; 24 | --quarto-hl-dt-color: #AD0000; 25 | --quarto-hl-fl-color: #AD0000; 26 | --quarto-hl-co-color: #5E5E5E; 27 | --quarto-hl-cv-color: #5E5E5E; 28 | --quarto-hl-cn-color: #8f5902; 29 | --quarto-hl-sc-color: #5E5E5E; 30 | --quarto-hl-dv-color: #AD0000; 31 | --quarto-hl-kw-color: #003B4F; 32 | } 33 | 34 | /* other quarto variables */ 35 | :root { 36 | --quarto-font-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; 37 | } 38 | 39 | pre > code.sourceCode > span { 40 | color: #003B4F; 41 | } 42 | 43 | code span { 44 | color: #003B4F; 45 | } 46 | 47 | code.sourceCode > span { 48 | color: #003B4F; 49 | } 50 | 51 | div.sourceCode, 52 | div.sourceCode pre.sourceCode { 53 | color: #003B4F; 54 | } 55 | 56 | code span.ot { 57 | color: #003B4F; 58 | font-style: inherit; 59 | } 60 | 61 | code span.at { 62 | color: #657422; 63 | font-style: inherit; 64 | } 65 | 66 | code span.ss { 67 | color: #20794D; 68 | font-style: inherit; 69 | } 70 | 71 | code span.an { 72 | color: #5E5E5E; 73 | font-style: inherit; 74 | } 75 | 76 | code span.fu { 77 | color: #4758AB; 78 | font-style: inherit; 79 | } 80 | 81 | code span.st { 82 | color: #20794D; 83 | font-style: inherit; 84 | } 85 | 86 | code span.cf { 87 | color: #003B4F; 88 | font-style: inherit; 89 | } 90 | 91 | code span.op { 92 | color: #5E5E5E; 93 | font-style: inherit; 94 | } 95 | 96 | code span.er { 97 | color: #AD0000; 98 | font-style: inherit; 99 | } 100 | 101 | code span.bn { 102 | color: #AD0000; 103 | font-style: inherit; 104 | } 105 | 106 | code span.al { 107 | color: #AD0000; 108 | font-style: inherit; 109 | } 110 | 111 | code span.va { 112 | color: #111111; 113 | font-style: inherit; 114 | } 115 | 116 | code span.bu { 117 | font-style: inherit; 118 | } 119 | 120 | code span.ex { 121 | font-style: inherit; 122 | } 123 | 124 | code span.pp { 125 | color: #AD0000; 126 | font-style: inherit; 127 | } 128 | 129 | code span.in { 130 | color: #5E5E5E; 131 | font-style: inherit; 132 | } 133 | 134 | code span.vs { 135 | color: #20794D; 136 | font-style: inherit; 137 | } 138 | 139 | code span.wa { 140 | color: #5E5E5E; 141 | font-style: italic; 142 | } 143 | 144 | code span.do { 145 | color: #5E5E5E; 146 | font-style: italic; 147 | } 148 | 149 | code span.im { 150 | color: #00769E; 151 | font-style: inherit; 152 | } 153 | 154 | code span.ch { 155 | color: #20794D; 156 | font-style: inherit; 157 | } 158 | 159 | code span.dt { 160 | color: #AD0000; 161 | font-style: inherit; 162 | } 163 | 164 | code span.fl { 165 | color: #AD0000; 166 | font-style: inherit; 167 | } 168 | 169 | code span.co { 170 | color: #5E5E5E; 171 | font-style: inherit; 172 | } 173 | 174 | code span.cv { 175 | color: #5E5E5E; 176 | font-style: italic; 177 | } 178 | 179 | code span.cn { 180 | color: #8f5902; 181 | font-style: inherit; 182 | } 183 | 184 | code span.sc { 185 | color: #5E5E5E; 186 | font-style: inherit; 187 | } 188 | 189 | code span.dv { 190 | color: #AD0000; 191 | font-style: inherit; 192 | } 193 | 194 | code span.kw { 195 | color: #003B4F; 196 | font-style: inherit; 197 | } 198 | 199 | .prevent-inlining { 200 | content: "s.tolerance[a.direction],e(a),l=t,i=!1}function h(){i||(i=!0,n=requestAnimationFrame(c))}var u=!!o&&{passive:!0,capture:!1};return t.addEventListener("scroll",h,u),c(),{destroy:function(){cancelAnimationFrame(n),t.removeEventListener("scroll",h,u)}}}function o(t){return t===Object(t)?t:{down:t,up:t}}function s(t,n){n=n||{},Object.assign(this,s.options,n),this.classes=Object.assign({},s.options.classes,n.classes),this.elem=t,this.tolerance=o(this.tolerance),this.offset=o(this.offset),this.initialised=!1,this.frozen=!1}return s.prototype={constructor:s,init:function(){return s.cutsTheMustard&&!this.initialised&&(this.addClass("initial"),this.initialised=!0,setTimeout(function(t){t.scrollTracker=n(t.scroller,{offset:t.offset,tolerance:t.tolerance},t.update.bind(t))},100,this)),this},destroy:function(){this.initialised=!1,Object.keys(this.classes).forEach(this.removeClass,this),this.scrollTracker.destroy()},unpin:function(){!this.hasClass("pinned")&&this.hasClass("unpinned")||(this.addClass("unpinned"),this.removeClass("pinned"),this.onUnpin&&this.onUnpin.call(this))},pin:function(){this.hasClass("unpinned")&&(this.addClass("pinned"),this.removeClass("unpinned"),this.onPin&&this.onPin.call(this))},freeze:function(){this.frozen=!0,this.addClass("frozen")},unfreeze:function(){this.frozen=!1,this.removeClass("frozen")},top:function(){this.hasClass("top")||(this.addClass("top"),this.removeClass("notTop"),this.onTop&&this.onTop.call(this))},notTop:function(){this.hasClass("notTop")||(this.addClass("notTop"),this.removeClass("top"),this.onNotTop&&this.onNotTop.call(this))},bottom:function(){this.hasClass("bottom")||(this.addClass("bottom"),this.removeClass("notBottom"),this.onBottom&&this.onBottom.call(this))},notBottom:function(){this.hasClass("notBottom")||(this.addClass("notBottom"),this.removeClass("bottom"),this.onNotBottom&&this.onNotBottom.call(this))},shouldUnpin:function(t){return"down"===t.direction&&!t.top&&t.toleranceExceeded},shouldPin:function(t){return"up"===t.direction&&t.toleranceExceeded||t.top},addClass:function(t){this.elem.classList.add.apply(this.elem.classList,this.classes[t].split(" "))},removeClass:function(t){this.elem.classList.remove.apply(this.elem.classList,this.classes[t].split(" "))},hasClass:function(t){return this.classes[t].split(" ").every(function(t){return this.classList.contains(t)},this.elem)},update:function(t){t.isOutOfBounds||!0!==this.frozen&&(t.top?this.top():this.notTop(),t.bottom?this.bottom():this.notBottom(),this.shouldUnpin(t)?this.unpin():this.shouldPin(t)&&this.pin())}},s.options={tolerance:{up:0,down:0},offset:0,scroller:t()?window:null,classes:{frozen:"headroom--frozen",pinned:"headroom--pinned",unpinned:"headroom--unpinned",top:"headroom--top",notTop:"headroom--not-top",bottom:"headroom--bottom",notBottom:"headroom--not-bottom",initial:"headroom"}},s.cutsTheMustard=!!(t()&&function(){}.bind&&"classList"in document.documentElement&&Object.assign&&Object.keys&&requestAnimationFrame),s}); 8 | -------------------------------------------------------------------------------- /text/tips.qmd: -------------------------------------------------------------------------------- 1 | # Tips 2 | 3 | 4 | ## Overview 5 | 6 | ```{r} 7 | #| label: "fig-chinook" 8 | #| fig-cap: "chapter 1 plot" 9 | plot(pressure) 10 | ``` 11 | 12 | 13 | 14 | ## General set-up 15 | 16 | * Be as modular and simple as you can. 17 | 18 | * Don't make everyone in your team be the markdown wizard. You only need one person to build the framework. 19 | * Use simple child Rmds so that other team members work only on simple Rmd/qmd flat files. 20 | * Don't put all your tables or figures in one huge file: `Table xyz.Rmd/qmd`, `Table abc.Rmd/qmd`. Have your dedicated markdown wizard figure out the automatic numbering. 21 | * Copy reports built by others who are doing something similar to you. TALK within your center or across centers and share work. 22 | 23 | ## Tips 24 | 25 | ### Cross-references 26 | 27 | This can be really troublesome unless you use an output that already has cross-references as part of the design. For R Markdown, 28 | 29 | * {bookdown} outputs for html and PDF 30 | * {officedown} for Word 31 | 32 | These output formats give you access to cross-referencing via the `\@ref(xxx:yyy)` format and if you use `bookdown::pdf_book`, this will also work with PDF. 33 | 34 | However, Quarto makes cross-references, auto-numbering and cross-referencing of tables and figures super easy. [Quarto cross-ref page](https://quarto.org/docs/authoring/cross-references.html). 35 | 36 | For example, we can make a figure with the chunk label `fig-plot` like so. 37 | 38 | ````{verbatim} 39 | ```{r} 40 | #| label: fig-plot 41 | #| fig-cap: "Plot" 42 | 43 | plot(cars) 44 | ``` 45 | ```` 46 | 47 | The later in the text we use `@fig-plot` to get @fig-plot. 48 | 49 | ```{r echo=FALSE} 50 | #| label: fig-plot 51 | #| fig-cap: "This is a plot of some data" 52 | 53 | plot(cars) 54 | ``` 55 | 56 | 57 | ### Chunk labels 58 | 59 | * When using R Markdown (or Quarto), it is best not to use chunk labels in the your Rmd/qmd children. It's too easy to get duplicate labels accidentally. 60 | 61 | ### File paths 62 | 63 | * if you need to reference a file in a folder, let R create the path so that it is compatible across systems: 64 | ``` 65 | file.path('figures', 'figure1.Rmd') 66 | ``` 67 | * I typically use the {here} package so that my code doesn't break if I happen to issue a change workspace directory command. 68 | ``` 69 | here::here('images', 'logo.png') 70 | ``` 71 | 72 | ### Tables in for loops 73 | 74 | Making tables within `for` loops is tricky and it is different if you are outputting to Word versus html and also depends on what package that you use. See my Rmd/qmd files in the tables folder for examples of how to set it up, but also be prepared for things breaking in the future as package writers change things. This feature is really fluid. Web searches on stackoverflow are key for solving these problems. 75 | 76 | ## Working with Word 77 | 78 | For many of us, Word is part of our team's workflow. Here are some tips if that is the case for you: 79 | 80 | * Check out the [officeverse](https://ardata-fr.github.io/officeverse/index.html): [officedown](https://CRAN.R-project.org/package=officedown) and [flextable](https://CRAN.R-project.org/package=flextable) R packages. 81 | * Quarto has greatly [improved Word](https://quarto.org/docs/output-formats/ms-word.html) integration so many of the problems we faced with Word output may soon be solved. 82 | * Don't build the whole report in one file. Work on individual text sections and then have RStudio (via pandoc/knitr) assemble the report (text, figures, tables) from the individual parts. 83 | * How to deal with the team needing to review the assembled document (text, figures, tables): 84 | * Try to modularize. So maybe make individual chapters and have review happen at that level. Then you incorporate the changes into the plain text manually. 85 | * Use templates to make your Word doc look the way you want. The default Word template is bare bones. See my example and read about using Word templates with Quartro [here](https://quarto.org/docs/output-formats/ms-word-templates.html) and R Markdown [here](https://bookdown.org/yihui/rmarkdown-cookbook/word-template.html) . 86 | 87 | 88 | ### Making tables look nice in Word 89 | 90 | The example in `Table_Counts.Rmd` and `Table_Counts_flex.Rmd` shows you tricks to make nice Word tables. 91 | 92 | * how to include a page break in your Word doc between tables. 93 | * using `format="pandoc"` for the table 94 | * using `results='asis'` and `print()` so you can use `for` loops. 95 | * centering your tables is next to impossible with `kable()`. Use the {[flextable](https://ardata-fr.github.io/flextable-book/)} package if you need that. 96 | 97 | ### New pages 98 | 99 | This is how to get a new page in Word. Make sure you are in print view on the word doc, otherwise you won't see any of the pages. 100 | 101 | ```{r echo=FALSE, comment=""} 102 | cat('```{=openxml}\n\n```') 103 | ``` 104 | 105 | ## Output templates with Quarto 106 | 107 | Quarto is working on templates to make output to different formats easy. Here is an example of journal templates [quarto-journals](https://github.com/quarto-journals/). 108 | 109 | ## Weird Quarto quirks 110 | 111 | * If you use 112 | ``` 113 | --- 114 | title: MyTitle 115 | --- 116 | ``` 117 | as your title spec, then you won't get the first header 2 in your pdf. Use `# ` instead. 118 | 119 | * If you have 2 `# ` levels in a qmd file, you only the first chapter appearing in the TOC. The others appear weirdly as sub-chapters. 120 | 121 | * with flextable, your table captions from knitr yaml disappear if the table breaks across a page. 122 | 123 | ```{=openxml} 124 | 125 | ``` 126 | 127 | 128 | -------------------------------------------------------------------------------- /docs/site_libs/quarto-html/anchor.min.js: -------------------------------------------------------------------------------- 1 | // @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt Expat 2 | // 3 | // AnchorJS - v4.3.1 - 2021-04-17 4 | // https://www.bryanbraun.com/anchorjs/ 5 | // Copyright (c) 2021 Bryan Braun; Licensed MIT 6 | // 7 | // @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt Expat 8 | !function(A,e){"use strict";"function"==typeof define&&define.amd?define([],e):"object"==typeof module&&module.exports?module.exports=e():(A.AnchorJS=e(),A.anchors=new A.AnchorJS)}(this,function(){"use strict";return function(A){function d(A){A.icon=Object.prototype.hasOwnProperty.call(A,"icon")?A.icon:"",A.visible=Object.prototype.hasOwnProperty.call(A,"visible")?A.visible:"hover",A.placement=Object.prototype.hasOwnProperty.call(A,"placement")?A.placement:"right",A.ariaLabel=Object.prototype.hasOwnProperty.call(A,"ariaLabel")?A.ariaLabel:"Anchor",A.class=Object.prototype.hasOwnProperty.call(A,"class")?A.class:"",A.base=Object.prototype.hasOwnProperty.call(A,"base")?A.base:"",A.truncate=Object.prototype.hasOwnProperty.call(A,"truncate")?Math.floor(A.truncate):64,A.titleText=Object.prototype.hasOwnProperty.call(A,"titleText")?A.titleText:""}function w(A){var e;if("string"==typeof A||A instanceof String)e=[].slice.call(document.querySelectorAll(A));else{if(!(Array.isArray(A)||A instanceof NodeList))throw new TypeError("The selector provided to AnchorJS was invalid.");e=[].slice.call(A)}return e}this.options=A||{},this.elements=[],d(this.options),this.isTouchDevice=function(){return Boolean("ontouchstart"in window||window.TouchEvent||window.DocumentTouch&&document instanceof DocumentTouch)},this.add=function(A){var e,t,o,i,n,s,a,c,r,l,h,u,p=[];if(d(this.options),"touch"===(l=this.options.visible)&&(l=this.isTouchDevice()?"always":"hover"),0===(e=w(A=A||"h2, h3, h4, h5, h6")).length)return this;for(null===document.head.querySelector("style.anchorjs")&&((u=document.createElement("style")).className="anchorjs",u.appendChild(document.createTextNode("")),void 0===(A=document.head.querySelector('[rel="stylesheet"],style'))?document.head.appendChild(u):document.head.insertBefore(u,A),u.sheet.insertRule(".anchorjs-link{opacity:0;text-decoration:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}",u.sheet.cssRules.length),u.sheet.insertRule(":hover>.anchorjs-link,.anchorjs-link:focus{opacity:1}",u.sheet.cssRules.length),u.sheet.insertRule("[data-anchorjs-icon]::after{content:attr(data-anchorjs-icon)}",u.sheet.cssRules.length),u.sheet.insertRule('@font-face{font-family:anchorjs-icons;src:url(data:n/a;base64,AAEAAAALAIAAAwAwT1MvMg8yG2cAAAE4AAAAYGNtYXDp3gC3AAABpAAAAExnYXNwAAAAEAAAA9wAAAAIZ2x5ZlQCcfwAAAH4AAABCGhlYWQHFvHyAAAAvAAAADZoaGVhBnACFwAAAPQAAAAkaG10eASAADEAAAGYAAAADGxvY2EACACEAAAB8AAAAAhtYXhwAAYAVwAAARgAAAAgbmFtZQGOH9cAAAMAAAAAunBvc3QAAwAAAAADvAAAACAAAQAAAAEAAHzE2p9fDzz1AAkEAAAAAADRecUWAAAAANQA6R8AAAAAAoACwAAAAAgAAgAAAAAAAAABAAADwP/AAAACgAAA/9MCrQABAAAAAAAAAAAAAAAAAAAAAwABAAAAAwBVAAIAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAMCQAGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAg//0DwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAAIAAAACgAAxAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEADAAAAAIAAgAAgAAACDpy//9//8AAAAg6cv//f///+EWNwADAAEAAAAAAAAAAAAAAAAACACEAAEAAAAAAAAAAAAAAAAxAAACAAQARAKAAsAAKwBUAAABIiYnJjQ3NzY2MzIWFxYUBwcGIicmNDc3NjQnJiYjIgYHBwYUFxYUBwYGIwciJicmNDc3NjIXFhQHBwYUFxYWMzI2Nzc2NCcmNDc2MhcWFAcHBgYjARQGDAUtLXoWOR8fORYtLTgKGwoKCjgaGg0gEhIgDXoaGgkJBQwHdR85Fi0tOAobCgoKOBoaDSASEiANehoaCQkKGwotLXoWOR8BMwUFLYEuehYXFxYugC44CQkKGwo4GkoaDQ0NDXoaShoKGwoFBe8XFi6ALjgJCQobCjgaShoNDQ0NehpKGgobCgoKLYEuehYXAAAADACWAAEAAAAAAAEACAAAAAEAAAAAAAIAAwAIAAEAAAAAAAMACAAAAAEAAAAAAAQACAAAAAEAAAAAAAUAAQALAAEAAAAAAAYACAAAAAMAAQQJAAEAEAAMAAMAAQQJAAIABgAcAAMAAQQJAAMAEAAMAAMAAQQJAAQAEAAMAAMAAQQJAAUAAgAiAAMAAQQJAAYAEAAMYW5jaG9yanM0MDBAAGEAbgBjAGgAbwByAGoAcwA0ADAAMABAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAH//wAP) format("truetype")}',u.sheet.cssRules.length)),u=document.querySelectorAll("[id]"),t=[].map.call(u,function(A){return A.id}),i=0;i\]./()*\\\n\t\b\v\u00A0]/g,"-").replace(/-{2,}/g,"-").substring(0,this.options.truncate).replace(/^-+|-+$/gm,"").toLowerCase()},this.hasAnchorJSLink=function(A){var e=A.firstChild&&-1<(" "+A.firstChild.className+" ").indexOf(" anchorjs-link "),A=A.lastChild&&-1<(" "+A.lastChild.className+" ").indexOf(" anchorjs-link ");return e||A||!1}}}); 9 | // @license-end -------------------------------------------------------------------------------- /text/citations.qmd: -------------------------------------------------------------------------------- 1 | ```{r warning=FALSE, echo=FALSE, message=FALSE} 2 | knitr::opts_chunk$set(echo = FALSE, warning=FALSE, message=FALSE) 3 | library(knitr) 4 | library(xtable) 5 | library(flextable) 6 | library(dplyr) 7 | ``` 8 | 9 | # Citations 10 | 11 | ![](https://g.gravizo.com/svg?%0A%20%20digraph%20G%20%7B%0A%20%20%20%20aize%20%253d%224%252c4%22%253b%0A%20%20%20%20node%20%5Bshape%253dbox%5D%253b%0A%0A%20%20%20%20zotero%20-%3E%20pandoc_citeproc%20%5Blabel%253d%22CSL%22%5D%253b%0A%20%20%20%20zotero%20-%3E%20pandoc_citeproc_convert%20%5Blabel%253d%22bibtex%22%5D%253b%0A%20%20%20%20pandoc_citeproc_convert%20-%3E%20pandoc_citeproc%20%5Blabel%253d%22CSL%22%5D%253b%0A%0A%20%20%20%20pandoc_citeproc_convert%20%5Blabel%253d%22pandoc-citeproc%20in%20convert%20mode%22%5D%253b%0A%20%20%20%20pandoc_citeproc%20%5Blabel%253d%22pandoc-citeproc%22%5D%253b%0A%20%20%7D%0A) 12 | 13 | Tips and tricks! Or things they never told you... 14 | 15 | Zotero users, you are better off avoiding the intermediary bibtex file altogether. Read how [here](https://retorque.re/zotero-better-bibtex/exporting/pandoc/) 16 | 17 | ## The basics 18 | 19 | ### The `bib` file 20 | 21 | Include a reference file called `whatever.bib` in your project. This holds your references in a flat format called bibtex (or biblatex). [Read about bib files in the bookdown doc](https://bookdown.org/yihui/bookdown/citations.html) but ignore the parts about how to include citations. 22 | 23 | How do I make this file from a list of references? If you use Zotero, do File \> Export \> BibTex or BibLaTeX. 24 | 25 | In your Quarto yaml, include this as 26 | 27 | bibliography: [whatever.bib] 28 | 29 | If you have multiple `bib` files, separate them with commas. 30 | 31 | ### Citing 32 | 33 | In your text you cite, like so `[@smith2020]` to produce (Smith 2022) and `@smith2022` to produce Smith (2020). 34 | 35 | ## What Pandoc does 36 | 37 | Pandoc processes your .bib file into inline references and references at the end of your document using biblatex by default. biblatex is a LaTeX package. Alternatively you can force Pandoc to use bibtex by using the file ending `.bibtex`. Then Pandoc formats your citations using the csl file you specified (or the default one). [Read about this](https://pandoc.org/MANUAL.html#citations) 38 | 39 | ## bibtex versus biblatex 40 | 41 | Why does this matter? The syntax for the `.bib` file is slightly different for biblatex versus bibtex. Your csl file (which specifies how your citations look) may be for bibtex or biblatex. The csl file may or may not tell you this. 42 | 43 | One big difference is how bibtex versus biblatex process the institution or publisher variable in the bib file. biblatex treats this as a list and uses `and` as a delimiter between the items in the list. bibtex does not do this. 44 | 45 | institution: U.S. Fish and Wildlife Service 46 | 47 | bibtex makes this "U.S. Fish and Wildlife Service" while biblatex turns this into "U.S. Fish; Wildlife Service". To stop this behavior you need to write your institution (or publisher) as 48 | 49 | institution: U.S. Fish {and} Wildlife Service 50 | 51 | Unfortunately Zortoro won't let you export raw `{`. It will escape these and make them `\{` which will appear as curly brackets in the citation. 52 | 53 | Another difference between bibtex and biblatex is that they use different variable names. biblatex uses for example phdthesis as a type while bibtex has only thesis. biblatex is back compatible with bibtex but bibtex is not forward compatible with biblatex. 54 | 55 | Meaning, you can use a `.bib` file in bibtex format with biblatex. But don't rename a biblatex file to `.bibtex` which would force Pandoc to use bibtex and you citations would break. 56 | 57 | ## Customizing how your citations look 58 | 59 | You use a csl file for this. [Quarto documentation section](https://quarto.org/docs/authoring/footnotes-and-citations.html#citation-style). You download the one you need and then add a reference to it in your yaml. Go to Zotero's csl library and you can see the output formats and find the one you want: [Zotero csl library](https://www.zotero.org/styles). 60 | 61 | Once you have downloaded a csl file, you add it you your yaml like so 62 | 63 | bibliography: [whatever.bib] 64 | csl: cslyoudownloaded.csl 65 | 66 | **Editing your csl file** 67 | 68 | Sometimes you need to alter the csl file a bit. Journal article and book formats are standardized, but report and tech report formats are really a mixed bag. Your institution or the publisher you are targeting may well use some customized format for reports in citations. 69 | 70 | So now you are faced with editing a csl file. This is pretty technical so brace yourself. [This Zotero article](https://www.zotero.org/support/dev/citation_styles/csl_0.8.1_syntax) will give you an overview. 71 | 72 | As you tackle keep in mind that a `.bib` (and `.bibtex`) file was written to be used with a `.bst` file. That is what is used by LaTeX. Pandoc is doing some 'cross-walking' to allow that `.bib` file to be used with a csl file that has slightly different names for things. 73 | 74 | ## Tips 75 | 76 | ### italics 77 | 78 | Let's same you have a species name in a title and you want that in italics. In your `.bib` file you'll have 79 | 80 | title = {The title and \textit{the species}} 81 | 82 | The `\textit` is TeX. 83 | 84 | If you are using Zotero, then enter your title as 85 | 86 | The title and the species 87 | 88 | and when you export it will convert to `\textit{}`. 89 | 90 | ### Words you want capitalized 91 | 92 | By default, your titles will get converted to sentence form. The keep capitalized form, you use curly brackets. 93 | 94 | The title is {ABC} 95 | 96 | If you are using Zotero, then enter your title as 97 | 98 | The title is ABC 99 | 100 | Note in Zotero you should always enter the title in sentence form (no capitalization). If you capitalize words then Zotero will assume you want them that way. So this in Zotero 101 | 102 | The Title is Now 103 | 104 | will become 105 | 106 | The {Title} is {Now} 107 | 108 | in your exported `.bib` file. The curly brackets protect the capitalization and force it to remain capitalized in your citation list. If you have these extraneous curly brackets in your exported bib file, then you should correct the problem in Zotero. 109 | 110 | ```{=openxml} 111 | 112 | ``` 113 | -------------------------------------------------------------------------------- /docs/site_libs/lightable-0.0.1/lightable.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * lightable v0.0.1 3 | * Copyright 2020 Hao Zhu 4 | * Licensed under MIT (https://github.com/haozhu233/kableExtra/blob/master/LICENSE) 5 | */ 6 | 7 | .lightable-minimal { 8 | border-collapse: separate; 9 | border-spacing: 16px 1px; 10 | width: 100%; 11 | margin-bottom: 10px; 12 | } 13 | 14 | .lightable-minimal td { 15 | margin-left: 5px; 16 | margin-right: 5px; 17 | } 18 | 19 | .lightable-minimal th { 20 | margin-left: 5px; 21 | margin-right: 5px; 22 | } 23 | 24 | .lightable-minimal thead tr:last-child th { 25 | border-bottom: 2px solid #00000050; 26 | empty-cells: hide; 27 | 28 | } 29 | 30 | .lightable-minimal tbody tr:first-child td { 31 | padding-top: 0.5em; 32 | } 33 | 34 | .lightable-minimal.lightable-hover tbody tr:hover { 35 | background-color: #f5f5f5; 36 | } 37 | 38 | .lightable-minimal.lightable-striped tbody tr:nth-child(even) { 39 | background-color: #f5f5f5; 40 | } 41 | 42 | .lightable-classic { 43 | border-top: 0.16em solid #111111; 44 | border-bottom: 0.16em solid #111111; 45 | width: 100%; 46 | margin-bottom: 10px; 47 | margin: 10px 5px; 48 | } 49 | 50 | .lightable-classic tfoot tr td { 51 | border: 0; 52 | } 53 | 54 | .lightable-classic tfoot tr:first-child td { 55 | border-top: 0.14em solid #111111; 56 | } 57 | 58 | .lightable-classic caption { 59 | color: #222222; 60 | } 61 | 62 | .lightable-classic td { 63 | padding-left: 5px; 64 | padding-right: 5px; 65 | color: #222222; 66 | } 67 | 68 | .lightable-classic th { 69 | padding-left: 5px; 70 | padding-right: 5px; 71 | font-weight: normal; 72 | color: #222222; 73 | } 74 | 75 | .lightable-classic thead tr:last-child th { 76 | border-bottom: 0.10em solid #111111; 77 | } 78 | 79 | .lightable-classic.lightable-hover tbody tr:hover { 80 | background-color: #F9EEC1; 81 | } 82 | 83 | .lightable-classic.lightable-striped tbody tr:nth-child(even) { 84 | background-color: #f5f5f5; 85 | } 86 | 87 | .lightable-classic-2 { 88 | border-top: 3px double #111111; 89 | border-bottom: 3px double #111111; 90 | width: 100%; 91 | margin-bottom: 10px; 92 | } 93 | 94 | .lightable-classic-2 tfoot tr td { 95 | border: 0; 96 | } 97 | 98 | .lightable-classic-2 tfoot tr:first-child td { 99 | border-top: 3px double #111111; 100 | } 101 | 102 | .lightable-classic-2 caption { 103 | color: #222222; 104 | } 105 | 106 | .lightable-classic-2 td { 107 | padding-left: 5px; 108 | padding-right: 5px; 109 | color: #222222; 110 | } 111 | 112 | .lightable-classic-2 th { 113 | padding-left: 5px; 114 | padding-right: 5px; 115 | font-weight: normal; 116 | color: #222222; 117 | } 118 | 119 | .lightable-classic-2 tbody tr:last-child td { 120 | border-bottom: 3px double #111111; 121 | } 122 | 123 | .lightable-classic-2 thead tr:last-child th { 124 | border-bottom: 1px solid #111111; 125 | } 126 | 127 | .lightable-classic-2.lightable-hover tbody tr:hover { 128 | background-color: #F9EEC1; 129 | } 130 | 131 | .lightable-classic-2.lightable-striped tbody tr:nth-child(even) { 132 | background-color: #f5f5f5; 133 | } 134 | 135 | .lightable-material { 136 | min-width: 100%; 137 | white-space: nowrap; 138 | table-layout: fixed; 139 | font-family: Roboto, sans-serif; 140 | border: 1px solid #EEE; 141 | border-collapse: collapse; 142 | margin-bottom: 10px; 143 | } 144 | 145 | .lightable-material tfoot tr td { 146 | border: 0; 147 | } 148 | 149 | .lightable-material tfoot tr:first-child td { 150 | border-top: 1px solid #EEE; 151 | } 152 | 153 | .lightable-material th { 154 | height: 56px; 155 | padding-left: 16px; 156 | padding-right: 16px; 157 | } 158 | 159 | .lightable-material td { 160 | height: 52px; 161 | padding-left: 16px; 162 | padding-right: 16px; 163 | border-top: 1px solid #eeeeee; 164 | } 165 | 166 | .lightable-material.lightable-hover tbody tr:hover { 167 | background-color: #f5f5f5; 168 | } 169 | 170 | .lightable-material.lightable-striped tbody tr:nth-child(even) { 171 | background-color: #f5f5f5; 172 | } 173 | 174 | .lightable-material.lightable-striped tbody td { 175 | border: 0; 176 | } 177 | 178 | .lightable-material.lightable-striped thead tr:last-child th { 179 | border-bottom: 1px solid #ddd; 180 | } 181 | 182 | .lightable-material-dark { 183 | min-width: 100%; 184 | white-space: nowrap; 185 | table-layout: fixed; 186 | font-family: Roboto, sans-serif; 187 | border: 1px solid #FFFFFF12; 188 | border-collapse: collapse; 189 | margin-bottom: 10px; 190 | background-color: #363640; 191 | } 192 | 193 | .lightable-material-dark tfoot tr td { 194 | border: 0; 195 | } 196 | 197 | .lightable-material-dark tfoot tr:first-child td { 198 | border-top: 1px solid #FFFFFF12; 199 | } 200 | 201 | .lightable-material-dark th { 202 | height: 56px; 203 | padding-left: 16px; 204 | padding-right: 16px; 205 | color: #FFFFFF60; 206 | } 207 | 208 | .lightable-material-dark td { 209 | height: 52px; 210 | padding-left: 16px; 211 | padding-right: 16px; 212 | color: #FFFFFF; 213 | border-top: 1px solid #FFFFFF12; 214 | } 215 | 216 | .lightable-material-dark.lightable-hover tbody tr:hover { 217 | background-color: #FFFFFF12; 218 | } 219 | 220 | .lightable-material-dark.lightable-striped tbody tr:nth-child(even) { 221 | background-color: #FFFFFF12; 222 | } 223 | 224 | .lightable-material-dark.lightable-striped tbody td { 225 | border: 0; 226 | } 227 | 228 | .lightable-material-dark.lightable-striped thead tr:last-child th { 229 | border-bottom: 1px solid #FFFFFF12; 230 | } 231 | 232 | .lightable-paper { 233 | width: 100%; 234 | margin-bottom: 10px; 235 | color: #444; 236 | } 237 | 238 | .lightable-paper tfoot tr td { 239 | border: 0; 240 | } 241 | 242 | .lightable-paper tfoot tr:first-child td { 243 | border-top: 1px solid #00000020; 244 | } 245 | 246 | .lightable-paper thead tr:last-child th { 247 | color: #666; 248 | vertical-align: bottom; 249 | border-bottom: 1px solid #00000020; 250 | line-height: 1.15em; 251 | padding: 10px 5px; 252 | } 253 | 254 | .lightable-paper td { 255 | vertical-align: middle; 256 | border-bottom: 1px solid #00000010; 257 | line-height: 1.15em; 258 | padding: 7px 5px; 259 | } 260 | 261 | .lightable-paper.lightable-hover tbody tr:hover { 262 | background-color: #F9EEC1; 263 | } 264 | 265 | .lightable-paper.lightable-striped tbody tr:nth-child(even) { 266 | background-color: #00000008; 267 | } 268 | 269 | .lightable-paper.lightable-striped tbody td { 270 | border: 0; 271 | } 272 | 273 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # QmdReport. 2 | 3 | [A demo a Quarto report live view](https://rverse-tutorials.github.io/QmdReport/) 4 | 5 | ## April 26, 2023 update 6 | 7 | * Everything broken in the Aug 13, 2022 update is still broken. 8 | * flextable cross-refs and captions are still not working in Word output 9 | * The flextable 0.9.1 CRAN release broke PDF output in Quarto books. Known problem and fixed in the development version on GitHub (0.9.2) `devtools::install_github("davidgohel/flextable")` 10 | * gt (v0.9.0) cross-refs still broken in Word 11 | 12 | ## Aug 13, 2022 update 13 | 14 | I have mostly figured out workarounds for the table package issues. 15 | 16 | The remaining big issues are 17 | * For HTML, if you have two chapters (h1 level) in a single qmd it totally messes up the TOC. Word and PDF converters seem to figure it out ok and number things correctly. 18 | - I posted an issue https://github.com/quarto-dev/quarto-cli/issues/1712 19 | - This is important because we often don't know how many appendix chapters we will need. These are dynamically created based on the data. There is no good way to know this ahead of time. These report templates are used across very different regions and each region has a different number of appendices based on the number of, say, species or cities or whatever, in the region. 20 | * When I have appendices so `appendices: ` in my YAML, the HTML TOC is messed up. 21 | - see https://rverse-tutorials.github.io/QmdReport/ and look at TOC 22 | - why doesn't the HTML figure out that the appendix A title is CRchum.csv?? Word and PDF figure that out. 23 | * When I have `appendices: `, the PDF TOC and levels look right, but if I click on "Appendices" in the TOC, I go to References. 24 | - Look here to see what I mean [PDF version]( https://rverse-tutorials.github.io/QmdReport/A-Quarto-Template-Repo-to-Create-Big-Reports-and-Very-Long-Title-Because-Long-Titles-are-Common.pdf) 25 | - I would like to be able to have a `appendices.qmd` that I would go to. Maybe I can. I haven't tried. 26 | * No merge and knit option. :( so no memory across chapters. That is a "feature" in many cases but some report writers use memory across chapters heavily. 27 | 28 | 29 | 30 | ## Aug 11 22 update 31 | 32 | * flextable cross-refs don't work in pdf but kableExtra tables work and look better in some ways. So I use kableExtra for pdf's. 33 | * flextable is best for Word but cross-refs are broken. The Quarto dev team knows about the problem. 34 | * The Quarto {{include filename}} option for including files seems very limited or I don't know how to use it (most definitely true). The file has to be in same folder as the qmd that calls it. 35 | * The Quarto {{include filename}} breaks if the thing you call is calling `knit_expand()`. Why? So weird. I might be doing something wrong. 36 | * No merge and knit option. :( no sharing of variables across chapters 37 | * Can't have two chapters (h1 level) in a single qmd so can't dynamically create chapters (one qmd with many h1 levels where that qmd is created dynamically) 38 | * {gt} package and PDF table numbering don't mix! Breaks all numbering after a single `gt()` call. *Update. Fixed in the new gt update* 39 | 40 | ## Aug 11 22 update 41 | 42 | I presented a more minimal version to a NOAA Fisheries group: https://rverse-tutorials.github.io/QuartoReport_SE and https://github.com/RVerse-Tutorials/QuartoReport_SE 43 | 44 | ## Aug 6 22 update 45 | 46 | I presented QmdReport at the last RWorkflow workshop. I'd made a lot of progress but many things were not working still. I made a bunch of updates and cleaned things up. 47 | 48 | * After fighting to try to get tables to look ok using one table engine, I have up and wrote some helper functions in `tables/_common.R` to select the best engine for LaTeX versus Word/HTML. 49 | * flextable cross-refs don't work in pdf but kableExtra tables work and look better in some ways. So I use kableExtra for pdf's. 50 | * flextable is by far best for Word but cross-refs are broken. The Quarto dev team knows about the problem. 51 | * I worked out how to use child Rmds. 52 | * I put tables separate from figures. 53 | * I tried having appendices as a "part" using `appendices: ` in the `_quarto.yml` but when I added a cross-ref to a chapter it wouldn't build to Word. So had to get rid of that. 54 | * Only one chapter per qmd :( I posted as an issue https://github.com/quarto-dev/quarto-cli/issues/1712 This is a big problem. Often you don't know ahead of time how many chapters you need. 55 | 56 | ## Aug 5 22 update 57 | 58 | The title page work is living here at the moment: https://github.com/nmfs-opensci/quarto_titlepages 59 | 60 | ## Aug 2 22 update 61 | 62 | I see a path forward (for HTML at least)! I can pass in `page-layout: custom` and use `::: ` to add the content in the right places. https://github.com/quarto-dev/quarto-web/blob/main/index.qmd 63 | But I still don't know how to get any control over the page. 64 | 65 | ## July 30 22 update 66 | 67 | I hacked the index.qmd yaml to make what looks like a title page using the `subtitle:`. But now PDF and Word won't build. Word says it can't find the image file even though it finds it fine when the image is in the main text. 68 | 69 | I spend the day also playing with [quarto](https://github.com/quarto-journals) for making templates. I don't think that's the way forward. I struggled to make sense of the structure. Given my experience with LaTeX books, R Markdown Hugo blogs, html, css, etc, I can usually makes sense of templates with a bit of poking around the repo and start creating my own. 70 | 71 | The way they approached the title page design struck me as completely foreign coming from a LaTeX background and would require me to duplicate decades of LaTeX document class work (in the LaTeX community). There is a standard way to specify title pages (along with copyright pages etc) and to specify the parameters that go in: a document class definition and a redefinition of the `\maketitle` command along with parameters (that would presumably come in from the `_quarto.yml`). All I need is ablitity to freely define parameters in the yaml (e.g. `publishers`) AND the ability to control the LaTeX that is coming before `\mainmatter` in the document. That's it. Then all the existing LaTeX document classes would work seamlessly. 72 | 73 | Re Word, I didn't dig too deep. I need to find out how they are creating Word docs. Is it strictly pandoc or is {officerdown} helping out? If the latter, then I can hack (ug so tired of hacks) a title page. 74 | 75 | Other things that are hard 76 | 77 | * pandoc is not respecting `{.nolisting}` on the `index.qmd` for HTML output. So `# titlepage {.nonumbering .nolisting}` should work to for a title page without the first chapter starting on the html title page without `titlepage` appearing in the TOC. But `{.nolisting}` is only working on pages after `index.qmd`. 78 | 79 | * My hack to get control of the front page for HTML output by hacking the `subtitle:` block breaks both Word and PDF output. :( 80 | -------------------------------------------------------------------------------- /docs/site_libs/clipboard/clipboard.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * clipboard.js v2.0.11 3 | * https://clipboardjs.com/ 4 | * 5 | * Licensed MIT © Zeno Rocha 6 | */ 7 | !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return n={686:function(t,e,n){"use strict";n.d(e,{default:function(){return b}});var e=n(279),i=n.n(e),e=n(370),u=n.n(e),e=n(817),r=n.n(e);function c(t){try{return document.execCommand(t)}catch(t){return}}var a=function(t){t=r()(t);return c("cut"),t};function o(t,e){var n,o,t=(n=t,o="rtl"===document.documentElement.getAttribute("dir"),(t=document.createElement("textarea")).style.fontSize="12pt",t.style.border="0",t.style.padding="0",t.style.margin="0",t.style.position="absolute",t.style[o?"right":"left"]="-9999px",o=window.pageYOffset||document.documentElement.scrollTop,t.style.top="".concat(o,"px"),t.setAttribute("readonly",""),t.value=n,t);return e.container.appendChild(t),e=r()(t),c("copy"),t.remove(),e}var f=function(t){var e=1 { 17 | btn.style.display = "none"; 18 | }; 19 | const showBackToTop = () => { 20 | btn.style.display = "inline-block"; 21 | }; 22 | if (btn) { 23 | window.document.addEventListener( 24 | "scroll", 25 | function () { 26 | const currentScrollTop = 27 | window.pageYOffset || document.documentElement.scrollTop; 28 | 29 | // Shows and hides the button 'intelligently' as the user scrolls 30 | if (currentScrollTop - scrollDownBuffer > lastScrollTop) { 31 | hideBackToTop(); 32 | lastScrollTop = currentScrollTop <= 0 ? 0 : currentScrollTop; 33 | } else if (currentScrollTop < lastScrollTop - scrollUpBuffer) { 34 | showBackToTop(); 35 | lastScrollTop = currentScrollTop <= 0 ? 0 : currentScrollTop; 36 | } 37 | 38 | // Show the button at the bottom, hides it at the top 39 | if (currentScrollTop <= 0) { 40 | hideBackToTop(); 41 | } else if ( 42 | window.innerHeight + currentScrollTop >= 43 | document.body.offsetHeight 44 | ) { 45 | showBackToTop(); 46 | } 47 | }, 48 | false 49 | ); 50 | } 51 | 52 | function throttle(func, wait) { 53 | var timeout; 54 | return function () { 55 | const context = this; 56 | const args = arguments; 57 | const later = function () { 58 | clearTimeout(timeout); 59 | timeout = null; 60 | func.apply(context, args); 61 | }; 62 | 63 | if (!timeout) { 64 | timeout = setTimeout(later, wait); 65 | } 66 | }; 67 | } 68 | 69 | function headerOffset() { 70 | // Set an offset if there is are fixed top navbar 71 | const headerEl = window.document.querySelector("header.fixed-top"); 72 | if (headerEl) { 73 | return headerEl.clientHeight; 74 | } else { 75 | return 0; 76 | } 77 | } 78 | 79 | function footerOffset() { 80 | const footerEl = window.document.querySelector("footer.footer"); 81 | if (footerEl) { 82 | return footerEl.clientHeight; 83 | } else { 84 | return 0; 85 | } 86 | } 87 | 88 | function updateDocumentOffsetWithoutAnimation() { 89 | updateDocumentOffset(false); 90 | } 91 | 92 | function updateDocumentOffset(animated) { 93 | // set body offset 94 | const topOffset = headerOffset(); 95 | const bodyOffset = topOffset + footerOffset(); 96 | const bodyEl = window.document.body; 97 | bodyEl.setAttribute("data-bs-offset", topOffset); 98 | bodyEl.style.paddingTop = topOffset + "px"; 99 | 100 | // deal with sidebar offsets 101 | const sidebars = window.document.querySelectorAll( 102 | ".sidebar, .headroom-target" 103 | ); 104 | sidebars.forEach((sidebar) => { 105 | if (!animated) { 106 | sidebar.classList.add("notransition"); 107 | // Remove the no transition class after the animation has time to complete 108 | setTimeout(function () { 109 | sidebar.classList.remove("notransition"); 110 | }, 201); 111 | } 112 | 113 | if (window.Headroom && sidebar.classList.contains("sidebar-unpinned")) { 114 | sidebar.style.top = "0"; 115 | sidebar.style.maxHeight = "100vh"; 116 | } else { 117 | sidebar.style.top = topOffset + "px"; 118 | sidebar.style.maxHeight = "calc(100vh - " + topOffset + "px)"; 119 | } 120 | }); 121 | 122 | // allow space for footer 123 | const mainContainer = window.document.querySelector(".quarto-container"); 124 | if (mainContainer) { 125 | mainContainer.style.minHeight = "calc(100vh - " + bodyOffset + "px)"; 126 | } 127 | 128 | // link offset 129 | let linkStyle = window.document.querySelector("#quarto-target-style"); 130 | if (!linkStyle) { 131 | linkStyle = window.document.createElement("style"); 132 | linkStyle.setAttribute("id", "quarto-target-style"); 133 | window.document.head.appendChild(linkStyle); 134 | } 135 | while (linkStyle.firstChild) { 136 | linkStyle.removeChild(linkStyle.firstChild); 137 | } 138 | if (topOffset > 0) { 139 | linkStyle.appendChild( 140 | window.document.createTextNode(` 141 | section:target::before { 142 | content: ""; 143 | display: block; 144 | height: ${topOffset}px; 145 | margin: -${topOffset}px 0 0; 146 | }`) 147 | ); 148 | } 149 | if (init) { 150 | window.dispatchEvent(headroomChanged); 151 | } 152 | init = true; 153 | } 154 | 155 | // initialize headroom 156 | var header = window.document.querySelector("#quarto-header"); 157 | if (header && window.Headroom) { 158 | const headroom = new window.Headroom(header, { 159 | tolerance: 5, 160 | onPin: function () { 161 | const sidebars = window.document.querySelectorAll( 162 | ".sidebar, .headroom-target" 163 | ); 164 | sidebars.forEach((sidebar) => { 165 | sidebar.classList.remove("sidebar-unpinned"); 166 | }); 167 | updateDocumentOffset(); 168 | }, 169 | onUnpin: function () { 170 | const sidebars = window.document.querySelectorAll( 171 | ".sidebar, .headroom-target" 172 | ); 173 | sidebars.forEach((sidebar) => { 174 | sidebar.classList.add("sidebar-unpinned"); 175 | }); 176 | updateDocumentOffset(); 177 | }, 178 | }); 179 | headroom.init(); 180 | 181 | let frozen = false; 182 | window.quartoToggleHeadroom = function () { 183 | if (frozen) { 184 | headroom.unfreeze(); 185 | frozen = false; 186 | } else { 187 | headroom.freeze(); 188 | frozen = true; 189 | } 190 | }; 191 | } 192 | 193 | window.addEventListener( 194 | "hashchange", 195 | function (e) { 196 | if ( 197 | getComputedStyle(document.documentElement).scrollBehavior !== "smooth" 198 | ) { 199 | window.scrollTo(0, window.pageYOffset - headerOffset()); 200 | } 201 | }, 202 | false 203 | ); 204 | 205 | // Observe size changed for the header 206 | const headerEl = window.document.querySelector("header.fixed-top"); 207 | if (headerEl && window.ResizeObserver) { 208 | const observer = new window.ResizeObserver( 209 | updateDocumentOffsetWithoutAnimation 210 | ); 211 | observer.observe(headerEl, { 212 | attributes: true, 213 | childList: true, 214 | characterData: true, 215 | }); 216 | } else { 217 | window.addEventListener( 218 | "resize", 219 | throttle(updateDocumentOffsetWithoutAnimation, 50) 220 | ); 221 | } 222 | setTimeout(updateDocumentOffsetWithoutAnimation, 250); 223 | 224 | // fixup index.html links if we aren't on the filesystem 225 | if (window.location.protocol !== "file:") { 226 | const links = window.document.querySelectorAll("a"); 227 | for (let i = 0; i < links.length; i++) { 228 | if (links[i].href) { 229 | links[i].href = links[i].href.replace(/\/index\.html/, "/"); 230 | } 231 | } 232 | 233 | // Fixup any sharing links that require urls 234 | // Append url to any sharing urls 235 | const sharingLinks = window.document.querySelectorAll( 236 | "a.sidebar-tools-main-item" 237 | ); 238 | for (let i = 0; i < sharingLinks.length; i++) { 239 | const sharingLink = sharingLinks[i]; 240 | const href = sharingLink.getAttribute("href"); 241 | if (href) { 242 | sharingLink.setAttribute( 243 | "href", 244 | href.replace("|url|", window.location.href) 245 | ); 246 | } 247 | } 248 | 249 | // Scroll the active navigation item into view, if necessary 250 | const navSidebar = window.document.querySelector("nav#quarto-sidebar"); 251 | if (navSidebar) { 252 | // Find the active item 253 | const activeItem = navSidebar.querySelector("li.sidebar-item a.active"); 254 | if (activeItem) { 255 | // Wait for the scroll height and height to resolve by observing size changes on the 256 | // nav element that is scrollable 257 | const resizeObserver = new ResizeObserver((_entries) => { 258 | // The bottom of the element 259 | const elBottom = activeItem.offsetTop; 260 | const viewBottom = navSidebar.scrollTop + navSidebar.clientHeight; 261 | 262 | // The element height and scroll height are the same, then we are still loading 263 | if (viewBottom !== navSidebar.scrollHeight) { 264 | // Determine if the item isn't visible and scroll to it 265 | if (elBottom >= viewBottom) { 266 | navSidebar.scrollTop = elBottom; 267 | } 268 | 269 | // stop observing now since we've completed the scroll 270 | resizeObserver.unobserve(navSidebar); 271 | } 272 | }); 273 | resizeObserver.observe(navSidebar); 274 | } 275 | } 276 | } 277 | }); 278 | -------------------------------------------------------------------------------- /docs/site_libs/quarto-html/popper.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @popperjs/core v2.11.4 - MIT License 3 | */ 4 | 5 | !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Popper={})}(this,(function(e){"use strict";function t(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function n(e){return e instanceof t(e).Element||e instanceof Element}function r(e){return e instanceof t(e).HTMLElement||e instanceof HTMLElement}function o(e){return"undefined"!=typeof ShadowRoot&&(e instanceof t(e).ShadowRoot||e instanceof ShadowRoot)}var i=Math.max,a=Math.min,s=Math.round;function f(e,t){void 0===t&&(t=!1);var n=e.getBoundingClientRect(),o=1,i=1;if(r(e)&&t){var a=e.offsetHeight,f=e.offsetWidth;f>0&&(o=s(n.width)/f||1),a>0&&(i=s(n.height)/a||1)}return{width:n.width/o,height:n.height/i,top:n.top/i,right:n.right/o,bottom:n.bottom/i,left:n.left/o,x:n.left/o,y:n.top/i}}function c(e){var n=t(e);return{scrollLeft:n.pageXOffset,scrollTop:n.pageYOffset}}function p(e){return e?(e.nodeName||"").toLowerCase():null}function u(e){return((n(e)?e.ownerDocument:e.document)||window.document).documentElement}function l(e){return f(u(e)).left+c(e).scrollLeft}function d(e){return t(e).getComputedStyle(e)}function h(e){var t=d(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function m(e,n,o){void 0===o&&(o=!1);var i,a,d=r(n),m=r(n)&&function(e){var t=e.getBoundingClientRect(),n=s(t.width)/e.offsetWidth||1,r=s(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(n),v=u(n),g=f(e,m),y={scrollLeft:0,scrollTop:0},b={x:0,y:0};return(d||!d&&!o)&&(("body"!==p(n)||h(v))&&(y=(i=n)!==t(i)&&r(i)?{scrollLeft:(a=i).scrollLeft,scrollTop:a.scrollTop}:c(i)),r(n)?((b=f(n,!0)).x+=n.clientLeft,b.y+=n.clientTop):v&&(b.x=l(v))),{x:g.left+y.scrollLeft-b.x,y:g.top+y.scrollTop-b.y,width:g.width,height:g.height}}function v(e){var t=f(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function g(e){return"html"===p(e)?e:e.assignedSlot||e.parentNode||(o(e)?e.host:null)||u(e)}function y(e){return["html","body","#document"].indexOf(p(e))>=0?e.ownerDocument.body:r(e)&&h(e)?e:y(g(e))}function b(e,n){var r;void 0===n&&(n=[]);var o=y(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=t(o),s=i?[a].concat(a.visualViewport||[],h(o)?o:[]):o,f=n.concat(s);return i?f:f.concat(b(g(s)))}function x(e){return["table","td","th"].indexOf(p(e))>=0}function w(e){return r(e)&&"fixed"!==d(e).position?e.offsetParent:null}function O(e){for(var n=t(e),i=w(e);i&&x(i)&&"static"===d(i).position;)i=w(i);return i&&("html"===p(i)||"body"===p(i)&&"static"===d(i).position)?n:i||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&r(e)&&"fixed"===d(e).position)return null;var n=g(e);for(o(n)&&(n=n.host);r(n)&&["html","body"].indexOf(p(n))<0;){var i=d(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||t&&"filter"===i.willChange||t&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(e)||n}var j="top",E="bottom",D="right",A="left",L="auto",P=[j,E,D,A],M="start",k="end",W="viewport",B="popper",H=P.reduce((function(e,t){return e.concat([t+"-"+M,t+"-"+k])}),[]),T=[].concat(P,[L]).reduce((function(e,t){return e.concat([t,t+"-"+M,t+"-"+k])}),[]),R=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function S(e){var t=new Map,n=new Set,r=[];function o(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&o(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||o(e)})),r}function C(e){return e.split("-")[0]}function q(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&o(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function V(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function N(e,r){return r===W?V(function(e){var n=t(e),r=u(e),o=n.visualViewport,i=r.clientWidth,a=r.clientHeight,s=0,f=0;return o&&(i=o.width,a=o.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(s=o.offsetLeft,f=o.offsetTop)),{width:i,height:a,x:s+l(e),y:f}}(e)):n(r)?function(e){var t=f(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(r):V(function(e){var t,n=u(e),r=c(e),o=null==(t=e.ownerDocument)?void 0:t.body,a=i(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=i(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),f=-r.scrollLeft+l(e),p=-r.scrollTop;return"rtl"===d(o||n).direction&&(f+=i(n.clientWidth,o?o.clientWidth:0)-a),{width:a,height:s,x:f,y:p}}(u(e)))}function I(e,t,o){var s="clippingParents"===t?function(e){var t=b(g(e)),o=["absolute","fixed"].indexOf(d(e).position)>=0&&r(e)?O(e):e;return n(o)?t.filter((function(e){return n(e)&&q(e,o)&&"body"!==p(e)})):[]}(e):[].concat(t),f=[].concat(s,[o]),c=f[0],u=f.reduce((function(t,n){var r=N(e,n);return t.top=i(r.top,t.top),t.right=a(r.right,t.right),t.bottom=a(r.bottom,t.bottom),t.left=i(r.left,t.left),t}),N(e,c));return u.width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u}function _(e){return e.split("-")[1]}function F(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function U(e){var t,n=e.reference,r=e.element,o=e.placement,i=o?C(o):null,a=o?_(o):null,s=n.x+n.width/2-r.width/2,f=n.y+n.height/2-r.height/2;switch(i){case j:t={x:s,y:n.y-r.height};break;case E:t={x:s,y:n.y+n.height};break;case D:t={x:n.x+n.width,y:f};break;case A:t={x:n.x-r.width,y:f};break;default:t={x:n.x,y:n.y}}var c=i?F(i):null;if(null!=c){var p="y"===c?"height":"width";switch(a){case M:t[c]=t[c]-(n[p]/2-r[p]/2);break;case k:t[c]=t[c]+(n[p]/2-r[p]/2)}}return t}function z(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function X(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function Y(e,t){void 0===t&&(t={});var r=t,o=r.placement,i=void 0===o?e.placement:o,a=r.boundary,s=void 0===a?"clippingParents":a,c=r.rootBoundary,p=void 0===c?W:c,l=r.elementContext,d=void 0===l?B:l,h=r.altBoundary,m=void 0!==h&&h,v=r.padding,g=void 0===v?0:v,y=z("number"!=typeof g?g:X(g,P)),b=d===B?"reference":B,x=e.rects.popper,w=e.elements[m?b:d],O=I(n(w)?w:w.contextElement||u(e.elements.popper),s,p),A=f(e.elements.reference),L=U({reference:A,element:x,strategy:"absolute",placement:i}),M=V(Object.assign({},x,L)),k=d===B?M:A,H={top:O.top-k.top+y.top,bottom:k.bottom-O.bottom+y.bottom,left:O.left-k.left+y.left,right:k.right-O.right+y.right},T=e.modifiersData.offset;if(d===B&&T){var R=T[i];Object.keys(H).forEach((function(e){var t=[D,E].indexOf(e)>=0?1:-1,n=[j,E].indexOf(e)>=0?"y":"x";H[e]+=R[n]*t}))}return H}var G={placement:"bottom",modifiers:[],strategy:"absolute"};function J(){for(var e=arguments.length,t=new Array(e),n=0;n=0?-1:1,i="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=i[0],s=i[1];return a=a||0,s=(s||0)*o,[A,D].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,i),e}),{}),s=a[t.placement],f=s.x,c=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=f,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=a}},ie={left:"right",right:"left",bottom:"top",top:"bottom"};function ae(e){return e.replace(/left|right|bottom|top/g,(function(e){return ie[e]}))}var se={start:"end",end:"start"};function fe(e){return e.replace(/start|end/g,(function(e){return se[e]}))}function ce(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,f=n.allowedAutoPlacements,c=void 0===f?T:f,p=_(r),u=p?s?H:H.filter((function(e){return _(e)===p})):P,l=u.filter((function(e){return c.indexOf(e)>=0}));0===l.length&&(l=u);var d=l.reduce((function(t,n){return t[n]=Y(e,{placement:n,boundary:o,rootBoundary:i,padding:a})[C(n)],t}),{});return Object.keys(d).sort((function(e,t){return d[e]-d[t]}))}var pe={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=void 0===o||o,a=n.altAxis,s=void 0===a||a,f=n.fallbackPlacements,c=n.padding,p=n.boundary,u=n.rootBoundary,l=n.altBoundary,d=n.flipVariations,h=void 0===d||d,m=n.allowedAutoPlacements,v=t.options.placement,g=C(v),y=f||(g===v||!h?[ae(v)]:function(e){if(C(e)===L)return[];var t=ae(e);return[fe(e),t,fe(t)]}(v)),b=[v].concat(y).reduce((function(e,n){return e.concat(C(n)===L?ce(t,{placement:n,boundary:p,rootBoundary:u,padding:c,flipVariations:h,allowedAutoPlacements:m}):n)}),[]),x=t.rects.reference,w=t.rects.popper,O=new Map,P=!0,k=b[0],W=0;W=0,S=R?"width":"height",q=Y(t,{placement:B,boundary:p,rootBoundary:u,altBoundary:l,padding:c}),V=R?T?D:A:T?E:j;x[S]>w[S]&&(V=ae(V));var N=ae(V),I=[];if(i&&I.push(q[H]<=0),s&&I.push(q[V]<=0,q[N]<=0),I.every((function(e){return e}))){k=B,P=!1;break}O.set(B,I)}if(P)for(var F=function(e){var t=b.find((function(t){var n=O.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return k=t,"break"},U=h?3:1;U>0;U--){if("break"===F(U))break}t.placement!==k&&(t.modifiersData[r]._skip=!0,t.placement=k,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function ue(e,t,n){return i(e,a(t,n))}var le={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,s=void 0===o||o,f=n.altAxis,c=void 0!==f&&f,p=n.boundary,u=n.rootBoundary,l=n.altBoundary,d=n.padding,h=n.tether,m=void 0===h||h,g=n.tetherOffset,y=void 0===g?0:g,b=Y(t,{boundary:p,rootBoundary:u,padding:d,altBoundary:l}),x=C(t.placement),w=_(t.placement),L=!w,P=F(x),k="x"===P?"y":"x",W=t.modifiersData.popperOffsets,B=t.rects.reference,H=t.rects.popper,T="function"==typeof y?y(Object.assign({},t.rects,{placement:t.placement})):y,R="number"==typeof T?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),S=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,q={x:0,y:0};if(W){if(s){var V,N="y"===P?j:A,I="y"===P?E:D,U="y"===P?"height":"width",z=W[P],X=z+b[N],G=z-b[I],J=m?-H[U]/2:0,K=w===M?B[U]:H[U],Q=w===M?-H[U]:-B[U],Z=t.elements.arrow,$=m&&Z?v(Z):{width:0,height:0},ee=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},te=ee[N],ne=ee[I],re=ue(0,B[U],$[U]),oe=L?B[U]/2-J-re-te-R.mainAxis:K-re-te-R.mainAxis,ie=L?-B[U]/2+J+re+ne+R.mainAxis:Q+re+ne+R.mainAxis,ae=t.elements.arrow&&O(t.elements.arrow),se=ae?"y"===P?ae.clientTop||0:ae.clientLeft||0:0,fe=null!=(V=null==S?void 0:S[P])?V:0,ce=z+ie-fe,pe=ue(m?a(X,z+oe-fe-se):X,z,m?i(G,ce):G);W[P]=pe,q[P]=pe-z}if(c){var le,de="x"===P?j:A,he="x"===P?E:D,me=W[k],ve="y"===k?"height":"width",ge=me+b[de],ye=me-b[he],be=-1!==[j,A].indexOf(x),xe=null!=(le=null==S?void 0:S[k])?le:0,we=be?ge:me-B[ve]-H[ve]-xe+R.altAxis,Oe=be?me+B[ve]+H[ve]-xe-R.altAxis:ye,je=m&&be?function(e,t,n){var r=ue(e,t,n);return r>n?n:r}(we,me,Oe):ue(m?we:ge,me,m?Oe:ye);W[k]=je,q[k]=je-me}t.modifiersData[r]=q}},requiresIfExists:["offset"]};var de={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=C(n.placement),f=F(s),c=[A,D].indexOf(s)>=0?"height":"width";if(i&&a){var p=function(e,t){return z("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:X(e,P))}(o.padding,n),u=v(i),l="y"===f?j:A,d="y"===f?E:D,h=n.rects.reference[c]+n.rects.reference[f]-a[f]-n.rects.popper[c],m=a[f]-n.rects.reference[f],g=O(i),y=g?"y"===f?g.clientHeight||0:g.clientWidth||0:0,b=h/2-m/2,x=p[l],w=y-u[c]-p[d],L=y/2-u[c]/2+b,M=ue(x,L,w),k=f;n.modifiersData[r]=((t={})[k]=M,t.centerOffset=M-L,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&q(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function he(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function me(e){return[j,D,E,A].some((function(t){return e[t]>=0}))}var ve={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=Y(t,{elementContext:"reference"}),s=Y(t,{altBoundary:!0}),f=he(a,r),c=he(s,o,i),p=me(f),u=me(c);t.modifiersData[n]={referenceClippingOffsets:f,popperEscapeOffsets:c,isReferenceHidden:p,hasPopperEscaped:u},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":p,"data-popper-escaped":u})}},ge=K({defaultModifiers:[Z,$,ne,re]}),ye=[Z,$,ne,re,oe,pe,le,de,ve],be=K({defaultModifiers:ye});e.applyStyles=re,e.arrow=de,e.computeStyles=ne,e.createPopper=be,e.createPopperLite=ge,e.defaultModifiers=ye,e.detectOverflow=Y,e.eventListeners=Z,e.flip=pe,e.hide=ve,e.offset=oe,e.popperGenerator=K,e.popperOffsets=$,e.preventOverflow=le,Object.defineProperty(e,"__esModule",{value:!0})})); 6 | 7 | -------------------------------------------------------------------------------- /docs/site_libs/quarto-search/fuse.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Fuse.js v6.6.2 - Lightweight fuzzy-search (http://fusejs.io) 3 | * 4 | * Copyright (c) 2022 Kiro Risk (http://kiro.me) 5 | * All Rights Reserved. Apache Software License 2.0 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | */ 9 | var e,t;e=this,t=function(){"use strict";function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var n=1;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,n=new Map,r=Math.pow(10,t);return{get:function(t){var i=t.match(C).length;if(n.has(i))return n.get(i);var o=1/Math.pow(i,.5*e),c=parseFloat(Math.round(o*r)/r);return n.set(i,c),c},clear:function(){n.clear()}}}var $=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.getFn,i=void 0===n?I.getFn:n,o=t.fieldNormWeight,c=void 0===o?I.fieldNormWeight:o;r(this,e),this.norm=E(c,3),this.getFn=i,this.isCreated=!1,this.setIndexRecords()}return o(e,[{key:"setSources",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.docs=e}},{key:"setIndexRecords",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.records=e}},{key:"setKeys",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.keys=t,this._keysMap={},t.forEach((function(t,n){e._keysMap[t.id]=n}))}},{key:"create",value:function(){var e=this;!this.isCreated&&this.docs.length&&(this.isCreated=!0,g(this.docs[0])?this.docs.forEach((function(t,n){e._addString(t,n)})):this.docs.forEach((function(t,n){e._addObject(t,n)})),this.norm.clear())}},{key:"add",value:function(e){var t=this.size();g(e)?this._addString(e,t):this._addObject(e,t)}},{key:"removeAt",value:function(e){this.records.splice(e,1);for(var t=e,n=this.size();t2&&void 0!==arguments[2]?arguments[2]:{},r=n.getFn,i=void 0===r?I.getFn:r,o=n.fieldNormWeight,c=void 0===o?I.fieldNormWeight:o,a=new $({getFn:i,fieldNormWeight:c});return a.setKeys(e.map(_)),a.setSources(t),a.create(),a}function R(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.errors,r=void 0===n?0:n,i=t.currentLocation,o=void 0===i?0:i,c=t.expectedLocation,a=void 0===c?0:c,s=t.distance,u=void 0===s?I.distance:s,h=t.ignoreLocation,l=void 0===h?I.ignoreLocation:h,f=r/e.length;if(l)return f;var d=Math.abs(a-o);return u?f+d/u:d?1:f}function N(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:I.minMatchCharLength,n=[],r=-1,i=-1,o=0,c=e.length;o=t&&n.push([r,i]),r=-1)}return e[o-1]&&o-r>=t&&n.push([r,o-1]),n}var P=32;function W(e){for(var t={},n=0,r=e.length;n1&&void 0!==arguments[1]?arguments[1]:{},o=i.location,c=void 0===o?I.location:o,a=i.threshold,s=void 0===a?I.threshold:a,u=i.distance,h=void 0===u?I.distance:u,l=i.includeMatches,f=void 0===l?I.includeMatches:l,d=i.findAllMatches,v=void 0===d?I.findAllMatches:d,g=i.minMatchCharLength,y=void 0===g?I.minMatchCharLength:g,p=i.isCaseSensitive,m=void 0===p?I.isCaseSensitive:p,k=i.ignoreLocation,M=void 0===k?I.ignoreLocation:k;if(r(this,e),this.options={location:c,threshold:s,distance:h,includeMatches:f,findAllMatches:v,minMatchCharLength:y,isCaseSensitive:m,ignoreLocation:M},this.pattern=m?t:t.toLowerCase(),this.chunks=[],this.pattern.length){var b=function(e,t){n.chunks.push({pattern:e,alphabet:W(e),startIndex:t})},x=this.pattern.length;if(x>P){for(var w=0,L=x%P,S=x-L;w3&&void 0!==arguments[3]?arguments[3]:{},i=r.location,o=void 0===i?I.location:i,c=r.distance,a=void 0===c?I.distance:c,s=r.threshold,u=void 0===s?I.threshold:s,h=r.findAllMatches,l=void 0===h?I.findAllMatches:h,f=r.minMatchCharLength,d=void 0===f?I.minMatchCharLength:f,v=r.includeMatches,g=void 0===v?I.includeMatches:v,y=r.ignoreLocation,p=void 0===y?I.ignoreLocation:y;if(t.length>P)throw new Error(w(P));for(var m,k=t.length,M=e.length,b=Math.max(0,Math.min(o,M)),x=u,L=b,S=d>1||g,_=S?Array(M):[];(m=e.indexOf(t,L))>-1;){var O=R(t,{currentLocation:m,expectedLocation:b,distance:a,ignoreLocation:p});if(x=Math.min(O,x),L=m+k,S)for(var j=0;j=z;q-=1){var B=q-1,J=n[e.charAt(B)];if(S&&(_[B]=+!!J),K[q]=(K[q+1]<<1|1)&J,F&&(K[q]|=(A[q+1]|A[q])<<1|1|A[q+1]),K[q]&$&&(C=R(t,{errors:F,currentLocation:B,expectedLocation:b,distance:a,ignoreLocation:p}))<=x){if(x=C,(L=B)<=b)break;z=Math.max(1,2*b-L)}}if(R(t,{errors:F+1,currentLocation:b,expectedLocation:b,distance:a,ignoreLocation:p})>x)break;A=K}var U={isMatch:L>=0,score:Math.max(.001,C)};if(S){var V=N(_,d);V.length?g&&(U.indices=V):U.isMatch=!1}return U}(e,n,i,{location:c+o,distance:a,threshold:s,findAllMatches:u,minMatchCharLength:h,includeMatches:r,ignoreLocation:l}),p=y.isMatch,m=y.score,k=y.indices;p&&(g=!0),v+=m,p&&k&&(d=[].concat(f(d),f(k)))}));var y={isMatch:g,score:g?v/this.chunks.length:1};return g&&r&&(y.indices=d),y}}]),e}(),z=function(){function e(t){r(this,e),this.pattern=t}return o(e,[{key:"search",value:function(){}}],[{key:"isMultiMatch",value:function(e){return D(e,this.multiRegex)}},{key:"isSingleMatch",value:function(e){return D(e,this.singleRegex)}}]),e}();function D(e,t){var n=e.match(t);return n?n[1]:null}var K=function(e){a(n,e);var t=l(n);function n(e){return r(this,n),t.call(this,e)}return o(n,[{key:"search",value:function(e){var t=e===this.pattern;return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}],[{key:"type",get:function(){return"exact"}},{key:"multiRegex",get:function(){return/^="(.*)"$/}},{key:"singleRegex",get:function(){return/^=(.*)$/}}]),n}(z),q=function(e){a(n,e);var t=l(n);function n(e){return r(this,n),t.call(this,e)}return o(n,[{key:"search",value:function(e){var t=-1===e.indexOf(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}],[{key:"type",get:function(){return"inverse-exact"}},{key:"multiRegex",get:function(){return/^!"(.*)"$/}},{key:"singleRegex",get:function(){return/^!(.*)$/}}]),n}(z),B=function(e){a(n,e);var t=l(n);function n(e){return r(this,n),t.call(this,e)}return o(n,[{key:"search",value:function(e){var t=e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}],[{key:"type",get:function(){return"prefix-exact"}},{key:"multiRegex",get:function(){return/^\^"(.*)"$/}},{key:"singleRegex",get:function(){return/^\^(.*)$/}}]),n}(z),J=function(e){a(n,e);var t=l(n);function n(e){return r(this,n),t.call(this,e)}return o(n,[{key:"search",value:function(e){var t=!e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}],[{key:"type",get:function(){return"inverse-prefix-exact"}},{key:"multiRegex",get:function(){return/^!\^"(.*)"$/}},{key:"singleRegex",get:function(){return/^!\^(.*)$/}}]),n}(z),U=function(e){a(n,e);var t=l(n);function n(e){return r(this,n),t.call(this,e)}return o(n,[{key:"search",value:function(e){var t=e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}],[{key:"type",get:function(){return"suffix-exact"}},{key:"multiRegex",get:function(){return/^"(.*)"\$$/}},{key:"singleRegex",get:function(){return/^(.*)\$$/}}]),n}(z),V=function(e){a(n,e);var t=l(n);function n(e){return r(this,n),t.call(this,e)}return o(n,[{key:"search",value:function(e){var t=!e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}],[{key:"type",get:function(){return"inverse-suffix-exact"}},{key:"multiRegex",get:function(){return/^!"(.*)"\$$/}},{key:"singleRegex",get:function(){return/^!(.*)\$$/}}]),n}(z),G=function(e){a(n,e);var t=l(n);function n(e){var i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=o.location,a=void 0===c?I.location:c,s=o.threshold,u=void 0===s?I.threshold:s,h=o.distance,l=void 0===h?I.distance:h,f=o.includeMatches,d=void 0===f?I.includeMatches:f,v=o.findAllMatches,g=void 0===v?I.findAllMatches:v,y=o.minMatchCharLength,p=void 0===y?I.minMatchCharLength:y,m=o.isCaseSensitive,k=void 0===m?I.isCaseSensitive:m,M=o.ignoreLocation,b=void 0===M?I.ignoreLocation:M;return r(this,n),(i=t.call(this,e))._bitapSearch=new T(e,{location:a,threshold:u,distance:l,includeMatches:d,findAllMatches:g,minMatchCharLength:p,isCaseSensitive:k,ignoreLocation:b}),i}return o(n,[{key:"search",value:function(e){return this._bitapSearch.searchIn(e)}}],[{key:"type",get:function(){return"fuzzy"}},{key:"multiRegex",get:function(){return/^"(.*)"$/}},{key:"singleRegex",get:function(){return/^(.*)$/}}]),n}(z),H=function(e){a(n,e);var t=l(n);function n(e){return r(this,n),t.call(this,e)}return o(n,[{key:"search",value:function(e){for(var t,n=0,r=[],i=this.pattern.length;(t=e.indexOf(this.pattern,n))>-1;)n=t+i,r.push([t,n-1]);var o=!!r.length;return{isMatch:o,score:o?0:1,indices:r}}}],[{key:"type",get:function(){return"include"}},{key:"multiRegex",get:function(){return/^'"(.*)"$/}},{key:"singleRegex",get:function(){return/^'(.*)$/}}]),n}(z),Q=[K,H,B,J,V,U,q,G],X=Q.length,Y=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/;function Z(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.split("|").map((function(e){for(var n=e.trim().split(Y).filter((function(e){return e&&!!e.trim()})),r=[],i=0,o=n.length;i1&&void 0!==arguments[1]?arguments[1]:{},i=n.isCaseSensitive,o=void 0===i?I.isCaseSensitive:i,c=n.includeMatches,a=void 0===c?I.includeMatches:c,s=n.minMatchCharLength,u=void 0===s?I.minMatchCharLength:s,h=n.ignoreLocation,l=void 0===h?I.ignoreLocation:h,f=n.findAllMatches,d=void 0===f?I.findAllMatches:f,v=n.location,g=void 0===v?I.location:v,y=n.threshold,p=void 0===y?I.threshold:y,m=n.distance,k=void 0===m?I.distance:m;r(this,e),this.query=null,this.options={isCaseSensitive:o,includeMatches:a,minMatchCharLength:u,findAllMatches:d,ignoreLocation:l,location:g,threshold:p,distance:k},this.pattern=o?t:t.toLowerCase(),this.query=Z(this.pattern,this.options)}return o(e,[{key:"searchIn",value:function(e){var t=this.query;if(!t)return{isMatch:!1,score:1};var n=this.options,r=n.includeMatches;e=n.isCaseSensitive?e:e.toLowerCase();for(var i=0,o=[],c=0,a=0,s=t.length;a-1&&(n.refIndex=e.idx),t.matches.push(n)}}))}function ve(e,t){t.score=e.score}function ge(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.includeMatches,i=void 0===r?I.includeMatches:r,o=n.includeScore,c=void 0===o?I.includeScore:o,a=[];return i&&a.push(de),c&&a.push(ve),e.map((function(e){var n=e.idx,r={item:t[n],refIndex:n};return a.length&&a.forEach((function(t){t(e,r)})),r}))}var ye=function(){function e(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;r(this,e),this.options=t(t({},I),i),this.options.useExtendedSearch,this._keyStore=new S(this.options.keys),this.setCollection(n,o)}return o(e,[{key:"setCollection",value:function(e,t){if(this._docs=e,t&&!(t instanceof $))throw new Error("Incorrect 'index' type");this._myIndex=t||F(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}},{key:"add",value:function(e){k(e)&&(this._docs.push(e),this._myIndex.add(e))}},{key:"remove",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){return!1},t=[],n=0,r=this._docs.length;n1&&void 0!==arguments[1]?arguments[1]:{},n=t.limit,r=void 0===n?-1:n,i=this.options,o=i.includeMatches,c=i.includeScore,a=i.shouldSort,s=i.sortFn,u=i.ignoreFieldNorm,h=g(e)?g(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return fe(h,{ignoreFieldNorm:u}),a&&h.sort(s),y(r)&&r>-1&&(h=h.slice(0,r)),ge(h,this._docs,{includeMatches:o,includeScore:c})}},{key:"_searchStringList",value:function(e){var t=re(e,this.options),n=this._myIndex.records,r=[];return n.forEach((function(e){var n=e.v,i=e.i,o=e.n;if(k(n)){var c=t.searchIn(n),a=c.isMatch,s=c.score,u=c.indices;a&&r.push({item:n,idx:i,matches:[{score:s,value:n,norm:o,indices:u}]})}})),r}},{key:"_searchLogical",value:function(e){var t=this,n=function(e,t){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).auto,r=void 0===n||n,i=function e(n){var i=Object.keys(n),o=ue(n);if(!o&&i.length>1&&!se(n))return e(le(n));if(he(n)){var c=o?n[ce]:i[0],a=o?n[ae]:n[c];if(!g(a))throw new Error(x(c));var s={keyId:j(c),pattern:a};return r&&(s.searcher=re(a,t)),s}var u={children:[],operator:i[0]};return i.forEach((function(t){var r=n[t];v(r)&&r.forEach((function(t){u.children.push(e(t))}))})),u};return se(e)||(e=le(e)),i(e)}(e,this.options),r=function e(n,r,i){if(!n.children){var o=n.keyId,c=n.searcher,a=t._findMatches({key:t._keyStore.get(o),value:t._myIndex.getValueForItemAtKeyId(r,o),searcher:c});return a&&a.length?[{idx:i,item:r,matches:a}]:[]}for(var s=[],u=0,h=n.children.length;u1&&void 0!==arguments[1]?arguments[1]:{},n=t.getFn,r=void 0===n?I.getFn:n,i=t.fieldNormWeight,o=void 0===i?I.fieldNormWeight:i,c=e.keys,a=e.records,s=new $({getFn:r,fieldNormWeight:o});return s.setKeys(c),s.setIndexRecords(a),s},ye.config=I,function(){ne.push.apply(ne,arguments)}(te),ye},"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Fuse=t(); -------------------------------------------------------------------------------- /docs/site_libs/quarto-html/tippy.umd.min.js: -------------------------------------------------------------------------------- 1 | !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("@popperjs/core")):"function"==typeof define&&define.amd?define(["@popperjs/core"],t):(e=e||self).tippy=t(e.Popper)}(this,(function(e){"use strict";var t={passive:!0,capture:!0},n=function(){return document.body};function r(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function o(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function i(e,t){return"function"==typeof e?e.apply(void 0,t):e}function a(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function s(e,t){var n=Object.assign({},e);return t.forEach((function(e){delete n[e]})),n}function u(e){return[].concat(e)}function c(e,t){-1===e.indexOf(t)&&e.push(t)}function p(e){return e.split("-")[0]}function f(e){return[].slice.call(e)}function l(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}function d(){return document.createElement("div")}function v(e){return["Element","Fragment"].some((function(t){return o(e,t)}))}function m(e){return o(e,"MouseEvent")}function g(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function h(e){return v(e)?[e]:function(e){return o(e,"NodeList")}(e)?f(e):Array.isArray(e)?e:f(document.querySelectorAll(e))}function b(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function y(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function w(e){var t,n=u(e)[0];return null!=n&&null!=(t=n.ownerDocument)&&t.body?n.ownerDocument:document}function E(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}function O(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=null==n.getRootNode||null==(r=n.getRootNode())?void 0:r.host}return!1}var x={isTouch:!1},C=0;function T(){x.isTouch||(x.isTouch=!0,window.performance&&document.addEventListener("mousemove",A))}function A(){var e=performance.now();e-C<20&&(x.isTouch=!1,document.removeEventListener("mousemove",A)),C=e}function L(){var e=document.activeElement;if(g(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var D=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto,R=Object.assign({appendTo:n,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),k=Object.keys(R);function P(e){var t=(e.plugins||[]).reduce((function(t,n){var r,o=n.name,i=n.defaultValue;o&&(t[o]=void 0!==e[o]?e[o]:null!=(r=R[o])?r:i);return t}),{});return Object.assign({},e,t)}function j(e,t){var n=Object.assign({},t,{content:i(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(P(Object.assign({},R,{plugins:t}))):k).reduce((function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch(e){t[n]=r}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},R.aria,n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function M(e,t){e.innerHTML=t}function V(e){var t=d();return!0===e?t.className="tippy-arrow":(t.className="tippy-svg-arrow",v(e)?t.appendChild(e):M(t,e)),t}function I(e,t){v(t.content)?(M(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?M(e,t.content):e.textContent=t.content)}function S(e){var t=e.firstElementChild,n=f(t.children);return{box:t,content:n.find((function(e){return e.classList.contains("tippy-content")})),arrow:n.find((function(e){return e.classList.contains("tippy-arrow")||e.classList.contains("tippy-svg-arrow")})),backdrop:n.find((function(e){return e.classList.contains("tippy-backdrop")}))}}function N(e){var t=d(),n=d();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=d();function o(n,r){var o=S(t),i=o.box,a=o.content,s=o.arrow;r.theme?i.setAttribute("data-theme",r.theme):i.removeAttribute("data-theme"),"string"==typeof r.animation?i.setAttribute("data-animation",r.animation):i.removeAttribute("data-animation"),r.inertia?i.setAttribute("data-inertia",""):i.removeAttribute("data-inertia"),i.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?i.setAttribute("role",r.role):i.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||I(a,e.props),r.arrow?s?n.arrow!==r.arrow&&(i.removeChild(s),i.appendChild(V(r.arrow))):i.appendChild(V(r.arrow)):s&&i.removeChild(s)}return r.className="tippy-content",r.setAttribute("data-state","hidden"),I(r,e.props),t.appendChild(n),n.appendChild(r),o(e.props,e.props),{popper:t,onUpdate:o}}N.$$tippy=!0;var B=1,H=[],U=[];function _(o,s){var v,g,h,C,T,A,L,k,M=j(o,Object.assign({},R,P(l(s)))),V=!1,I=!1,N=!1,_=!1,F=[],W=a(we,M.interactiveDebounce),X=B++,Y=(k=M.plugins).filter((function(e,t){return k.indexOf(e)===t})),$={id:X,reference:o,popper:d(),popperInstance:null,props:M,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:Y,clearDelayTimeouts:function(){clearTimeout(v),clearTimeout(g),cancelAnimationFrame(h)},setProps:function(e){if($.state.isDestroyed)return;ae("onBeforeUpdate",[$,e]),be();var t=$.props,n=j(o,Object.assign({},t,l(e),{ignoreAttributes:!0}));$.props=n,he(),t.interactiveDebounce!==n.interactiveDebounce&&(ce(),W=a(we,n.interactiveDebounce));t.triggerTarget&&!n.triggerTarget?u(t.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):n.triggerTarget&&o.removeAttribute("aria-expanded");ue(),ie(),J&&J(t,n);$.popperInstance&&(Ce(),Ae().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));ae("onAfterUpdate",[$,e])},setContent:function(e){$.setProps({content:e})},show:function(){var e=$.state.isVisible,t=$.state.isDestroyed,o=!$.state.isEnabled,a=x.isTouch&&!$.props.touch,s=r($.props.duration,0,R.duration);if(e||t||o||a)return;if(te().hasAttribute("disabled"))return;if(ae("onShow",[$],!1),!1===$.props.onShow($))return;$.state.isVisible=!0,ee()&&(z.style.visibility="visible");ie(),de(),$.state.isMounted||(z.style.transition="none");if(ee()){var u=re(),p=u.box,f=u.content;b([p,f],0)}A=function(){var e;if($.state.isVisible&&!_){if(_=!0,z.offsetHeight,z.style.transition=$.props.moveTransition,ee()&&$.props.animation){var t=re(),n=t.box,r=t.content;b([n,r],s),y([n,r],"visible")}se(),ue(),c(U,$),null==(e=$.popperInstance)||e.forceUpdate(),ae("onMount",[$]),$.props.animation&&ee()&&function(e,t){me(e,t)}(s,(function(){$.state.isShown=!0,ae("onShown",[$])}))}},function(){var e,t=$.props.appendTo,r=te();e=$.props.interactive&&t===n||"parent"===t?r.parentNode:i(t,[r]);e.contains(z)||e.appendChild(z);$.state.isMounted=!0,Ce()}()},hide:function(){var e=!$.state.isVisible,t=$.state.isDestroyed,n=!$.state.isEnabled,o=r($.props.duration,1,R.duration);if(e||t||n)return;if(ae("onHide",[$],!1),!1===$.props.onHide($))return;$.state.isVisible=!1,$.state.isShown=!1,_=!1,V=!1,ee()&&(z.style.visibility="hidden");if(ce(),ve(),ie(!0),ee()){var i=re(),a=i.box,s=i.content;$.props.animation&&(b([a,s],o),y([a,s],"hidden"))}se(),ue(),$.props.animation?ee()&&function(e,t){me(e,(function(){!$.state.isVisible&&z.parentNode&&z.parentNode.contains(z)&&t()}))}(o,$.unmount):$.unmount()},hideWithInteractivity:function(e){ne().addEventListener("mousemove",W),c(H,W),W(e)},enable:function(){$.state.isEnabled=!0},disable:function(){$.hide(),$.state.isEnabled=!1},unmount:function(){$.state.isVisible&&$.hide();if(!$.state.isMounted)return;Te(),Ae().forEach((function(e){e._tippy.unmount()})),z.parentNode&&z.parentNode.removeChild(z);U=U.filter((function(e){return e!==$})),$.state.isMounted=!1,ae("onHidden",[$])},destroy:function(){if($.state.isDestroyed)return;$.clearDelayTimeouts(),$.unmount(),be(),delete o._tippy,$.state.isDestroyed=!0,ae("onDestroy",[$])}};if(!M.render)return $;var q=M.render($),z=q.popper,J=q.onUpdate;z.setAttribute("data-tippy-root",""),z.id="tippy-"+$.id,$.popper=z,o._tippy=$,z._tippy=$;var G=Y.map((function(e){return e.fn($)})),K=o.hasAttribute("aria-expanded");return he(),ue(),ie(),ae("onCreate",[$]),M.showOnCreate&&Le(),z.addEventListener("mouseenter",(function(){$.props.interactive&&$.state.isVisible&&$.clearDelayTimeouts()})),z.addEventListener("mouseleave",(function(){$.props.interactive&&$.props.trigger.indexOf("mouseenter")>=0&&ne().addEventListener("mousemove",W)})),$;function Q(){var e=$.props.touch;return Array.isArray(e)?e:[e,0]}function Z(){return"hold"===Q()[0]}function ee(){var e;return!(null==(e=$.props.render)||!e.$$tippy)}function te(){return L||o}function ne(){var e=te().parentNode;return e?w(e):document}function re(){return S(z)}function oe(e){return $.state.isMounted&&!$.state.isVisible||x.isTouch||C&&"focus"===C.type?0:r($.props.delay,e?0:1,R.delay)}function ie(e){void 0===e&&(e=!1),z.style.pointerEvents=$.props.interactive&&!e?"":"none",z.style.zIndex=""+$.props.zIndex}function ae(e,t,n){var r;(void 0===n&&(n=!0),G.forEach((function(n){n[e]&&n[e].apply(n,t)})),n)&&(r=$.props)[e].apply(r,t)}function se(){var e=$.props.aria;if(e.content){var t="aria-"+e.content,n=z.id;u($.props.triggerTarget||o).forEach((function(e){var r=e.getAttribute(t);if($.state.isVisible)e.setAttribute(t,r?r+" "+n:n);else{var o=r&&r.replace(n,"").trim();o?e.setAttribute(t,o):e.removeAttribute(t)}}))}}function ue(){!K&&$.props.aria.expanded&&u($.props.triggerTarget||o).forEach((function(e){$.props.interactive?e.setAttribute("aria-expanded",$.state.isVisible&&e===te()?"true":"false"):e.removeAttribute("aria-expanded")}))}function ce(){ne().removeEventListener("mousemove",W),H=H.filter((function(e){return e!==W}))}function pe(e){if(!x.isTouch||!N&&"mousedown"!==e.type){var t=e.composedPath&&e.composedPath()[0]||e.target;if(!$.props.interactive||!O(z,t)){if(u($.props.triggerTarget||o).some((function(e){return O(e,t)}))){if(x.isTouch)return;if($.state.isVisible&&$.props.trigger.indexOf("click")>=0)return}else ae("onClickOutside",[$,e]);!0===$.props.hideOnClick&&($.clearDelayTimeouts(),$.hide(),I=!0,setTimeout((function(){I=!1})),$.state.isMounted||ve())}}}function fe(){N=!0}function le(){N=!1}function de(){var e=ne();e.addEventListener("mousedown",pe,!0),e.addEventListener("touchend",pe,t),e.addEventListener("touchstart",le,t),e.addEventListener("touchmove",fe,t)}function ve(){var e=ne();e.removeEventListener("mousedown",pe,!0),e.removeEventListener("touchend",pe,t),e.removeEventListener("touchstart",le,t),e.removeEventListener("touchmove",fe,t)}function me(e,t){var n=re().box;function r(e){e.target===n&&(E(n,"remove",r),t())}if(0===e)return t();E(n,"remove",T),E(n,"add",r),T=r}function ge(e,t,n){void 0===n&&(n=!1),u($.props.triggerTarget||o).forEach((function(r){r.addEventListener(e,t,n),F.push({node:r,eventType:e,handler:t,options:n})}))}function he(){var e;Z()&&(ge("touchstart",ye,{passive:!0}),ge("touchend",Ee,{passive:!0})),(e=$.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(ge(e,ye),e){case"mouseenter":ge("mouseleave",Ee);break;case"focus":ge(D?"focusout":"blur",Oe);break;case"focusin":ge("focusout",Oe)}}))}function be(){F.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,o=e.options;t.removeEventListener(n,r,o)})),F=[]}function ye(e){var t,n=!1;if($.state.isEnabled&&!xe(e)&&!I){var r="focus"===(null==(t=C)?void 0:t.type);C=e,L=e.currentTarget,ue(),!$.state.isVisible&&m(e)&&H.forEach((function(t){return t(e)})),"click"===e.type&&($.props.trigger.indexOf("mouseenter")<0||V)&&!1!==$.props.hideOnClick&&$.state.isVisible?n=!0:Le(e),"click"===e.type&&(V=!n),n&&!r&&De(e)}}function we(e){var t=e.target,n=te().contains(t)||z.contains(t);"mousemove"===e.type&&n||function(e,t){var n=t.clientX,r=t.clientY;return e.every((function(e){var t=e.popperRect,o=e.popperState,i=e.props.interactiveBorder,a=p(o.placement),s=o.modifiersData.offset;if(!s)return!0;var u="bottom"===a?s.top.y:0,c="top"===a?s.bottom.y:0,f="right"===a?s.left.x:0,l="left"===a?s.right.x:0,d=t.top-r+u>i,v=r-t.bottom-c>i,m=t.left-n+f>i,g=n-t.right-l>i;return d||v||m||g}))}(Ae().concat(z).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:M}:null})).filter(Boolean),e)&&(ce(),De(e))}function Ee(e){xe(e)||$.props.trigger.indexOf("click")>=0&&V||($.props.interactive?$.hideWithInteractivity(e):De(e))}function Oe(e){$.props.trigger.indexOf("focusin")<0&&e.target!==te()||$.props.interactive&&e.relatedTarget&&z.contains(e.relatedTarget)||De(e)}function xe(e){return!!x.isTouch&&Z()!==e.type.indexOf("touch")>=0}function Ce(){Te();var t=$.props,n=t.popperOptions,r=t.placement,i=t.offset,a=t.getReferenceClientRect,s=t.moveTransition,u=ee()?S(z).arrow:null,c=a?{getBoundingClientRect:a,contextElement:a.contextElement||te()}:o,p=[{name:"offset",options:{offset:i}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!s}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(ee()){var n=re().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)})),t.attributes.popper={}}}}];ee()&&u&&p.push({name:"arrow",options:{element:u,padding:3}}),p.push.apply(p,(null==n?void 0:n.modifiers)||[]),$.popperInstance=e.createPopper(c,z,Object.assign({},n,{placement:r,onFirstUpdate:A,modifiers:p}))}function Te(){$.popperInstance&&($.popperInstance.destroy(),$.popperInstance=null)}function Ae(){return f(z.querySelectorAll("[data-tippy-root]"))}function Le(e){$.clearDelayTimeouts(),e&&ae("onTrigger",[$,e]),de();var t=oe(!0),n=Q(),r=n[0],o=n[1];x.isTouch&&"hold"===r&&o&&(t=o),t?v=setTimeout((function(){$.show()}),t):$.show()}function De(e){if($.clearDelayTimeouts(),ae("onUntrigger",[$,e]),$.state.isVisible){if(!($.props.trigger.indexOf("mouseenter")>=0&&$.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&V)){var t=oe(!1);t?g=setTimeout((function(){$.state.isVisible&&$.hide()}),t):h=requestAnimationFrame((function(){$.hide()}))}}else ve()}}function F(e,n){void 0===n&&(n={});var r=R.plugins.concat(n.plugins||[]);document.addEventListener("touchstart",T,t),window.addEventListener("blur",L);var o=Object.assign({},n,{plugins:r}),i=h(e).reduce((function(e,t){var n=t&&_(t,o);return n&&e.push(n),e}),[]);return v(e)?i[0]:i}F.defaultProps=R,F.setDefaultProps=function(e){Object.keys(e).forEach((function(t){R[t]=e[t]}))},F.currentInput=x;var W=Object.assign({},e.applyStyles,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}}),X={mouseover:"mouseenter",focusin:"focus",click:"click"};var Y={name:"animateFill",defaultValue:!1,fn:function(e){var t;if(null==(t=e.props.render)||!t.$$tippy)return{};var n=S(e.popper),r=n.box,o=n.content,i=e.props.animateFill?function(){var e=d();return e.className="tippy-backdrop",y([e],"hidden"),e}():null;return{onCreate:function(){i&&(r.insertBefore(i,r.firstElementChild),r.setAttribute("data-animatefill",""),r.style.overflow="hidden",e.setProps({arrow:!1,animation:"shift-away"}))},onMount:function(){if(i){var e=r.style.transitionDuration,t=Number(e.replace("ms",""));o.style.transitionDelay=Math.round(t/10)+"ms",i.style.transitionDuration=e,y([i],"visible")}},onShow:function(){i&&(i.style.transitionDuration="0ms")},onHide:function(){i&&y([i],"hidden")}}}};var $={clientX:0,clientY:0},q=[];function z(e){var t=e.clientX,n=e.clientY;$={clientX:t,clientY:n}}var J={name:"followCursor",defaultValue:!1,fn:function(e){var t=e.reference,n=w(e.props.triggerTarget||t),r=!1,o=!1,i=!0,a=e.props;function s(){return"initial"===e.props.followCursor&&e.state.isVisible}function u(){n.addEventListener("mousemove",f)}function c(){n.removeEventListener("mousemove",f)}function p(){r=!0,e.setProps({getReferenceClientRect:null}),r=!1}function f(n){var r=!n.target||t.contains(n.target),o=e.props.followCursor,i=n.clientX,a=n.clientY,s=t.getBoundingClientRect(),u=i-s.left,c=a-s.top;!r&&e.props.interactive||e.setProps({getReferenceClientRect:function(){var e=t.getBoundingClientRect(),n=i,r=a;"initial"===o&&(n=e.left+u,r=e.top+c);var s="horizontal"===o?e.top:r,p="vertical"===o?e.right:n,f="horizontal"===o?e.bottom:r,l="vertical"===o?e.left:n;return{width:p-l,height:f-s,top:s,right:p,bottom:f,left:l}}})}function l(){e.props.followCursor&&(q.push({instance:e,doc:n}),function(e){e.addEventListener("mousemove",z)}(n))}function d(){0===(q=q.filter((function(t){return t.instance!==e}))).filter((function(e){return e.doc===n})).length&&function(e){e.removeEventListener("mousemove",z)}(n)}return{onCreate:l,onDestroy:d,onBeforeUpdate:function(){a=e.props},onAfterUpdate:function(t,n){var i=n.followCursor;r||void 0!==i&&a.followCursor!==i&&(d(),i?(l(),!e.state.isMounted||o||s()||u()):(c(),p()))},onMount:function(){e.props.followCursor&&!o&&(i&&(f($),i=!1),s()||u())},onTrigger:function(e,t){m(t)&&($={clientX:t.clientX,clientY:t.clientY}),o="focus"===t.type},onHidden:function(){e.props.followCursor&&(p(),c(),i=!0)}}}};var G={name:"inlinePositioning",defaultValue:!1,fn:function(e){var t,n=e.reference;var r=-1,o=!1,i=[],a={name:"tippyInlinePositioning",enabled:!0,phase:"afterWrite",fn:function(o){var a=o.state;e.props.inlinePositioning&&(-1!==i.indexOf(a.placement)&&(i=[]),t!==a.placement&&-1===i.indexOf(a.placement)&&(i.push(a.placement),e.setProps({getReferenceClientRect:function(){return function(e){return function(e,t,n,r){if(n.length<2||null===e)return t;if(2===n.length&&r>=0&&n[0].left>n[1].right)return n[r]||t;switch(e){case"top":case"bottom":var o=n[0],i=n[n.length-1],a="top"===e,s=o.top,u=i.bottom,c=a?o.left:i.left,p=a?o.right:i.right;return{top:s,bottom:u,left:c,right:p,width:p-c,height:u-s};case"left":case"right":var f=Math.min.apply(Math,n.map((function(e){return e.left}))),l=Math.max.apply(Math,n.map((function(e){return e.right}))),d=n.filter((function(t){return"left"===e?t.left===f:t.right===l})),v=d[0].top,m=d[d.length-1].bottom;return{top:v,bottom:m,left:f,right:l,width:l-f,height:m-v};default:return t}}(p(e),n.getBoundingClientRect(),f(n.getClientRects()),r)}(a.placement)}})),t=a.placement)}};function s(){var t;o||(t=function(e,t){var n;return{popperOptions:Object.assign({},e.popperOptions,{modifiers:[].concat(((null==(n=e.popperOptions)?void 0:n.modifiers)||[]).filter((function(e){return e.name!==t.name})),[t])})}}(e.props,a),o=!0,e.setProps(t),o=!1)}return{onCreate:s,onAfterUpdate:s,onTrigger:function(t,n){if(m(n)){var o=f(e.reference.getClientRects()),i=o.find((function(e){return e.left-2<=n.clientX&&e.right+2>=n.clientX&&e.top-2<=n.clientY&&e.bottom+2>=n.clientY})),a=o.indexOf(i);r=a>-1?a:r}},onHidden:function(){r=-1}}}};var K={name:"sticky",defaultValue:!1,fn:function(e){var t=e.reference,n=e.popper;function r(t){return!0===e.props.sticky||e.props.sticky===t}var o=null,i=null;function a(){var s=r("reference")?(e.popperInstance?e.popperInstance.state.elements.reference:t).getBoundingClientRect():null,u=r("popper")?n.getBoundingClientRect():null;(s&&Q(o,s)||u&&Q(i,u))&&e.popperInstance&&e.popperInstance.update(),o=s,i=u,e.state.isMounted&&requestAnimationFrame(a)}return{onMount:function(){e.props.sticky&&a()}}}};function Q(e,t){return!e||!t||(e.top!==t.top||e.right!==t.right||e.bottom!==t.bottom||e.left!==t.left)}return F.setDefaultProps({plugins:[Y,J,G,K],render:N}),F.createSingleton=function(e,t){var n;void 0===t&&(t={});var r,o=e,i=[],a=[],c=t.overrides,p=[],f=!1;function l(){a=o.map((function(e){return u(e.props.triggerTarget||e.reference)})).reduce((function(e,t){return e.concat(t)}),[])}function v(){i=o.map((function(e){return e.reference}))}function m(e){o.forEach((function(t){e?t.enable():t.disable()}))}function g(e){return o.map((function(t){var n=t.setProps;return t.setProps=function(o){n(o),t.reference===r&&e.setProps(o)},function(){t.setProps=n}}))}function h(e,t){var n=a.indexOf(t);if(t!==r){r=t;var s=(c||[]).concat("content").reduce((function(e,t){return e[t]=o[n].props[t],e}),{});e.setProps(Object.assign({},s,{getReferenceClientRect:"function"==typeof s.getReferenceClientRect?s.getReferenceClientRect:function(){var e;return null==(e=i[n])?void 0:e.getBoundingClientRect()}}))}}m(!1),v(),l();var b={fn:function(){return{onDestroy:function(){m(!0)},onHidden:function(){r=null},onClickOutside:function(e){e.props.showOnCreate&&!f&&(f=!0,r=null)},onShow:function(e){e.props.showOnCreate&&!f&&(f=!0,h(e,i[0]))},onTrigger:function(e,t){h(e,t.currentTarget)}}}},y=F(d(),Object.assign({},s(t,["overrides"]),{plugins:[b].concat(t.plugins||[]),triggerTarget:a,popperOptions:Object.assign({},t.popperOptions,{modifiers:[].concat((null==(n=t.popperOptions)?void 0:n.modifiers)||[],[W])})})),w=y.show;y.show=function(e){if(w(),!r&&null==e)return h(y,i[0]);if(!r||null!=e){if("number"==typeof e)return i[e]&&h(y,i[e]);if(o.indexOf(e)>=0){var t=e.reference;return h(y,t)}return i.indexOf(e)>=0?h(y,e):void 0}},y.showNext=function(){var e=i[0];if(!r)return y.show(0);var t=i.indexOf(r);y.show(i[t+1]||e)},y.showPrevious=function(){var e=i[i.length-1];if(!r)return y.show(e);var t=i.indexOf(r),n=i[t-1]||e;y.show(n)};var E=y.setProps;return y.setProps=function(e){c=e.overrides||c,E(e)},y.setInstances=function(e){m(!0),p.forEach((function(e){return e()})),o=e,m(!1),v(),l(),p=g(y),y.setProps({triggerTarget:a})},p=g(y),y},F.delegate=function(e,n){var r=[],o=[],i=!1,a=n.target,c=s(n,["target"]),p=Object.assign({},c,{trigger:"manual",touch:!1}),f=Object.assign({touch:R.touch},c,{showOnCreate:!0}),l=F(e,p);function d(e){if(e.target&&!i){var t=e.target.closest(a);if(t){var r=t.getAttribute("data-tippy-trigger")||n.trigger||R.trigger;if(!t._tippy&&!("touchstart"===e.type&&"boolean"==typeof f.touch||"touchstart"!==e.type&&r.indexOf(X[e.type])<0)){var s=F(t,f);s&&(o=o.concat(s))}}}}function v(e,t,n,o){void 0===o&&(o=!1),e.addEventListener(t,n,o),r.push({node:e,eventType:t,handler:n,options:o})}return u(l).forEach((function(e){var n=e.destroy,a=e.enable,s=e.disable;e.destroy=function(e){void 0===e&&(e=!0),e&&o.forEach((function(e){e.destroy()})),o=[],r.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,o=e.options;t.removeEventListener(n,r,o)})),r=[],n()},e.enable=function(){a(),o.forEach((function(e){return e.enable()})),i=!1},e.disable=function(){s(),o.forEach((function(e){return e.disable()})),i=!0},function(e){var n=e.reference;v(n,"touchstart",d,t),v(n,"mouseover",d),v(n,"focusin",d),v(n,"click",d)}(e)})),l},F.hideAll=function(e){var t=void 0===e?{}:e,n=t.exclude,r=t.duration;U.forEach((function(e){var t=!1;if(n&&(t=g(n)?e.reference===n:e.popper===n.popper),!t){var o=e.props.duration;e.setProps({duration:r}),e.hide(),e.state.isDestroyed||e.setProps({duration:o})}}))},F.roundArrow='',F})); 2 | 3 | -------------------------------------------------------------------------------- /docs/references.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | A Quarto Template Repo to Create Big Reports and Very Long Title Because Long Titles are Common - References 11 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 |
124 |
125 | 138 |
139 | 140 |
141 | 142 | 249 |
250 | 251 | 254 | 255 |
256 | 257 |
258 |
259 |

References

260 |
261 | 262 | 263 | 264 |
265 | 266 | 267 | 268 | 269 |
270 | 271 | 272 |
273 | 274 | 277 | 278 | 279 | 280 | 281 | 282 |
283 | 567 | 568 | 585 |
586 | 587 | 588 | 589 | -------------------------------------------------------------------------------- /docs/text/figures.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | A Quarto Template Repo to Create Big Reports and Very Long Title Because Long Titles are Common - 7  Figures intro 11 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 |
105 |
106 | 119 |
120 | 121 |
122 | 123 | 230 |
231 | 232 | 241 | 242 |
243 | 244 |
245 |
246 |

7  Figures intro

247 |
248 | 249 | 250 | 251 |
252 | 253 | 254 | 255 | 256 |
257 | 258 | 259 |
260 | 261 |

This chapter shows a few simple examples of including figures and getting cross-referencing to work across formats (HTML, Word, PDF).

262 |
263 |

7.1 ggplot2

264 |

We can see in Figure 7.1 that there are many time series. The number of panels is choosen automatically using {ggplot2}.

265 | 268 |
269 |
270 |
271 |
272 |

273 |
Figure 7.1: Plot of the data
274 |
275 |
276 |
277 |
278 | 279 | 280 | 281 | 282 |
283 | 284 |
285 | 569 | 604 |
605 | 606 | 607 | 608 | --------------------------------------------------------------------------------