Skip to content

Commit

Permalink
Merge pull request #129 from elong0527/pdf-template
Browse files Browse the repository at this point in the history
Change PDF output template and fix preview images
  • Loading branch information
elong0527 authored Apr 7, 2024
2 parents 739d77b + e87346b commit 69f3a4d
Show file tree
Hide file tree
Showing 13 changed files with 4,024 additions and 18 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@

/.quarto/
/_book/
/site_libs/

r4csr.tex
index.adx
index.thm
28 changes: 18 additions & 10 deletions _quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ book:
- Keaven Anderson
- Yalin Zhu
description: |
This book will teach you how to prepare tables, listings, and figures for
Learn how to prepare tables, listings, and figures for
clinical study report and submit to regulatory agencies,
the essential part of clinical trial development.
cover-image: "images/cover.png"
image: "images/preview.png"
favicon: "images/favicon.png"
output-file: "r4csr"

cover-image: "assets/cover.png"
image: "assets/preview.jpg"
favicon: "assets/favicon.png"

site-url: https://r4csr.org/
repo-url: https://github.com/elong0527/r4csr
Expand All @@ -28,13 +30,13 @@ book:
reader-mode: true

open-graph:
image: https://r4csr.org/images/preview.jpg
image: assets/preview.jpg
description: |
Learn how to prepare tables, listings, and figures for
clinical study report and submit to regulatory agencies,
the essential part of clinical trial development.
twitter-card:
image: https://r4csr.org/images/preview.jpg
image: assets/preview.jpg
description: |
Learn how to prepare tables, listings, and figures for
clinical study report and submit to regulatory agencies,
Expand Down Expand Up @@ -77,9 +79,15 @@ format:
html:
theme: [cosmo, custom.scss]
mainfont: "Invention, system-ui, -apple-system, Segoe UI, Roboto, Helvetica Neue, Noto Sans, Liberation Sans, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji"
code-link: true
pdf:
documentclass: scrbook
# Fixes 'Undefined control sequence \cellcolor' error
documentclass: tex/svmono
include-in-header:
- text: |
\usepackage[table]{xcolor}
- "tex/preamble.tex"
include-before-body:
- "tex/before_body.tex"
include-after-body:
- "tex/after_body.tex"
cite-method: natbib
keep-tex: true
toc: true
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
11 changes: 3 additions & 8 deletions index.qmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
`r if (knitr::is_latex_output()) '<!--'`

# Welcome {.unnumbered}

Welcome to R for Clinical Study Reports and Submission.
Expand All @@ -16,6 +14,8 @@ clinical reporting toolkit.

**This is a work-in-progress draft.**

::: {.content-visible when-format="html"}

## Events {.unnumbered}

```{css, echo=FALSE}
Expand All @@ -34,9 +34,4 @@ knitr::kable(
)
```

## License {.unnumbered}

This book is licensed to you under the
[Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License](https://creativecommons.org/licenses/by-nc-nd/4.0/).

`r if (knitr::is_latex_output()) '-->'`
:::
10 changes: 10 additions & 0 deletions tex/after_body.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
\backmatter

\let\hyperlink=\oldhyperlink % Restore old hyperlink behaviour
\cleardoublepage
\markboth{Index}{Index}
\addcontentsline{toc}{chapter}{Index}
\printindex

\addcontentsline{toc}{chapter}{Code index}
\printindex[code]
30 changes: 30 additions & 0 deletions tex/before_body.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
\null\vfill
\begin{flushleft}
\thispagestyle{empty}
\textit{R for Clinical Study Reports and Submission}

© Placeholder Name, Inc.

ISBN-1234567891234

\noindent Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Nulla et elementum libero. In hac habitasse platea dictumst.
Vestibulum ante ipsum primis in faucibus orci luctus et ultrices
posuere cubilia Curae; Donec sed odio dui. Nullam quis risus eget
urna mollis ornare vel eu leo. Pellentesque habitant morbi tristique
senectus et netus et malesuada fames ac turpis egestas.
Curabitur blandit tempus porttitor.
Integer posuere erat a ante venenatis dapibus posuere velit aliquet.
\end{flushleft}

\frontmatter

% Dedication
\begin{center}
\thispagestyle{empty}
\vspace*{\fill}
\huge{\textit{Placeholder for dedication text}}
\vspace*{\fill}
\end{center}

\mainmatter
28 changes: 28 additions & 0 deletions tex/preamble.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
\usepackage{booktabs}

\usepackage{float}
\usepackage{index}
% index functions separately
\newindex{code}{adx}{and}{R code index}
\newcommand{\indexf}[1]{\index[code]{#1@\texttt{#1()}}}
\newcommand{\indexc}[1]{\index[code]{#1@\texttt{#1}}}

\DeclareGraphicsExtensions{.pdf,.png}

\usepackage{hyperref}
% Place links in parens
\renewcommand{\href}[2]{#2 (\url{#1})}
% Use auto ref for internal links
\let\oldhyperlink=\hyperlink
\renewcommand{\hyperlink}[2]{\autoref{#1}}
\def\chapterautorefname{Chapter}
\def\sectionautorefname{Section}
\def\subsectionautorefname{Section}
\def\subsubsectionautorefname{Section}

\setlength{\emergencystretch}{3em} % prevent overfull lines
\vbadness=10000 % suppress underfull \vbox
\hbadness=10000 % suppress underfull \vbox
\hfuzz=10pt

\makeindex
Loading

0 comments on commit 69f3a4d

Please sign in to comment.