diff --git a/.github/workflows/R-CMD-full.yaml b/.github/workflows/R-CMD-full.yaml index a6af88a..e899c37 100644 --- a/.github/workflows/R-CMD-full.yaml +++ b/.github/workflows/R-CMD-full.yaml @@ -60,18 +60,15 @@ jobs: - name: Install system dependencies if: runner.os == 'Linux' - env: - RHUB_PLATFORM: linux-x86_64-ubuntu-gcc run: | - Rscript -e "remotes::install_github('r-hub/sysreqs')" - sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))") - sudo -s eval "$sysreqs" - + sudo apt-get update + sudo apt-get install libcurl4-openssl-dev + - uses: r-lib/actions/setup-r-dependencies@v2 - + - name: Install dependencies run: | - remotes::install_cran("rcmdcheck") + install.packages("rcmdcheck") install.packages('svn', repos = 'https://ctu-bern.r-universe.dev') install.packages('testthat') shell: Rscript {0} diff --git a/DESCRIPTION b/DESCRIPTION index 0b4ad3d..802c8de 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Package: CTUtemplate Title: Example RStudio Project Templates Author: Alan G. Haynes Maintainer: Alan G. Haynes -Version: 0.5.1 +Version: 0.6.0 Description: Templates and functions for use in CTU Bern. Depends: R (>= 3.3.2) diff --git a/NEWS.md b/NEWS.md index b468016..e13758c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +CTUtemplate 0.6.0 +--------------------- +update templates to use DCR-like branding + CTUtemplate 0.5.1 --------------------- correct use_qmd_htmlrecruitment (it had previously downloaded the sample size report template) @@ -104,4 +108,3 @@ CTUtemplate 0.0.4 --------------------- Addition of OneStageSS for sample size for an exact binomial test Addition of redcap code for stata - diff --git a/R/report_pdf.R b/R/report_pdf.R index 47de850..2cefbff 100644 --- a/R/report_pdf.R +++ b/R/report_pdf.R @@ -13,11 +13,13 @@ report_pdf <- function(report_template = find_resource("report", "report.tex"), if(report_template == "default") report_template <- find_resource("report", "report.tex") - # copy cls and logo to new dir + # copy cls and logos to new dir file.copy(find_resource("report", "ubreport.cls"), file.path(getwd(), "ubreport.cls")) file.copy(find_resource("report", "ub_16pt-cmyk.pdf"), file.path(getwd(), "ub_16pt-cmyk.pdf")) + file.copy(find_resource("report", "dcr_cmyk.pdf"), + file.path(getwd(), "dcr_cmyk.pdf")) base <- bookdown::pdf_document2(template = report_template, @@ -66,6 +68,8 @@ report_pdf2 <- function(report_template = find_resource("report", "report.tex"), file.path(getwd(), "ubreport.cls")) file.copy(find_resource("report", "ub_16pt-cmyk.pdf"), file.path(getwd(), "ub_16pt-cmyk.pdf")) + file.copy(find_resource("report", "dcr_cmyk.pdf"), + file.path(getwd(), "dcr_cmyk.pdf")) base <- bookdown::pdf_document2(template = report_template, diff --git a/README.md b/README.md index d5df303..6751763 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ # `CTUtemplate` -[![](https://img.shields.io/badge/dev%20version-0.5.1-blue.svg)](https://github.com/CTU-Bern/CTUtemplate) +[![](https://img.shields.io/badge/dev%20version-0.6.0-blue.svg)](https://github.com/CTU-Bern/CTUtemplate) `CTUtemplate` is a package to create a template directory structure (and files) and also includes the CTUs annual safety report function. diff --git a/inst/rmarkdown/templates/report/resources/dcr_bw.pdf b/inst/rmarkdown/templates/report/resources/dcr_bw.pdf new file mode 100644 index 0000000..5dd507a Binary files /dev/null and b/inst/rmarkdown/templates/report/resources/dcr_bw.pdf differ diff --git a/inst/rmarkdown/templates/report/resources/dcr_cmyk.pdf b/inst/rmarkdown/templates/report/resources/dcr_cmyk.pdf new file mode 100644 index 0000000..9db6f19 Binary files /dev/null and b/inst/rmarkdown/templates/report/resources/dcr_cmyk.pdf differ diff --git a/inst/rmarkdown/templates/report/resources/ubreport.clo b/inst/rmarkdown/templates/report/resources/ubreport.clo index 114026f..b2bd0e5 100644 --- a/inst/rmarkdown/templates/report/resources/ubreport.clo +++ b/inst/rmarkdown/templates/report/resources/ubreport.clo @@ -7,7 +7,7 @@ %%%%%%%%%%%%%%%% %Project %%%%%%%%%%%%% - + \newcommand{\project}{ \def\projectnumber{xxx} \def\projectname{Project name} @@ -21,14 +21,14 @@ %Author %%%%%%%%%%%%%%%%%% -\newcommand{\personalreport}{ +\newcommand{\personalreport}{ \def\sign{Dr. Lukas B{\"u}tikofer} - \def\mystreet{Mittelstrasse 43} - \def\telnum{+41 31 631 35 10} - \def\faxnum{} - \def\email{lukas.buetikofer@ctu.unibe.ch} - \def\web{www.ctu.unibe.ch} - \def\job{Senior statistician} + \def\mystreet{Mittelstrasse 43} + \def\telnum{+41 31 631 35 10} + \def\faxnum{} + \def\email{lukas.buetikofer@unibe.ch} + \def\web{www.dcr.unibe.ch} + \def\job{Senior statistician} } @@ -38,16 +38,16 @@ \newcommand{\reportenglish}{ \selectlanguage{USenglish} - \def\uni{University of Bern} - \def\faculty{Faculty of Medicine} - \def\dept{} - \def\institute{CTU Bern} - \def\addressline{CTU Bern, Mittelstrasse 43, CH-3012 Bern} - \def\zip{CH-3012} - \def\location{Bern} - \def\phone{Phone~} - \def\fax{Fax~} + \def\uni{University of Bern} + \def\faculty{Faculty of Medicine} + \def\dept{Department of Clinical Research} + \def\institute{} + \def\addressline{DCR, Mittelstrasse 43, CH-3012 Bern} + \def\zip{CH-3012} + \def\location{Bern} + \def\phone{Phone~} + \def\fax{Fax~} \def\subjectname{\textsl{}} } - - + + diff --git a/inst/rmarkdown/templates/report/resources/ubreport.cls b/inst/rmarkdown/templates/report/resources/ubreport.cls index f6d4d5e..b3fea85 100644 --- a/inst/rmarkdown/templates/report/resources/ubreport.cls +++ b/inst/rmarkdown/templates/report/resources/ubreport.cls @@ -139,42 +139,76 @@ \projectname: \reporttype \\ } } + %footer on title page \begin{picture}(-2,0) \put(0,-200){ - %\hspace{-3mm} - \parbox[t][24mm][t]{\fullwidthopen}{% - \raggedleft - \parbox[t][24mm][t]{\rightfield}{% - \fontfamily{phv}\fontsize{7.7}{9.43}\selectfont - \sign\\ - \ifx\job\@empty \else \job\\ \fi - \institute\\ - \mystreet\\ - \zip\ \location\\ - \ifx\telnum\@empty \else \telnum\\ \fi - \ifx\email\@empty \else \email\\ \fi - \ifx\web\@empty \else \web \fi + %\hspace{-3mm} + \parbox[t][24mm][t]{\fullwidthopen}{% + \raggedleft + \parbox[t][24mm][t]{\rightfield}{% + \fontfamily{phv}\fontsize{7.7}{9.43}\selectfont + \sign\\ + \ifx\job\@empty \else \job\\ \fi + \dept\\ + \mystreet\\ + \zip\ \location\\ + \ifx\telnum\@empty \else \telnum\\ \fi + \ifx\email\@empty \else \email\\ \fi + \ifx\web\@empty \else \web \fi + } + } + } + %unibe in footer + \put(-2,-240){ + \parbox[b][44mm][t]{\fullwidthopen}{% + \ifthenelse{\boolean{@color}} + {\includegraphics[width=35mm]{ub_16pt-cmyk.pdf}} + {\includegraphics[width=35mm]{ub_16pt-bl.pdf}} } } - } \end{picture} + %logo + %only DCR in header \hspace{123mm} \parbox[b][44mm][t]{\fullwidthopen}{% - \parbox[t][39mm][t]{\rightfield}{% + \parbox[t][20mm][t]{\rightfield}{% \ifthenelse{\boolean{@color}} - {\includegraphics[width=45mm]{ub_16pt-cmyk.pdf}} - {\includegraphics[width=45mm]{ub_16pt-bl.pdf}} + {\includegraphics[width=50mm]{dcr_cmyk.pdf}} + {\includegraphics[width=50mm]{dcr_bw.pdf}} } \par - \fontfamily{phv}\fontsize{8.0}{10.0}\selectfont - \faculty\par\vspace{+6pt} - \ifx\dept\@empty \else \dept\par\vspace{+5pt} \fi - \raggedright\bfseries\institute\par + \fontfamily{phv}\fontsize{8.0}{11.0}\selectfont + \textbf{\faculty}\par\vspace{+1pt} + \ifx\dept\@empty \else \dept\par\vspace{+1pt} \fi + %\raggedright\bfseries\institute\par } + + + + %DCR and unibe in header + %\parbox[b][44mm][t]{\fullwidthopen}{% + % \parbox{0.3\fullwidthopen}{% + % \hspace{0.3\fullwidthopen} + % } + % \parbox{0.4\fullwidthopen}{% + % \centering + % \ifthenelse{\boolean{@color}} + % {\includegraphics[width=45mm]{logo/dcr_cmyk.pdf}} + % {\includegraphics[width=45mm]{logo/dcr_bw.pdf}} + % + % } + % \parbox{0.3\fullwidthopen}{% + % \raggedleft + % \ifthenelse{\boolean{@color}} + % {\includegraphics[width=40mm]{logo/ub_16pt-cmyk.pdf}} + % {\includegraphics[width=40mm]{logo/ub_16pt-bl.pdf}} + % } + %} } + \def\mainfoot{} @@ -189,13 +223,48 @@ \projectname: \reporttype \\ } } + + %only DCR + \hspace{10mm} \parbox[b][32mm][t]{\fullwidthcont}{ \raggedleft{% \ifthenelse{\boolean{@color}} - {\includegraphics[width=27.4mm]{ub_16pt-cmyk.pdf}} - {\includegraphics[width=27.4mm]{ub_16pt-bl.pdf}} + {\includegraphics[width=45mm]{dcr_cmyk.pdf}} + {\includegraphics[width=45mm]{dcr_bw.pdf}} } } + + %DCR and unibe + %\parbox[b][32mm][t]{\fullwidthopen}{ + % \parbox{0.3\fullwidthopen}{% + % \hspace{0.3\fullwidthopen} + % } + % \parbox{0.4\fullwidthopen}{% + % \centering + % \ifthenelse{\boolean{@color}} + % {\includegraphics[width=34.25mm]{logo/dcr_cmyk.pdf}} + % {\includegraphics[width=34.25mm]{logo/dcr_bw.pdf}} + % + % } + % \parbox{0.3\fullwidthopen}{% + % \raggedleft + % \ifthenelse{\boolean{@color}} + % {\includegraphics[width=27.4mm]{logo/ub_16pt-cmyk.pdf}} + % {\includegraphics[width=27.4mm]{logo/ub_16pt-bl.pdf}} + % } + %} + + %footer + \begin{picture}(-2,0) + %unibe in footer + \put(-490,-745){ + \parbox[b][44mm][t]{\fullwidthopen}{% + \ifthenelse{\boolean{@color}} + {\includegraphics[width=25mm]{ub_16pt-cmyk.pdf}} + {\includegraphics[width=25mm]{ub_16pt-bl.pdf}} + } + } + \end{picture} } %right aligned page number diff --git a/inst/templates/ubreport.clo b/inst/templates/ubreport.clo index fe08698..ff0a611 100644 --- a/inst/templates/ubreport.clo +++ b/inst/templates/ubreport.clo @@ -27,7 +27,7 @@ \def\telnum{+41 31 631 35 10} \def\faxnum{} \def\email{{{email}}} - \def\web{www.ctu.unibe.ch} + \def\web{www.dcr.unibe.ch} \def\job{{{job}}} } @@ -40,9 +40,9 @@ \selectlanguage{USenglish} \def\uni{University of Bern} \def\faculty{Faculty of Medicine} - \def\dept{} - \def\institute{CTU Bern} - \def\addressline{CTU Bern, Mittelstrasse 43, CH-3012 Bern} + \def\dept{Department of Clinical Research} + \def\institute{} + \def\addressline{DCR, Mittelstrasse 43, CH-3012 Bern} \def\zip{CH-3012} \def\location{Bern} \def\phone{Phone~}