Skip to content

Commit

Permalink
Merge pull request #79 from inbo/add-french-styles
Browse files Browse the repository at this point in the history
Add french styles
  • Loading branch information
ThierryO committed Oct 21, 2021
2 parents ed906fe + e7ff25e commit 1ec1bd4
Show file tree
Hide file tree
Showing 21 changed files with 709 additions and 34 deletions.
1 change: 0 additions & 1 deletion .gitignore
Expand Up @@ -3,7 +3,6 @@
.Rhistory
.Rproj.user
.Ruserdata
*.html
*.log
*.synctex.gz
*.toc
Expand Down
27 changes: 11 additions & 16 deletions DESCRIPTION
@@ -1,21 +1,16 @@
Type: Package
Package: INBOmd
Title: Markdown Templates for INBO
Version: 0.5.0
Authors@R:
c(person(given = "Thierry",
family = "Onkelinx",
role = c("aut", "cre"),
email = "thierry.onkelinx@inbo.be",
comment = c(ORCID = "0000-0001-8804-4216")),
person(given = "Floris",
family = "Vanderhaeghe",
role = "ctb",
email = "floris.vanderhaeghe@inbo.be",
comment = c(ORCID = "0000-0002-6378-6229")),
person(given = "Research Institute for Nature and Forest",
role = c("cph", "fnd"),
email = "info@inbo.be"))
Version: 0.5.1
Authors@R: c(
person("Thierry", "Onkelinx", , "thierry.onkelinx@inbo.be", role = c("aut", "cre"),
comment = c(ORCID = "0000-0001-8804-4216")),
person("Floris", "Vanderhaeghe", , "floris.vanderhaeghe@inbo.be", role = "ctb",
comment = c(ORCID = "0000-0002-6378-6229")),
person("Els", "Lommelen", , "els.lommelen@inbo.be", role = "ctb",
comment = c(ORCID = "0000-0002-3481-5684")),
person("Research Institute for Nature and Forest", , , "info@inbo.be", role = c("cph", "fnd"))
)
Description: Several templates to generate reports, presentations and
posters.
License: GPL-3
Expand Down Expand Up @@ -44,4 +39,4 @@ Additional_repositories: https://inbo.r-universe.dev
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.1.1
RoxygenNote: 7.1.2
4 changes: 4 additions & 0 deletions NEWS.md
@@ -1,3 +1,7 @@
# INBOmd 0.5.1

* Add language french for style Flanders

# INBOmd 0.5.0

## Breaking changes
Expand Down
2 changes: 1 addition & 1 deletion R/ebook.R
Expand Up @@ -33,7 +33,7 @@ ebook <- function() {
msg = "Use style: Vlaanderen when the language is nl"
)
assert_that(
style == "Flanders" || lang != "en",
style == "Flanders" || lang == "nl",
msg = "Use style: Flanders when the language is not nl"
)

Expand Down
4 changes: 2 additions & 2 deletions R/gitbook.R
Expand Up @@ -24,7 +24,7 @@ gitbook <- function() {
has_name(fm, "lang"), fm$lang, ifelse(style == "Flanders", "en", "nl")
)
assert_that(length(lang) == 1)
languages <- c(nl = "dutch", en = "english")
languages <- c(nl = "dutch", en = "english", fr = "french")
assert_that(
lang %in% names(languages),
msg = paste(
Expand All @@ -37,7 +37,7 @@ gitbook <- function() {
msg = "Use style: Vlaanderen when the language is nl"
)
assert_that(
style == "Flanders" || lang != "en",
style == "Flanders" || lang == "nl",
msg = "Use style: Flanders when the language is not nl"
)
split_by <- ifelse(has_name(fm, "split_by"), fm$split_by, "chapter+number")
Expand Down
3 changes: 3 additions & 0 deletions R/report.R
Expand Up @@ -70,12 +70,15 @@ report <- function(
csl <- system.file("research-institute-for-nature-and-forest.csl",
package = "INBOmd")

style <- ifelse(style == "Flanders" & lang == "fr", "Flandre", style)

args <- c(
"--template", template,
pandoc_variable_arg("documentclass", "report"),
switch(
style,
Flanders = pandoc_variable_arg("style", "flanders_report"),
Flandre = pandoc_variable_arg("style", "flandre_report"),
Vlaanderen = pandoc_variable_arg("style", "vlaanderen_report"),
INBO = pandoc_variable_arg("style", "inbo_report")
),
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -4,7 +4,7 @@
[![Lifecycle: stable](https://lifecycle.r-lib.org/articles/figures/lifecycle-stable.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)
![License](https://img.shields.io/github/license/inbo/INBOmd)
[![R build status](https://github.com/inbo/inbomd/workflows/check%20package%20on%20main/badge.svg)](https://github.com/inbo/inbomd/actions)
[![Codecov test coverage](https://codecov.io/gh/inbo/inbomd/branch/main/graph/badge.svg)](https://codecov.io/gh/inbo/inbomd?branch=main)
[![Codecov test coverage](https://app.codecov.io/gh/inbo/inbomd/branch/main/graph/badge.svg)](https://app.codecov.io/gh/inbo/inbomd?branch=main)
![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/inbo/inbomd.svg)
![GitHub repo size](https://img.shields.io/github/repo-size/inbo/inbomd.svg)
[![DOI](https://zenodo.org/badge/66824259.svg)](https://zenodo.org/badge/latestdoi/66824259)
Expand Down
4 changes: 2 additions & 2 deletions inst/CITATION
Expand Up @@ -2,12 +2,12 @@ citHeader("To cite `INBOmd` in publications please use:")
# begin checklist entry
citEntry(
entry = "Manual",
title = "INBOmd: Markdown Templates for INBO. Version 0.5.0",
title = "INBOmd: Markdown Templates for INBO. Version 0.5.1",
author = c(person(given = "Thierry", family = "Onkelinx")),
year = 2021,
url = "https://github.com/inbo/inbomd",
abstract = "Several templates to generate reports, presentations and posters.",
textVersion = "Onkelinx, Thierry (2021) INBOmd: Markdown Templates for INBO. Version 0.5.0. https://github.com/inbo/inbomd, https://doi.org/10.5281/zenodo.842223",
textVersion = "Onkelinx, Thierry (2021) INBOmd: Markdown Templates for INBO. Version 0.5.1. https://github.com/inbo/inbomd, https://doi.org/10.5281/zenodo.842223",
doi = "10.5281/zenodo.842223",
)
# end checklist entry
Expand Up @@ -414,14 +414,23 @@
\RequirePackage{lastpage}
\RequirePackage{fancyhdr}

\addto\extrasdutch{%
\def\cfcountry{}%
}
\addto\extrasenglish{%
\def\cfcountry{, Belgium}%
}
\addto\extrasfrench{%
\def\cfcountry{, Belgique}%
}
\newcommand{\chooseestablishment}[1]{%
\edef\custom{{#1}}%
\expandafter\ifstrequal\custom{Geraardsbergen}{
Geraardsbergen \\
Gaverstraat 4, 9500 Geraardsbergen
Gaverstraat 4, 9500 Geraardsbergen \cfcountry
}{
Brussel \\
VAC Brussel - Herman Teirlinck, Havenlaan 88 bus 73, 1000 Brussel
Herman Teirlinckgebouw, Havenlaan 88 bus 73, 1000 Brussel \cfcountry
}
}

Expand All @@ -444,18 +453,27 @@
\addto\extrasenglish{%
\def\cfauthor{Authors:}%
}
\addto\extrasfrench{%
\def\cfauthor{Auteurs:}%
}
\addto\extrasdutch{%
\def\cfmission{Het INBO is het onafhankelijk onderzoeksinstituut van de Vlaamse overheid dat via toegepast wetenschappelijk onderzoek, data- en kennisontsluiting het biodiversiteitsbeleid en -beheer onderbouwt en evalueert.}%
}
\addto\extrasenglish{%
\def\cfmission{The Research Institute for Nature and Forest (INBO) is an independent research institute of the Flemish government. Through applied scientific research, open data and knowledge, integration and disclosure, it underpins and evaluates biodiversity policy and management.}%
}
\addto\extrasfrench{%
\def\cfmission{l'Institut de Recherche sur la Nature et les Forêts ('Instituut voor Natuur- en Bosonderzoek', INBO) est un institut de recherche indépendant du gouvernement flamand, qui étaye et évalue la politique et la gestion en matière de biodiversité par la recherche scientifique appliquée, l'intégration et la dissémination publique de données et de connaissances.}%
}
\addto\extrasdutch{%
\def\cflocation{Vestiging:}%
}
\addto\extrasenglish{%
\def\cflocation{Location:}%
}
\addto\extrasfrench{%
\def\cflocation{Adresse:}%
}
\addto\extrasdutch{%
\def\cflocation{Vestiging:}%
}
Expand All @@ -468,60 +486,90 @@
\addto\extrasenglish{%
\def\cfinbo{Research Institute for Nature and Forest}%
}
\addto\extrasfrench{%
\def\cfinbo{l'Institut de Recherche sur la Nature et les Forêts}%
}
\addto\extrasdutch{%
\def\cfseries{Rapporten van het \cfinbo}%
}
\addto\extrasenglish{%
\def\cfseries{Reports of the \cfinbo}%
}
\addto\extrasfrench{%
\def\cfseries{Rapports de \cfinbo}%
}
\addto\extrasdutch{%
\def\cfcity{Brussel}%
}
\addto\extrasenglish{%
\def\cfcity{Brussels}%
}
\addto\extrasfrench{%
\def\cfcity{Bruxelles}%
}
\addto\extrasdutch{%
\def\cfcitation{Wijze van citeren:}%
}
\addto\extrasenglish{%
\def\cfcitation{Way of quoting:}%
}
\addto\extrasfrench{%
\def\cfcitation{Citation recommandée:}%
}
\addto\extrasdutch{%
\def\cfvu{Verantwoordelijke uitgever:}%
}
\addto\extrasenglish{%
\def\cfvu{Responsible publisher:}%
}
\addto\extrasfrench{%
\def\cfvu{Éditeur responsable:}%
}
\addto\extrasdutch{%
\def\cfcover{Foto cover:}%
}
\addto\extrasenglish{%
\def\cfcover{Cover photograph:}%
}
\addto\extrasfrench{%
\def\cfcover{Photo de couverture:}%
}
\addto\extrasdutch{%
\def\ccby{Dit werk valt onder een \href{https://creativecommons.org/licenses/by/4.0/}{Creative Commons Naamsvermelding 4.0 Internationaal-licentie}.}%
}
\addto\extrasenglish{%
\def\ccby{This work is licensed under a \href{https://creativecommons.org/licenses/by/4.0/}{Creative Commons Attribution 4.0 Generic License}.}%
}
\addto\extrasfrench{%
\def\ccby{Ce rapport est sous licence \href{https://creativecommons.org/licenses/by/4.0/deed.fr}{Creative Commons Attribution 4.0 International}.}%
}
\addto\extrasdutch{%
\def\ccbysa{Dit werk valt onder een \href{https://creativecommons.org/licenses/by-sa/4.0/}{Creative Commons Naamsvermelding-GelijkDelen 4.0 Internationaal-licentie}.}%
}
\addto\extrasenglish{%
\def\ccbysa{This work is licensed under a \href{https://creativecommons.org/licenses/by-sa/4.0/}{Creative Commons Attribution-ShareAlike 4.0 Generic License}.}%
}
\addto\extrasfrench{%
\def\ccbysa{Ce rapport est sous licence \href{https://creativecommons.org/licenses/by-sa/4.0/deed.fr}{Creative Commons Attribution-Partage dans les Mêmes Conditions 4.0 International}.}%
}
\addto\extrasdutch{%
\def\cfclient{Dit onderzoek werd uitgevoerd in opdracht van:}%
}
\addto\extrasenglish{%
\def\cfclient{This study was commissioned by:}%
}
\addto\extrasfrench{%
\def\cfclient{Cette étude a été commandée par:}%
}
\addto\extrasdutch{%
\def\cfcoop{Dit onderzoek werd uitgevoerd in samenwerking met:}%
}
\addto\extrasenglish{%
\def\cfcoop{This study was conducted in collaboration with:}%
}
\addto\extrasfrench{%
\def\cfcoop{Cette étude a été menée en collaboration avec:}%
}

\RequirePackage{emptypage}
% define title page
Expand Down
43 changes: 43 additions & 0 deletions inst/local_tex/tex/latex/inborapport_2015/flandre_report.sty
@@ -0,0 +1,43 @@
%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{flandre_report}

\RequirePackage{flanders_report_generic}
\titlelogo{\vspace{17mm}}
\alertlogo{alert.eps}
\examplelogo{example.eps}

% definition of colour scheme
\RequirePackage{flanderscolours}

\pagestyle{fancy}
\fancyhead{}
\fancyfoot{}
\fancyfoot[LO, RE]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\href{https://www.vlaanderen.be/fr}{www.vlaanderen.be}}}}
\fancyfoot[LE, RO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \pagename \textbf{ \thepage} / \textbf{\pageref*{LastPage}}}}
\fancyfoot[CE, CO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\@doi}}}
\renewcommand{\footrule}{\vbox to 8pt{\hbox
to\headwidth{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont\leaders\hbox{/}\hfill}\vss}}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}

\fancypagestyle{plain}{%
\fancyhead{}
\fancyfoot{}
\fancyfoot[LO, RE]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\href{https://www.vlaanderen.be/fr}{www.vlaanderen.be}}}}
\fancyfoot[CE, CO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\@doi}}}
\fancyfoot[LE, RO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \pagename \textbf{ \thepage} / \textbf{\pageref*{LastPage}}}}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
}

\fancypagestyle{cover}{%
\fancyhead{}
\fancyfoot{}
\fancyfoot[L]{\includegraphics[height = 10mm, keepaspectratio]{vlaanderen-en-naakt}}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\renewcommand{\footrule}{\vbox to 0pt{\hbox
to\headwidth{\hbox{}\hfill}\vss}}
\setlength{\footskip}{32.1pt}
}
2 changes: 1 addition & 1 deletion inst/template/report_en.epub3
Expand Up @@ -102,7 +102,7 @@ $if(titlepage)$
$if(geraardsbergen)$
INBO Geraardsbergen<br>Gaverstraat 4, 9500 Geraardsbergen, Belgium
$else$
INBO Brussels<br>VAC Brussel - Herman Teirlinck, Havenlaan 88 bus 73, 1000 Brussels, Belgium
INBO Brussel<br>Herman Teirlinckgebouw, Havenlaan 88 bus 73, 1000 Brussel, Belgium
$endif$
<br><a href="https://www.vlaanderen.be/inbo/en-gb">https://www.vlaanderen.be/inbo/en-gb</a>

Expand Down
2 changes: 1 addition & 1 deletion inst/template/report_en.html
Expand Up @@ -166,7 +166,7 @@ <h1 class = "missing">!!!! MISSING: reviewer !!!!</h1>
$if(geraardsbergen)$
INBO Geraardsbergen<br>Gaverstraat 4, 9500 Geraardsbergen, Belgium
$else$
INBO Brussels<br>VAC Brussel - Herman Teirlinck, Havenlaan 88 bus 73, 1000 Brussels, Belgium
INBO Brussel<br>Herman Teirlinckgebouw, Havenlaan 88 bus 73, 1000 Brussel, Belgium
$endif$
<br><a href="https://www.vlaanderen.be/inbo/en-gb">https://www.vlaanderen.be/inbo/en-gb</a>

Expand Down

0 comments on commit 1ec1bd4

Please sign in to comment.