From a45b39d7995e4c0b57272d4fc286eb54e02b9c70 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sun, 9 Jun 2024 12:18:06 +0100 Subject: Unified configuration for book and notes --- ChangeLog.md | 1 + _book.yml | 4 ++ _bookup.yml | 18 ----- _common.yml | 13 ++++ _notes.yml | 3 + _output.yml | 6 +- bin/compile-book | 10 +-- bin/compile-notes | 16 +++++ content/notes/00-intro/notes.md | 29 -------- content/sections/15-installation/installation.md | 3 +- structure/00-header.tex | 84 ------------------------ structure/00-header.yml | 45 ------------- structure/00-preamble.md | 53 --------------- structure/00-preamble.tex | 59 ----------------- structure/99-biblio.md | 9 --- structure/99-end.tex | 35 ---------- structure/book/00-header.tex | 84 ++++++++++++++++++++++++ structure/book/00-header.yml | 45 +++++++++++++ structure/book/00-preamble.md | 53 +++++++++++++++ structure/book/00-preamble.tex | 59 +++++++++++++++++ structure/book/99-biblio.md | 9 +++ structure/book/99-end.tex | 35 ++++++++++ structure/notes/00-header.yml | 20 ++++++ 23 files changed, 353 insertions(+), 340 deletions(-) create mode 100644 _book.yml delete mode 100644 _bookup.yml create mode 100644 _common.yml create mode 100644 _notes.yml delete mode 100644 structure/00-header.tex delete mode 100644 structure/00-header.yml delete mode 100644 structure/00-preamble.md delete mode 100644 structure/00-preamble.tex delete mode 100644 structure/99-biblio.md delete mode 100644 structure/99-end.tex create mode 100644 structure/book/00-header.tex create mode 100644 structure/book/00-header.yml create mode 100644 structure/book/00-preamble.md create mode 100644 structure/book/00-preamble.tex create mode 100644 structure/book/99-biblio.md create mode 100644 structure/book/99-end.tex create mode 100644 structure/notes/00-header.yml diff --git a/ChangeLog.md b/ChangeLog.md index 0fac6dd..d58eb28 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -5,6 +5,7 @@ ### Features * [x] Improved compilation procedures. +* [x] Unified configuration for book and notes. ## v0.0.4 - 2024-06-08 diff --git a/_book.yml b/_book.yml new file mode 100644 index 0000000..db1cf27 --- /dev/null +++ b/_book.yml @@ -0,0 +1,4 @@ +--- +# Title and subtitle +title : "Bookup" +subtittle : "Bookdown-based publishing template" diff --git a/_bookup.yml b/_bookup.yml deleted file mode 100644 index 1a2dd00..0000000 --- a/_bookup.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -# Title and subtitle -title : "Bookup" -subtittle : "Bookdown-based publishing template" - -# Authorship information -author: "Silvio Rhatto" -date : "`r Sys.Date()`" - -# Publisher -publisher: "Fluxo" - -# Language -lang: "pt-br" - -# Bibliography -biblio-style: apalike -link-citations: true diff --git a/_common.yml b/_common.yml new file mode 100644 index 0000000..515d412 --- /dev/null +++ b/_common.yml @@ -0,0 +1,13 @@ +# Authorship information +author: "Silvio Rhatto" +date : "`r Sys.Date()`" + +# Publisher +publisher: "Bookup" + +# Language +lang: "pt-br" + +# Bibliography +biblio-style: apalike +link-citations: true diff --git a/_notes.yml b/_notes.yml new file mode 100644 index 0000000..ff9589d --- /dev/null +++ b/_notes.yml @@ -0,0 +1,3 @@ +--- +# Title and subtitle +title: "Bookup Notebook" diff --git a/_output.yml b/_output.yml index ca39efa..62874f8 100644 --- a/_output.yml +++ b/_output.yml @@ -76,9 +76,9 @@ bookdown::tufte_book2: template: vendor/bookup/templates/tufte-handout.tex includes: - in_header: vendor/bookup/structure/00-header.tex - before_body: vendor/bookup/structure/00-preamble.tex - after_body: vendor/bookup/structure/99-end.tex + in_header: vendor/bookup/structure/book/00-header.tex + before_body: vendor/bookup/structure/book/00-preamble.tex + after_body: vendor/bookup/structure/book/99-end.tex toc: true toc_depth: 3 #toc_appendix: true diff --git a/bin/compile-book b/bin/compile-book index 75c417b..f452d4b 100755 --- a/bin/compile-book +++ b/bin/compile-book @@ -7,6 +7,7 @@ BASENAME="`basename $0 | sed -e 's/\(.\)/\U\1/'`" DIRNAME="`dirname $0`" BASEDIR="$DIRNAME/.." +STRUCTURE="structure/book" OUTPUT="${1:-book}" REVISION="$2" DATE="$3" @@ -15,7 +16,8 @@ DATE="$3" rm -f $OUTPUT.md $OUTPUT.Rmd # Bookup config -cat _bookup.yml >> $OUTPUT.md ; echo "" >> $OUTPUT.md +cat _book.yml >> $OUTPUT.md ; echo "" >> $OUTPUT.md +cat _common.yml >> $OUTPUT.md ; echo "" >> $OUTPUT.md # Bibliography find -name _biblio.yml | while read file; do @@ -23,13 +25,13 @@ find -name _biblio.yml | while read file; do done # YAML headers -for file in $BASEDIR/structure/00*.yml; do +for file in $BASEDIR/$STRUCTURE/00*.yml; do cat $file >> $OUTPUT.md echo "---" >> $OUTPUT.md done # Markdown headers -for file in $BASEDIR/structure/00*.md; do +for file in $BASEDIR/$STRUCTURE/00*.md; do cat $file >> $OUTPUT.md echo "" >> $OUTPUT.md done @@ -43,7 +45,7 @@ find content/sections -type f | grep '\.md$' | sort | while read file; do done # Footers -for file in $BASEDIR/structure/99*.md; do +for file in $BASEDIR/$STRUCTURE/99*.md; do cat $file >> $OUTPUT.md echo "" >> $OUTPUT.md done diff --git a/bin/compile-notes b/bin/compile-notes index 1e55dcc..efeca68 100755 --- a/bin/compile-notes +++ b/bin/compile-notes @@ -7,6 +7,7 @@ BASENAME="`basename $0 | sed -e 's/\(.\)/\U\1/'`" DIRNAME="`dirname $0`" BASEDIR="$DIRNAME/.." +STRUCTURE="structure/notes" OUTPUT="${1:-notes}" REVISION="$2" DATE="$3" @@ -14,6 +15,21 @@ DATE="$3" # Remove any dangling output files rm -f $OUTPUT.md +# Notes config +cat _notes.yml >> $OUTPUT.md ; echo "" >> $OUTPUT.md +cat _common.yml >> $OUTPUT.md ; echo "" >> $OUTPUT.md + +# Bibliography +find -name _biblio.yml | while read file; do + cat $file >> $OUTPUT.md ; echo "" >> $OUTPUT.md +done + +# YAML headers +for file in $BASEDIR/$STRUCTURE/00*.yml; do + cat $file >> $OUTPUT.md + echo "---" >> $OUTPUT.md +done + # Content find content/notes -type f | grep '\.md$' | sort | while read file; do cat $file >> $OUTPUT.md diff --git a/content/notes/00-intro/notes.md b/content/notes/00-intro/notes.md index af00773..79d3f49 100644 --- a/content/notes/00-intro/notes.md +++ b/content/notes/00-intro/notes.md @@ -1,32 +1,3 @@ ---- -title : "Bookup Notebook" -author : "Silvio Rhatto" -date : "`r Sys.Date()`" -lang : "pt-br" -site : "bookdown::bookdown_site" -publisher: "Bookup" -output: - bookdown::gitbook: - config: - toc: - collapse: section - toolbar: - # Default search indexing is very slow: there's lots of notes to be indexed at each page load - # Because of that, it may be better to disable search by default - #search: no - # Fuse search engine is faster - search: - engine: fuse - sharing: no - fontsettings: - theme: night - family: sans - size: 2 - #split_by: chapter+number - #split_by: section - ---- - # Caderno de anotações {#index} Exemplo de caderno de anotações. diff --git a/content/sections/15-installation/installation.md b/content/sections/15-installation/installation.md index 9024b41..3da6a66 100644 --- a/content/sections/15-installation/installation.md +++ b/content/sections/15-installation/installation.md @@ -15,7 +15,8 @@ Procedimento de instalação do Bookup. * `.gitignore`. * `images/cover.png`. -* `_bookup.yml`. +* `_book.yml`. +* `_notes.yml`. * `_biblio.yml`. * `LICENSE`. * `DISCLAIMER`. diff --git a/structure/00-header.tex b/structure/00-header.tex deleted file mode 100644 index ded10bd..0000000 --- a/structure/00-header.tex +++ /dev/null @@ -1,84 +0,0 @@ -% Bookdown LaTeX header file - -% Inclusion of external PDF documents (such as a cover image) -% See https://www.ctan.org/pkg/pdfpages -\usepackage{pdfpages} - -% To properly handle URLs in bibliographies -% See https://tex.stackexchange.com/questions/484176/biblatex-overflowing-url -\usepackage{xurl} - -% PDF bookmarks -% See https://ctan.org/pkg/bookmark -% https://texdoc.org/serve/bookmark.pdf/0 -\usepackage[depth=2]{bookmark} - -% Indexing -% See https://en.wikibooks.org/wiki/LaTeX/Indexing -% https://www.ctan.org/pkg/makeidx -% https://bookdown.org/yihui/bookdown/latex-index.html -%\usepackage{imakeidx} -\usepackage{makeidx} -\makeindex - -% No matter what is said in the docs, this was required -% But maybe because tufte::tufte_book was being used instead of bookdown::tufte_book2 -% So perhaps this is not needed anymore -% See https://bookdown.org/yihui/bookdown/markdown-extensions-by-bookdown.html#theorems -% https://ctan.math.illinois.edu/macros/latex/contrib/thmtools/doc/thmtools-manual.pdf -\usepackage{amsthm,thmtools} - -% Bookdown docs recommends to not mess with this -% See https://bookdown.org/yihui/bookdown/markdown-extensions-by-bookdown.html#theorems -%\newtheorem{definition}{Definição}[chapter] -%\newtheorem{hiphotesis}{Hipótese}[chapter] -%\newtheorem{conjecture}{Conjectura}[chapter] -%\newtheorem{demonstration}{Demonstração}[chapter] -%\newtheorem{etimology}{Etimologia}[chapter] - -% Fix positions of margin notes -% See https://ctan.org/pkg/marginfix -% https://tex.stackexchange.com/questions/119726/horizontal-margins-for-margin-notes-in-the-tufte-classes -% https://tex.stackexchange.com/questions/624033/long-sidenotes-break-marginfix-or-how-to-make-breakable-sidenotes -\usepackage{marginfix} - -% Workaround to theorems work correctly -% Maybe this is not needed anymore -% See https://stackoverflow.com/questions/46942352/r-bookdown-document-with-theorem-does-not-render-when-output-file-is-specified -\let\BeginKnitrBlock\begin \let\EndKnitrBlock\end - -% Set page size -% -% This command conflicts with something and gives an error -%\usepackage[paperwidth=6in, paperheight=9in]{geometry} -% -% This command needs tuning for the margins -%\newgeometry{paperwidth=6in, paperheight=9in} -% -% This also needs tuning -% See https://tex.stackexchange.com/questions/201893/change-paper-size-in-tufte-book-class#380699 -%\newgeometry{ -% % showframe, -% paperwidth=6in, -% paperheight=9in, -% left=0.55in, -% right=0.45in, -% top=.5in, -% bottom=.5in, -% marginparsep=0.25in, -% marginparwidth=0.65in, -% includemp, -% includehead, -% % The text width and height are calculated automatically. -%} -% -% This should work, but we're setting this at 00-header.md -%\newgeometry{b5paper} - -% Coverpage and copyright notice before title in R bookdown -% See https://stackoverflow.com/questions/45963505/coverpage-and-copyright-notice-before-title-in-r-bookdown -\let\oldmaketitle\maketitle -\AtBeginDocument{\let\maketitle\relax} - -% Custom header -\IfFileExists{snippets/header.tex}{\input{snippets/header.tex}}{} diff --git a/structure/00-header.yml b/structure/00-header.yml deleted file mode 100644 index 2ad19fe..0000000 --- a/structure/00-header.yml +++ /dev/null @@ -1,45 +0,0 @@ -# Bookdown YAML header -# See https://bookdown.org/yihui/bookdown/usage.html#usage -# https://bookdown.org/yihui/bookdown/yaml-options.html - -# Site -site: "bookdown::bookdown_site" - -# Automatically generate the list of tables and figures -# These can also be explicitly generated using LaTeX commands -lot: false -lof: false - -# Cover image -#cover-image: "images/cover.png" - -# Fonts -mainfont: "Linux Libertine O" -monofont: "Liberation Mono" - -# Paper size -#papersize: a4paper -#papersize: letterpaper -papersize: b5paper - -# Geometry -#geometry: paperwidth=6in,paperheight=9in - -# Class option -# Use "symmetric" in the classoption if you want margin notes in alternating sides -#classoption: "symmetric,justified" -#classoption: "twoside,symmetric,justified" -classoption: "justified" - -# Header includes -header-includes: - # Support for deeply nested lists - # See https://stackoverflow.com/questions/57945414/too-deeply-nested-at-just-fourth-nesting-level-using-pandoc-with-markdown - - \usepackage{enumitem} - - \setlistdepth{20} - - \renewlist{itemize}{itemize}{20} - - \renewlist{enumerate}{enumerate}{20} - - \setlist[itemize]{label=$\cdot$} - - \setlist[itemize,1]{label=\textbullet} - - \setlist[itemize,2]{label=--} - - \setlist[itemize,3]{label=*} diff --git a/structure/00-preamble.md b/structure/00-preamble.md deleted file mode 100644 index fea2bc0..0000000 --- a/structure/00-preamble.md +++ /dev/null @@ -1,53 +0,0 @@ - - - - - -```{r echo=FALSE, results='asis'} -if (knitr::is_html_output()) { - cat('# Início {#index .unnumbered}') - cat("\n") - cat('') - cat("\n") - cat("

Sobre

") - cat("\n") - cat('') - cat(readLines('DISCLAIMER'), sep='\n') - cat('') - cat('

') - cat('Livro Vivo - Versão ') - cat(readLines('.metadata/revision.txt'), sep='\n') - cat(' - compilada em ') - cat(readLines('.metadata/date.txt'), sep='\n') - cat('.') - cat('
') - cat('Versões anteriores disponíveis no arquivo.') - cat('

') - cat(readLines('snippets/project.txt')) - cat(' - ') - cat(readLines('snippets/volume.txt')) - cat('
') - cat('Publicado por ') - cat(rmarkdown::metadata$publisher) - cat('
') - cat('Publicado em ') - cat(readLines('snippets/url.txt'), sep='\n') - cat('

') - cat(readLines('snippets/keywords.txt'), sep='\n') - cat("\n") - cat("

Créditos

") - cat("\n") - cat(paste(rmarkdown::metadata$title, "
", "Copyleft ©", readLines('.metadata/year.txt'), rmarkdown::metadata$author, readLines('snippets/contact.txt'), sep=' ')) - cat('

') - cat(readLines('LICENSE'), sep='\n') - cat('

') - cat(readLines('snippets/cover.txt'), sep='\n') - cat("

Versão PDF

") - cat("\n") - cat('Baixe a versão PDF aqui, ou navegue abaixo:') - cat("\n") - cat('

') - cat('') - cat('

') -} -``` diff --git a/structure/00-preamble.tex b/structure/00-preamble.tex deleted file mode 100644 index d558cc1..0000000 --- a/structure/00-preamble.tex +++ /dev/null @@ -1,59 +0,0 @@ -% Bookdown LaTeX before-body file - -% Front matter -\frontmatter - -% Cover image -% See https://stackoverflow.com/questions/45963505/coverpage-and-copyright-notice-before-title-in-r-bookdown -% https://tex.stackexchange.com/questions/39147/scale-image-to-page-width -% https://stackoverflow.com/questions/1963923/adding-full-page-figures-in-latex-how -\includepdf{images/cover.png} - -% Do not print the default title set in the template -\let\maketitle\oldmaketitle -% Uncomment this to duplicate the book title -% This might also clear the \@title variable -%\maketitle - -% Metadata page -\newpage -\begin{fullwidth} -~\vfill -\thispagestyle{empty} -\setlength{\parindent}{0pt} -\setlength{\parskip}{\baselineskip} -\makeatletter\@title\makeatother - -Copyleft \copyright\ \input{.metadata/year.txt} \thanklessauthor\ \input{snippets/contact.txt} - -\input{LICENSE} - -\input{snippets/keywords.txt} - -\input{snippets/cover.txt} - -% Some \input statements need to be protected -% See https://texfaq.org/FAQ-extrabrace -% https://www.typeerror.org/docs/latex/_005cprotect -\par\smallcaps{\protect\input{snippets/project.txt} - \protect\input{snippets/volume.txt}} - -\par\smallcaps{Publicado por \thanklesspublisher} - -\par\smallcaps{\protect\input{snippets/url.txt}} - -%\par\textit{Primeira impressão, \input{.metadata/year.txt}} -\par Livro Vivo - Versão \textit{\textbf{\input{.metadata/revision.txt}}} compilada em \textit{\textbf{\input{.metadata/date.txt}}} -\end{fullwidth} - -% Disclaimer -\newpage -\begin{fullwidth} -~\vfill -\thispagestyle{empty} -\setlength{\parindent}{0pt} -\setlength{\parskip}{\baselineskip} -\textit{\input{DISCLAIMER}} -\end{fullwidth} - -% Start the main matter (normal chapters) -\mainmatter diff --git a/structure/99-biblio.md b/structure/99-biblio.md deleted file mode 100644 index c5385cb..0000000 --- a/structure/99-biblio.md +++ /dev/null @@ -1,9 +0,0 @@ -\backmatter - - - - - -# Bibliografia diff --git a/structure/99-end.tex b/structure/99-end.tex deleted file mode 100644 index 1959646..0000000 --- a/structure/99-end.tex +++ /dev/null @@ -1,35 +0,0 @@ -% Bookdown LaTeX footer file - -% Put all indexes in a final chapter -\chapter{Índice} - -%Listas de tabelas, figuras, definições e etimologias. -%Listas de tabelas e figuras. -Listas de tabelas, figuras etc. - -% Print the list of tables -\listoftables - -% Print the list of figures -\listoffigures - -% Print the list of definitions -% See https://latex.org/forum/viewtopic.php?t=17679 -% https://ctan.org/pkg/thmtools -\ifx\BookupListDefinitions\undefined -\else - \renewcommand\listtheoremname{Lista de Definições} - \listoftheorems[ignoreall,show={definition}] -\fi - -% Print the list of etimologies -% The "proposition" theorem type is allocated for etimologies in this book -% See the _bookdown.yml at the top-level project folder for more information -\ifx\BookupListEtimologies\undefined -\else - \renewcommand\listtheoremname{Lista de Etimologias} - \listoftheorems[ignoreall,show={proposition}] -\fi - -% Print the index -\printindex diff --git a/structure/book/00-header.tex b/structure/book/00-header.tex new file mode 100644 index 0000000..ded10bd --- /dev/null +++ b/structure/book/00-header.tex @@ -0,0 +1,84 @@ +% Bookdown LaTeX header file + +% Inclusion of external PDF documents (such as a cover image) +% See https://www.ctan.org/pkg/pdfpages +\usepackage{pdfpages} + +% To properly handle URLs in bibliographies +% See https://tex.stackexchange.com/questions/484176/biblatex-overflowing-url +\usepackage{xurl} + +% PDF bookmarks +% See https://ctan.org/pkg/bookmark +% https://texdoc.org/serve/bookmark.pdf/0 +\usepackage[depth=2]{bookmark} + +% Indexing +% See https://en.wikibooks.org/wiki/LaTeX/Indexing +% https://www.ctan.org/pkg/makeidx +% https://bookdown.org/yihui/bookdown/latex-index.html +%\usepackage{imakeidx} +\usepackage{makeidx} +\makeindex + +% No matter what is said in the docs, this was required +% But maybe because tufte::tufte_book was being used instead of bookdown::tufte_book2 +% So perhaps this is not needed anymore +% See https://bookdown.org/yihui/bookdown/markdown-extensions-by-bookdown.html#theorems +% https://ctan.math.illinois.edu/macros/latex/contrib/thmtools/doc/thmtools-manual.pdf +\usepackage{amsthm,thmtools} + +% Bookdown docs recommends to not mess with this +% See https://bookdown.org/yihui/bookdown/markdown-extensions-by-bookdown.html#theorems +%\newtheorem{definition}{Definição}[chapter] +%\newtheorem{hiphotesis}{Hipótese}[chapter] +%\newtheorem{conjecture}{Conjectura}[chapter] +%\newtheorem{demonstration}{Demonstração}[chapter] +%\newtheorem{etimology}{Etimologia}[chapter] + +% Fix positions of margin notes +% See https://ctan.org/pkg/marginfix +% https://tex.stackexchange.com/questions/119726/horizontal-margins-for-margin-notes-in-the-tufte-classes +% https://tex.stackexchange.com/questions/624033/long-sidenotes-break-marginfix-or-how-to-make-breakable-sidenotes +\usepackage{marginfix} + +% Workaround to theorems work correctly +% Maybe this is not needed anymore +% See https://stackoverflow.com/questions/46942352/r-bookdown-document-with-theorem-does-not-render-when-output-file-is-specified +\let\BeginKnitrBlock\begin \let\EndKnitrBlock\end + +% Set page size +% +% This command conflicts with something and gives an error +%\usepackage[paperwidth=6in, paperheight=9in]{geometry} +% +% This command needs tuning for the margins +%\newgeometry{paperwidth=6in, paperheight=9in} +% +% This also needs tuning +% See https://tex.stackexchange.com/questions/201893/change-paper-size-in-tufte-book-class#380699 +%\newgeometry{ +% % showframe, +% paperwidth=6in, +% paperheight=9in, +% left=0.55in, +% right=0.45in, +% top=.5in, +% bottom=.5in, +% marginparsep=0.25in, +% marginparwidth=0.65in, +% includemp, +% includehead, +% % The text width and height are calculated automatically. +%} +% +% This should work, but we're setting this at 00-header.md +%\newgeometry{b5paper} + +% Coverpage and copyright notice before title in R bookdown +% See https://stackoverflow.com/questions/45963505/coverpage-and-copyright-notice-before-title-in-r-bookdown +\let\oldmaketitle\maketitle +\AtBeginDocument{\let\maketitle\relax} + +% Custom header +\IfFileExists{snippets/header.tex}{\input{snippets/header.tex}}{} diff --git a/structure/book/00-header.yml b/structure/book/00-header.yml new file mode 100644 index 0000000..2ad19fe --- /dev/null +++ b/structure/book/00-header.yml @@ -0,0 +1,45 @@ +# Bookdown YAML header +# See https://bookdown.org/yihui/bookdown/usage.html#usage +# https://bookdown.org/yihui/bookdown/yaml-options.html + +# Site +site: "bookdown::bookdown_site" + +# Automatically generate the list of tables and figures +# These can also be explicitly generated using LaTeX commands +lot: false +lof: false + +# Cover image +#cover-image: "images/cover.png" + +# Fonts +mainfont: "Linux Libertine O" +monofont: "Liberation Mono" + +# Paper size +#papersize: a4paper +#papersize: letterpaper +papersize: b5paper + +# Geometry +#geometry: paperwidth=6in,paperheight=9in + +# Class option +# Use "symmetric" in the classoption if you want margin notes in alternating sides +#classoption: "symmetric,justified" +#classoption: "twoside,symmetric,justified" +classoption: "justified" + +# Header includes +header-includes: + # Support for deeply nested lists + # See https://stackoverflow.com/questions/57945414/too-deeply-nested-at-just-fourth-nesting-level-using-pandoc-with-markdown + - \usepackage{enumitem} + - \setlistdepth{20} + - \renewlist{itemize}{itemize}{20} + - \renewlist{enumerate}{enumerate}{20} + - \setlist[itemize]{label=$\cdot$} + - \setlist[itemize,1]{label=\textbullet} + - \setlist[itemize,2]{label=--} + - \setlist[itemize,3]{label=*} diff --git a/structure/book/00-preamble.md b/structure/book/00-preamble.md new file mode 100644 index 0000000..fea2bc0 --- /dev/null +++ b/structure/book/00-preamble.md @@ -0,0 +1,53 @@ + + + + + +```{r echo=FALSE, results='asis'} +if (knitr::is_html_output()) { + cat('# Início {#index .unnumbered}') + cat("\n") + cat('') + cat("\n") + cat("

Sobre

") + cat("\n") + cat('') + cat(readLines('DISCLAIMER'), sep='\n') + cat('') + cat('

') + cat('Livro Vivo - Versão ') + cat(readLines('.metadata/revision.txt'), sep='\n') + cat(' - compilada em ') + cat(readLines('.metadata/date.txt'), sep='\n') + cat('.') + cat('
') + cat('Versões anteriores disponíveis no arquivo.') + cat('

') + cat(readLines('snippets/project.txt')) + cat(' - ') + cat(readLines('snippets/volume.txt')) + cat('
') + cat('Publicado por ') + cat(rmarkdown::metadata$publisher) + cat('
') + cat('Publicado em ') + cat(readLines('snippets/url.txt'), sep='\n') + cat('

') + cat(readLines('snippets/keywords.txt'), sep='\n') + cat("\n") + cat("

Créditos

") + cat("\n") + cat(paste(rmarkdown::metadata$title, "
", "Copyleft ©", readLines('.metadata/year.txt'), rmarkdown::metadata$author, readLines('snippets/contact.txt'), sep=' ')) + cat('

') + cat(readLines('LICENSE'), sep='\n') + cat('

') + cat(readLines('snippets/cover.txt'), sep='\n') + cat("

Versão PDF

") + cat("\n") + cat('Baixe a versão PDF aqui, ou navegue abaixo:') + cat("\n") + cat('

') + cat('') + cat('

') +} +``` diff --git a/structure/book/00-preamble.tex b/structure/book/00-preamble.tex new file mode 100644 index 0000000..d558cc1 --- /dev/null +++ b/structure/book/00-preamble.tex @@ -0,0 +1,59 @@ +% Bookdown LaTeX before-body file + +% Front matter +\frontmatter + +% Cover image +% See https://stackoverflow.com/questions/45963505/coverpage-and-copyright-notice-before-title-in-r-bookdown +% https://tex.stackexchange.com/questions/39147/scale-image-to-page-width +% https://stackoverflow.com/questions/1963923/adding-full-page-figures-in-latex-how +\includepdf{images/cover.png} + +% Do not print the default title set in the template +\let\maketitle\oldmaketitle +% Uncomment this to duplicate the book title +% This might also clear the \@title variable +%\maketitle + +% Metadata page +\newpage +\begin{fullwidth} +~\vfill +\thispagestyle{empty} +\setlength{\parindent}{0pt} +\setlength{\parskip}{\baselineskip} +\makeatletter\@title\makeatother + +Copyleft \copyright\ \input{.metadata/year.txt} \thanklessauthor\ \input{snippets/contact.txt} + +\input{LICENSE} + +\input{snippets/keywords.txt} + +\input{snippets/cover.txt} + +% Some \input statements need to be protected +% See https://texfaq.org/FAQ-extrabrace +% https://www.typeerror.org/docs/latex/_005cprotect +\par\smallcaps{\protect\input{snippets/project.txt} - \protect\input{snippets/volume.txt}} + +\par\smallcaps{Publicado por \thanklesspublisher} + +\par\smallcaps{\protect\input{snippets/url.txt}} + +%\par\textit{Primeira impressão, \input{.metadata/year.txt}} +\par Livro Vivo - Versão \textit{\textbf{\input{.metadata/revision.txt}}} compilada em \textit{\textbf{\input{.metadata/date.txt}}} +\end{fullwidth} + +% Disclaimer +\newpage +\begin{fullwidth} +~\vfill +\thispagestyle{empty} +\setlength{\parindent}{0pt} +\setlength{\parskip}{\baselineskip} +\textit{\input{DISCLAIMER}} +\end{fullwidth} + +% Start the main matter (normal chapters) +\mainmatter diff --git a/structure/book/99-biblio.md b/structure/book/99-biblio.md new file mode 100644 index 0000000..c5385cb --- /dev/null +++ b/structure/book/99-biblio.md @@ -0,0 +1,9 @@ +\backmatter + + + + + +# Bibliografia diff --git a/structure/book/99-end.tex b/structure/book/99-end.tex new file mode 100644 index 0000000..1959646 --- /dev/null +++ b/structure/book/99-end.tex @@ -0,0 +1,35 @@ +% Bookdown LaTeX footer file + +% Put all indexes in a final chapter +\chapter{Índice} + +%Listas de tabelas, figuras, definições e etimologias. +%Listas de tabelas e figuras. +Listas de tabelas, figuras etc. + +% Print the list of tables +\listoftables + +% Print the list of figures +\listoffigures + +% Print the list of definitions +% See https://latex.org/forum/viewtopic.php?t=17679 +% https://ctan.org/pkg/thmtools +\ifx\BookupListDefinitions\undefined +\else + \renewcommand\listtheoremname{Lista de Definições} + \listoftheorems[ignoreall,show={definition}] +\fi + +% Print the list of etimologies +% The "proposition" theorem type is allocated for etimologies in this book +% See the _bookdown.yml at the top-level project folder for more information +\ifx\BookupListEtimologies\undefined +\else + \renewcommand\listtheoremname{Lista de Etimologias} + \listoftheorems[ignoreall,show={proposition}] +\fi + +% Print the index +\printindex diff --git a/structure/notes/00-header.yml b/structure/notes/00-header.yml new file mode 100644 index 0000000..1404cad --- /dev/null +++ b/structure/notes/00-header.yml @@ -0,0 +1,20 @@ +site : "bookdown::bookdown_site" +output: + bookdown::gitbook: + config: + toc: + collapse: section + toolbar: + # Default search indexing is very slow: there's lots of notes to be indexed at each page load + # Because of that, it may be better to disable search by default + #search: no + # Fuse search engine is faster + search: + engine: fuse + sharing: no + fontsettings: + theme: night + family: sans + size: 2 + #split_by: chapter+number + #split_by: section -- cgit v1.2.3