forked from afsc-gap-products/gap_products
-
Notifications
You must be signed in to change notification settings - Fork 0
/
NOAA-quarto-book.tex
824 lines (672 loc) · 25.8 KB
/
NOAA-quarto-book.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
% Options for packages loaded elsewhere
\PassOptionsToPackage{unicode}{hyperref}
\PassOptionsToPackage{hyphens}{url}
%
\documentclass[
letterpaper,
oneside,
open=any]{scrbook}
\usepackage{amsmath,amssymb}
\usepackage{lmodern}
\usepackage{iftex}
\ifPDFTeX
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{textcomp} % provide euro and other symbols
\else % if luatex or xetex
\usepackage{unicode-math}
\defaultfontfeatures{Scale=MatchLowercase}
\defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
\fi
% Use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
\IfFileExists{microtype.sty}{% use microtype if available
\usepackage[]{microtype}
\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{}
\makeatletter
\@ifundefined{KOMAClassName}{% if non-KOMA class
\IfFileExists{parskip.sty}{%
\usepackage{parskip}
}{% else
\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt plus 2pt minus 1pt}}
}{% if KOMA class
\KOMAoptions{parskip=half}}
\makeatother
\usepackage{xcolor}
\setlength{\emergencystretch}{3em} % prevent overfull lines
\setcounter{secnumdepth}{5}
% Make \paragraph and \subparagraph free-standing
\ifx\paragraph\undefined\else
\let\oldparagraph\paragraph
\renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}
\fi
\ifx\subparagraph\undefined\else
\let\oldsubparagraph\subparagraph
\renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
\fi
\usepackage{color}
\usepackage{fancyvrb}
\newcommand{\VerbBar}{|}
\newcommand{\VERB}{\Verb[commandchars=\\\{\}]}
\DefineVerbatimEnvironment{Highlighting}{Verbatim}{commandchars=\\\{\}}
% Add ',fontsize=\small' for more characters per line
\usepackage{framed}
\definecolor{shadecolor}{RGB}{241,243,245}
\newenvironment{Shaded}{\begin{snugshade}}{\end{snugshade}}
\newcommand{\AlertTok}[1]{\textcolor[rgb]{0.68,0.00,0.00}{#1}}
\newcommand{\AnnotationTok}[1]{\textcolor[rgb]{0.37,0.37,0.37}{#1}}
\newcommand{\AttributeTok}[1]{\textcolor[rgb]{0.40,0.45,0.13}{#1}}
\newcommand{\BaseNTok}[1]{\textcolor[rgb]{0.68,0.00,0.00}{#1}}
\newcommand{\BuiltInTok}[1]{\textcolor[rgb]{0.00,0.23,0.31}{#1}}
\newcommand{\CharTok}[1]{\textcolor[rgb]{0.13,0.47,0.30}{#1}}
\newcommand{\CommentTok}[1]{\textcolor[rgb]{0.37,0.37,0.37}{#1}}
\newcommand{\CommentVarTok}[1]{\textcolor[rgb]{0.37,0.37,0.37}{\textit{#1}}}
\newcommand{\ConstantTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{#1}}
\newcommand{\ControlFlowTok}[1]{\textcolor[rgb]{0.00,0.23,0.31}{#1}}
\newcommand{\DataTypeTok}[1]{\textcolor[rgb]{0.68,0.00,0.00}{#1}}
\newcommand{\DecValTok}[1]{\textcolor[rgb]{0.68,0.00,0.00}{#1}}
\newcommand{\DocumentationTok}[1]{\textcolor[rgb]{0.37,0.37,0.37}{\textit{#1}}}
\newcommand{\ErrorTok}[1]{\textcolor[rgb]{0.68,0.00,0.00}{#1}}
\newcommand{\ExtensionTok}[1]{\textcolor[rgb]{0.00,0.23,0.31}{#1}}
\newcommand{\FloatTok}[1]{\textcolor[rgb]{0.68,0.00,0.00}{#1}}
\newcommand{\FunctionTok}[1]{\textcolor[rgb]{0.28,0.35,0.67}{#1}}
\newcommand{\ImportTok}[1]{\textcolor[rgb]{0.00,0.46,0.62}{#1}}
\newcommand{\InformationTok}[1]{\textcolor[rgb]{0.37,0.37,0.37}{#1}}
\newcommand{\KeywordTok}[1]{\textcolor[rgb]{0.00,0.23,0.31}{#1}}
\newcommand{\NormalTok}[1]{\textcolor[rgb]{0.00,0.23,0.31}{#1}}
\newcommand{\OperatorTok}[1]{\textcolor[rgb]{0.37,0.37,0.37}{#1}}
\newcommand{\OtherTok}[1]{\textcolor[rgb]{0.00,0.23,0.31}{#1}}
\newcommand{\PreprocessorTok}[1]{\textcolor[rgb]{0.68,0.00,0.00}{#1}}
\newcommand{\RegionMarkerTok}[1]{\textcolor[rgb]{0.00,0.23,0.31}{#1}}
\newcommand{\SpecialCharTok}[1]{\textcolor[rgb]{0.37,0.37,0.37}{#1}}
\newcommand{\SpecialStringTok}[1]{\textcolor[rgb]{0.13,0.47,0.30}{#1}}
\newcommand{\StringTok}[1]{\textcolor[rgb]{0.13,0.47,0.30}{#1}}
\newcommand{\VariableTok}[1]{\textcolor[rgb]{0.07,0.07,0.07}{#1}}
\newcommand{\VerbatimStringTok}[1]{\textcolor[rgb]{0.13,0.47,0.30}{#1}}
\newcommand{\WarningTok}[1]{\textcolor[rgb]{0.37,0.37,0.37}{\textit{#1}}}
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}\usepackage{longtable,booktabs,array}
\usepackage{calc} % for calculating minipage widths
% Correct order of tables after \paragraph or \subparagraph
\usepackage{etoolbox}
\makeatletter
\patchcmd\longtable{\par}{\if@noskipsec\mbox{}\fi\par}{}{}
\makeatother
% Allow footnotes in longtable head/foot
\IfFileExists{footnotehyper.sty}{\usepackage{footnotehyper}}{\usepackage{footnote}}
\makesavenoteenv{longtable}
\usepackage{graphicx}
\makeatletter
\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
\makeatother
% Scale images if necessary, so that they will not overflow the page
% margins by default, and it is still possible to overwrite the defaults
% using explicit options in \includegraphics[width, height, ...]{}
\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
% Set default figure placement to htbp
\makeatletter
\def\fps@figure{htbp}
\makeatother
\newlength{\cslhangindent}
\setlength{\cslhangindent}{1.5em}
\newlength{\csllabelwidth}
\setlength{\csllabelwidth}{3em}
\newlength{\cslentryspacingunit} % times entry-spacing
\setlength{\cslentryspacingunit}{\parskip}
\newenvironment{CSLReferences}[2] % #1 hanging-ident, #2 entry spacing
{% don't indent paragraphs
\setlength{\parindent}{0pt}
% turn on hanging indent if param 1 is 1
\ifodd #1
\let\oldpar\par
\def\par{\hangindent=\cslhangindent\oldpar}
\fi
% set entry spacing
\setlength{\parskip}{#2\cslentryspacingunit}
}%
{}
\usepackage{calc}
\newcommand{\CSLBlock}[1]{#1\hfill\break}
\newcommand{\CSLLeftMargin}[1]{\parbox[t]{\csllabelwidth}{#1}}
\newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{#1}\break}
\newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1}
\usepackage[default]{opensans}
\fontseries{lc}\selectfont
\makeatletter
\makeatother
\makeatletter
\@ifpackageloaded{bookmark}{}{\usepackage{bookmark}}
\makeatother
\makeatletter
\@ifpackageloaded{caption}{}{\usepackage{caption}}
\AtBeginDocument{%
\ifdefined\contentsname
\renewcommand*\contentsname{Table of contents}
\else
\newcommand\contentsname{Table of contents}
\fi
\ifdefined\listfigurename
\renewcommand*\listfigurename{List of Figures}
\else
\newcommand\listfigurename{List of Figures}
\fi
\ifdefined\listtablename
\renewcommand*\listtablename{List of Tables}
\else
\newcommand\listtablename{List of Tables}
\fi
\ifdefined\figurename
\renewcommand*\figurename{Figure}
\else
\newcommand\figurename{Figure}
\fi
\ifdefined\tablename
\renewcommand*\tablename{Table}
\else
\newcommand\tablename{Table}
\fi
}
\@ifpackageloaded{float}{}{\usepackage{float}}
\floatstyle{ruled}
\@ifundefined{c@chapter}{\newfloat{codelisting}{h}{lop}}{\newfloat{codelisting}{h}{lop}[chapter]}
\floatname{codelisting}{Listing}
\newcommand*\listoflistings{\listof{codelisting}{List of Listings}}
\makeatother
\makeatletter
\@ifpackageloaded{caption}{}{\usepackage{caption}}
\@ifpackageloaded{subcaption}{}{\usepackage{subcaption}}
\makeatother
\makeatletter
\@ifpackageloaded{tcolorbox}{}{\usepackage[many]{tcolorbox}}
\makeatother
\makeatletter
\@ifundefined{shadecolor}{\definecolor{shadecolor}{rgb}{.97, .97, .97}}
\makeatother
\makeatletter
\makeatother
\usepackage{hyphenat}
\usepackage{ifthen}
\usepackage{calc}
\usepackage{calculator}
\usepackage{graphicx}
\usepackage{wallpaper}
\usepackage{geometry}
\usepackage{graphicx}
\usepackage{geometry}
\usepackage{afterpage}
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{fadings}
\usepackage[pagecolor=none]{pagecolor}
% Set the titlepage font families
% Set the coverpage font families
\ifLuaTeX
\usepackage{selnolig} % disable illegal ligatures
\fi
\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
\urlstyle{same} % disable monospaced font for URLs
\hypersetup{
pdftitle={NOAA quarto book},
pdfauthor={Jane Doe; Eva Nováková; Matti Meikäläinen},
hidelinks,
pdfcreator={LaTeX via pandoc}}
\title{NOAA quarto book}
\author{Jane Doe \and Eva Nováková \and Matti Meikäläinen}
\date{}
\begin{document}
%%%%% begin titlepage extension code
\begin{frontmatter}
\begin{titlepage}
% This is a combination of Pandoc templating and LaTeX
% Pandoc templating https://pandoc.org/MANUAL.html#templates
% See the README for help
\thispagestyle{empty}
\newgeometry{top=-100in}
% Page color
\newcommand{\coverauthorstyle}[1]{{\fontsize{20}{24.0}\selectfont
#1}}
\begin{tikzpicture}[remember picture, overlay, inner sep=0pt, outer sep=0pt]
\tikzfading[name=fadeout, inner color=transparent!0,outer color=transparent!100]
\tikzfading[name=fadein, inner color=transparent!100,outer color=transparent!0]
\node[anchor=south west, rotate=0.0, opacity=1.0] at ($(current page.south west)+(0pt, 8.75in)$) {
\includegraphics[width=\paperwidth, keepaspectratio]{images/cover-header-2.png}};
% Title
\newcommand{\titlelocationleft}{2.3in}
\newcommand{\titlelocationbottom}{7in}
\newcommand{\titlealign}{left}
\begin{scope}
{%
\fontsize{30}{36.0}\selectfont
\node[anchor=north
west, align=left, rotate=0] (Title1) at ($(current page.south west)+(\titlelocationleft,\titlelocationbottom)$) [text width = 5in] {\textcolor{black}{\bfseries{\nohyphens{NOAA
quarto book}}}};
}
\end{scope}
% Author
\newcommand{\authorlocationleft}{2.3in}
\newcommand{\authorlocationbottom}{5in}
\newcommand{\authoralign}{left}
\begin{scope}
{%
\fontsize{20}{24.0}\selectfont
\node[anchor=north
west, align=left, rotate=0] (Author1) at ($(current page.south west)+(\authorlocationleft,\authorlocationbottom)$) [text width = 5in] {
\coverauthorstyle{Jane Doe, Eva Nováková, Matti Meikäläinen\\}};
}
\end{scope}
% Header
\newcommand{\headerlocationleft}{2.3in}
\newcommand{\headerlocationbottom}{9.8in}
\newcommand{\headerlocationalign}{left}
\begin{scope}
{%
\fontsize{16}{19.2}\selectfont
\node[anchor=north west, align=left, rotate=0] (Header1) at %
($(current page.south west)+(\headerlocationleft,\headerlocationbottom)$) [text width = 5in] {\textcolor{white}{\nohyphens{NOAA
Technical Memorandum NMFS-XXX-\#\#}}};
}
\end{scope}
% Footer
\newcommand{\footerlocationleft}{6in}
\newcommand{\footerlocationbottom}{0.1\paperheight}
\newcommand{\footerlocationalign}{left}
\begin{scope}
{%
\fontsize{8}{9.6}\selectfont
\node[anchor=north west, align=left, rotate=0] (Footer1) at %
($(current page.south west)+(\footerlocationleft,\footerlocationbottom)$) [text width = 2.5in] {{\nohyphens{U.S.
DEPARTMENT OF COMMERCE\\
\strut \\
National Oceanic and Atmospheric Administration\\
National Marine Fisheries Service\\
Northwest Fisheries Science Center}}};
}
\end{scope}
\end{tikzpicture}
\clearpage
\restoregeometry
%%% TITLE PAGE START
% Set up alignment commands
%Page
\newcommand{\titlepagepagealign}{
\ifthenelse{\equal{left}{right}}{\raggedleft}{}
\ifthenelse{\equal{left}{center}}{\centering}{}
\ifthenelse{\equal{left}{left}}{\raggedright}{}
}
%% Titles
\newcommand{\titlepagetitlealign}{
\ifthenelse{\equal{left}{right}}{\raggedleft}{}
\ifthenelse{\equal{left}{center}}{\centering}{}
\ifthenelse{\equal{left}{left}}{\raggedright}{}
\ifthenelse{\equal{left}{spread}}{\makebox[\linewidth][s]}{}
}
\newcommand{\titleandsubtitle}{
% Title and subtitle
{\fontsize{30}{36.0}\selectfont
\textcolor{black}{\bfseries{\nohyphens{NOAA quarto book}}}\par
}%
}
\newcommand{\titlepagetitleblock}{
\titleandsubtitle
}
\newcommand{\authorstyle}[1]{{\fontsize{20}{24.0}\selectfont
#1}}
\newcommand{\affiliationstyle}[1]{{#1}}
\newcommand{\titlepageauthorblock}{
\authorstyle{Jane Doe{\textsuperscript{1}}, Eva
Nováková{\textsuperscript{2}} and Matti
Meikäläinen{\textsuperscript{3}}%
}}
\newcommand{\titlepageaffiliationblock}{
\hangindent=1em
\hangafter=1
\affiliationstyle{
{1}.~NOAA Fisheres, Northwest Fisheries Science Center
\par\hangindent=1em\hangafter=1%
{2}.~NOAA Fisheries, West Coast Regional Office
\par\hangindent=1em\hangafter=1%
{3}.~NOAA Fisheries, Southwest Fisheries Science Center
\vspace{1\baselineskip}
}
}
\newcommand{\headerstyled}{%
{}
}
\newcommand{\footerstyled}{%
{}
}
\newcommand{\datestyled}{%
{}
}
\newcommand{\titlepageheaderblock}{\headerstyled}
\newcommand{\titlepagefooterblock}{
\footerstyled
}
\newcommand{\titlepagedateblock}{
\datestyled
}
%set up blocks so user can specify order
\newcommand{\titleblock}{{\titlepagetitlealign
{\titlepagetitleblock}
}
\vspace{4\baselineskip}
}
\newcommand{\authorblock}{{\titlepageauthorblock}
\vspace{2\baselineskip}
}
\newcommand{\affiliationblock}{{\titlepageaffiliationblock}
\vspace{2\baselineskip}
}
\newcommand{\logoblock}{}
\newcommand{\footerblock}{}
\newcommand{\dateblock}{}
\newcommand{\headerblock}{}
\newgeometry{top=3in,bottom=1in,right=1in,left=1.75in}
% background image
\newlength{\bgimagesize}
\setlength{\bgimagesize}{0.75\paperwidth}
\LENGTHDIVIDE{\bgimagesize}{\paperwidth}{\theRatio} % from calculator pkg
\ThisULCornerWallPaper{\theRatio}{images/corner-image.png}
\thispagestyle{empty} % no page numbers on titlepages
\newcommand{\vrulecode}{\rule{\vrulewidth}{\textheight}}
\newlength{\vrulewidth}
\setlength{\vrulewidth}{0pt}
\newlength{\B}
\setlength{\B}{\ifdim\vrulewidth > 0pt 0.05\textwidth\else 0pt\fi}
\newlength{\minipagewidth}
\ifthenelse{\equal{left}{left} \OR \equal{left}{right} }
{% True case
\setlength{\minipagewidth}{\textwidth - \vrulewidth - \B - 0.1\textwidth}
}{
\setlength{\minipagewidth}{\textwidth - 2\vrulewidth - 2\B - 0.1\textwidth}
}
\ifthenelse{\equal{left}{left} \OR \equal{left}{leftright}}
{% True case
\raggedleft % needed for the minipage to work
\vrulecode
\hspace{\B}
}{%
\raggedright % else it is right only and width is not 0
}
% [position of box][box height][inner position]{width}
% [s] means stretch out vertically; assuming there is a vfill
\begin{minipage}[b][\textheight][s]{\minipagewidth}
\titlepagepagealign
\headerblock
\titleblock
\authorblock
\affiliationblock
\vfill
\logoblock
\footerblock
\par
\end{minipage}\ifthenelse{\equal{left}{right} \OR \equal{left}{leftright} }{
\hspace{\B}
\vrulecode}{}
\clearpage
\restoregeometry
%%% TITLE PAGE END
\end{titlepage}
\setcounter{page}{1}
\end{frontmatter}
%%%%% end titlepage extension code\ifdefined\Shaded\renewenvironment{Shaded}{\begin{tcolorbox}[borderline west={3pt}{0pt}{shadecolor}, sharp corners, boxrule=0pt, enhanced, breakable, frame hidden, interior hidden]}{\end{tcolorbox}}\fi
\renewcommand*\contentsname{Table of contents}
{
\setcounter{tocdepth}{1}
\tableofcontents
}
\listoffigures
\listoftables
\mainmatter
\bookmarksetup{startatroot}
\hypertarget{executive-summary}{%
\chapter*{Executive Summary}\label{executive-summary}}
\addcontentsline{toc}{chapter}{Executive Summary}
\markboth{Executive Summary}{Executive Summary}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer commodo
gravida justo consectetur condimentum. Proin eget felis non nunc
tristique malesuada vel ut tortor. Vivamus lacinia aliquet lorem in
congue. In hac habitasse platea dictumst. Etiam non felis iaculis,
efficitur libero in, porta nunc. Sed sit amet nisi non justo scelerisque
feugiat. Pellentesque porta consectetur sapien, porttitor iaculis ligula
fermentum ac. Pellentesque fermentum elementum lacus non tempus. Aenean
eu leo lobortis, vulputate mi at, varius sapien. In congue consectetur
ultricies. Maecenas volutpat facilisis arcu, eget sodales tellus
consequat nec. Integer ullamcorper ex nec leo aliquam tempus. Orci
varius natoque penatibus et magnis dis parturient montes, nascetur
ridiculus mus. Nunc dui massa, facilisis at aliquet eu, malesuada vel
neque. Donec fermentum elit eu tortor euismod, sed mollis lacus blandit.
\bookmarksetup{startatroot}
\hypertarget{set-up}{%
\chapter{Set-up}\label{set-up}}
This is a template for a simple Quarto book output to html, PDF or docx
format. It includes a GitHub Action that will build the website
automatically when you make changes to the files. The NOAA palette and
fonts has been added to \texttt{theme.scss}. The webpage will be on the
\texttt{gh-pages} branch. Serving the website files from this branch is
a common way to keep all the website files from cluttering your main
branch.
The GitHub Action installs R so you can have R code in your qmd or Rmd
files. Note, you do not need to make changes to your Rmd files unless
your need Quarto features like cross-references.
\begin{itemize}
\item
Click the green ``use template'' button to make a repository with this
content. Make sure to make your repo public (since GitHub Pages
doesn't work on private repos unless you have a paid account) and
check box to include all the branches (so that you get the gh-pages
branch).
\item
Turn on GitHub Pages under Settings \textgreater{} Pages . You will
set pages to be made from the gh-pages branch and root directory.
\item
Turn on GitHub Actions under Settings \textgreater{} Actions
\textgreater{} General
\item
Edit the repo description and Readme to add a link to the webpage.
When you edit the description, you will see the link url in the url
box or you can click on the Actions tab or the Settings \textgreater{}
Pages page to find the url.
\end{itemize}
\bookmarksetup{startatroot}
\hypertarget{customize}{%
\chapter{Customize}\label{customize}}
Edit the qmd or md files in the \texttt{content} folder. qmd files can
include code (R, Python, Julia) and lots of Quarto markdown bells and
whistles (like call-outs, cross-references, auto-citations and much
more).
Each page should start with
\begin{verbatim}
---
title: your title
---
\end{verbatim}
and the first header will be the 2nd level, so \texttt{\#\#}. Note,
there are situations where you leave off
\begin{verbatim}
---
title: your title
---
\end{verbatim}
and start the qmd file with a level header \texttt{\#}, but if using the
default title yaml (in the \texttt{-\/-\/-} fence) is a good habit since
it makes it easy for Quarto convert your qmd file to other formats (like
into a presentation).
\hypertarget{add-your-pages-the-project}{%
\section{Add your pages the project}\label{add-your-pages-the-project}}
\begin{itemize}
\tightlist
\item
Add the files to \texttt{\_quarto.yml}
\end{itemize}
\bookmarksetup{startatroot}
\hypertarget{customization}{%
\chapter{Customization}\label{customization}}
Quarto allow many bells and whistles to make nice output. Read the
documentation here \href{https://quarto.org/docs/guide/}{Quarto
documentation}.
\hypertarget{examples}{%
\section{Examples}\label{examples}}
Looking at other people's Quarto code is a great way to figure out how
to do stuff. Most will have a link to a GitHub repo where you can see
the raw code. Look for a link to edit page or see source code. This will
usually be on the right. Or look for the GitHub icon somewhere.
\begin{itemize}
\tightlist
\item
\href{https://quarto.org/docs/gallery/}{Quarto gallery}
\item
\href{https://nmfs-openscapes.github.io/}{nmfs-openscapes}
\item
\href{https://thefaylab.github.io/lab-manual/}{Faye lab manual}
\item
\href{https://nmfs-opensci.github.io/quarto_titlepages/}{quarto-titlepages}
Note the link to edit is broken. Go to repo and look in
\texttt{documentation} directory.
\end{itemize}
\bookmarksetup{startatroot}
\hypertarget{rendering}{%
\chapter{Rendering}\label{rendering}}
The repo includes a GitHub Action that will render (build) the website
automatically when you make changes to the files. It will be pushed to
the \texttt{gh-pages} branch.
But when you are developing your content, you will want to render it
locally.
Have you updated RStudio since about August 2022? No? Then update to a
newer version of RStudio. In general, you want to keep RStudio updated
and it is required to have a recent version to use Quarto.
\hypertarget{step-2.-clone-and-create-rstudio-project}{%
\section{Step 2. Clone and create RStudio
project}\label{step-2.-clone-and-create-rstudio-project}}
First, clone the repo onto your local computer. How? You can click File
\textgreater{} New Project and then select ``Version Control''. Paste in
the url of the repository. That will clone the repo on to your local
computer. When you make changes, you will need to push those up.
\hypertarget{step-3.-render-within-rstudio}{%
\section{Step 3. Render within
RStudio}\label{step-3.-render-within-rstudio}}
RStudio will recognize that this is a Quarto project by the presence of
the \texttt{\_quarto.yml} file and will see the ``Build'' tab. Click the
``Render website'' button to render to the \texttt{\_site} folder.
\textbf{Previewing:} You can either click \texttt{index.html} in the
\texttt{\_site} folder and specify ``preview in browser'' or set up
RStudio to preview to the viewer panel. To do the latter, go to Tools
\textgreater{} Global Options \textgreater{} R Markdown. Then select
``Show output preview in: Viewer panel''.
\bookmarksetup{startatroot}
\hypertarget{r-markdown}{%
\chapter{R Markdown}\label{r-markdown}}
You can include R Markdown files in your project.
This is an R Markdown document. Markdown is a simple formatting syntax
for authoring HTML, PDF, and MS Word documents. For more details on
using R Markdown see \url{http://rmarkdown.rstudio.com}.
When you click the \textbf{Knit} button a document will be generated
that includes both content as well as the output of any embedded R code
chunks within the document. You can embed an R code chunk like this:
\begin{Shaded}
\begin{Highlighting}[]
\FunctionTok{summary}\NormalTok{(cars)}
\end{Highlighting}
\end{Shaded}
\begin{verbatim}
speed dist
Min. : 4.0 Min. : 2.00
1st Qu.:12.0 1st Qu.: 26.00
Median :15.0 Median : 36.00
Mean :15.4 Mean : 42.98
3rd Qu.:19.0 3rd Qu.: 56.00
Max. :25.0 Max. :120.00
\end{verbatim}
\hypertarget{including-plots}{%
\section{Including Plots}\label{including-plots}}
You can also embed plots, for example:
\includegraphics{content/rmarkdown_files/figure-pdf/pressure-1.pdf}
Note that the \texttt{echo\ =\ FALSE} parameter was added to the code
chunk to prevent printing of the R code that generated the plot.
\bookmarksetup{startatroot}
\hypertarget{rendering-with-code}{%
\chapter{Rendering with Code}\label{rendering-with-code}}
You can have code (R, Python or Julia) in your qmd file. You will need
to have these installed on your local computer, but presumably you do
already if you are adding code to your qmd files.
\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{x }\OtherTok{\textless{}{-}} \FunctionTok{c}\NormalTok{(}\DecValTok{5}\NormalTok{, }\DecValTok{15}\NormalTok{, }\DecValTok{25}\NormalTok{, }\DecValTok{35}\NormalTok{, }\DecValTok{45}\NormalTok{, }\DecValTok{55}\NormalTok{)}
\NormalTok{y }\OtherTok{\textless{}{-}} \FunctionTok{c}\NormalTok{(}\DecValTok{5}\NormalTok{, }\DecValTok{20}\NormalTok{, }\DecValTok{14}\NormalTok{, }\DecValTok{32}\NormalTok{, }\DecValTok{22}\NormalTok{, }\DecValTok{38}\NormalTok{)}
\FunctionTok{lm}\NormalTok{(x }\SpecialCharTok{\textasciitilde{}}\NormalTok{ y)}
\end{Highlighting}
\end{Shaded}
\begin{verbatim}
Call:
lm(formula = x ~ y)
Coefficients:
(Intercept) y
1.056 1.326
\end{verbatim}
You will need to change the GitHub Action in \texttt{.github/workflows}
to install these and any needed packages in order for GitHub to be able
to render your webpage. The GitHub Action install R since I used that in
\texttt{code.qmd}. If you use Python or Julia instead, then you will
need to update the GitHub Action to install those.
If getting the GitHub Action to work is too much hassle (and that
definitely happens), you can alway render locally and publish to the
\texttt{gh-pages} branch. If you do this, make sure to delete or rename
the GitHub Action to something like
\begin{verbatim}
render-and-publish.old_yml
\end{verbatim}
so GitHub does not keep trying to run it. Nothing bad will happen if you
don't do this, but if you are not using the action (because it keeps
failing), then you don't need GitHub to run it.
\hypertarget{render-locally-and-publish-to-gh-pages-branch}{%
\section{Render locally and publish to gh-pages
branch}\label{render-locally-and-publish-to-gh-pages-branch}}
To render locally and push up to the \texttt{gh-pages} branch, open a
terminal window and then \texttt{cd} to the directory with the Quarto
project. Type this in the terminal:
\begin{verbatim}
quarto render gh-pages
\end{verbatim}
\bookmarksetup{startatroot}
\hypertarget{references}{%
\chapter{References}\label{references}}
Quarto has powerful references functionality. You can easily insert
citations from Zotero libraries that you maintain in the cloud (on
Zotero). This allows the whole team to update the library and you can
sync up to that library. Read about this on the Quarto documentation on
\href{https://quarto.org/docs/visual-editor/technical.html\#citations}{citations}.
Google youtube videos on this also to see it in action.
Add a \texttt{.bib} file in to your project or add a linked Zotero
library via RStudio in Visual mode with Tools \textgreater{} Project
Options\ldots{} \textgreater{} R Markdown \textgreater{} select custom
libraries from the Zotero dropdown.
The you can type \texttt{@} and you will see a dropdown of the
references in your libraries. You can then select the ones to add. If
you don't see the one you need, you can paste in the DOI and it will be
added to your references file (with all the info). The references will
be added to your references section of your book automatically.
See the \texttt{references.qmd} file for how to include the references.
\begin{itemize}
\item
\texttt{@ansley1981} will produce Ansley and Davis (1981)
\item
\texttt{{[}@ansley1981{]}} will produce (Ansley and Davis 1981).
\end{itemize}
\bookmarksetup{startatroot}
\hypertarget{references-1}{%
\chapter*{References}\label{references-1}}
\addcontentsline{toc}{chapter}{References}
\markboth{References}{References}
\hypertarget{refs}{}
\begin{CSLReferences}{1}{0}
\leavevmode\vadjust pre{\hypertarget{ref-ansley1981}{}}%
Ansley, H. L. H., and C. D. Davis. 1981. {``Migration and Standing Stock
of Fishes Associated with Artificial and Natural Reefs on Georgia{'}s
Outer Continental Shelf.''} Brunswick, Georgia, USA.
\end{CSLReferences}
\backmatter
\end{document}