Skip to content

Commit b1619cb

Browse files
dleutnantjjallaire
authored andcommitted
template for MDPI journals added (#147)
* work in progress: adding mdpi template * change template path * WIP, header and appendix not ready * WIP * setup header through YAML * set header through YAML * update bib exmpl * cleanup * add test * move csl out of YAML header * add appendix tex template * add MPDI as family in description file * easier handling of variables * fix LaTeX Error: Environment Shaded undefined. * updated mdpi class * updated mdpi template * update docs * bibliography now with natbib (to tackle issues with indentation in bib) * Update man * change yaml option 'article' to 'type', section references is not explicitly required in RMD
1 parent 61aeff8 commit b1619cb

17 files changed

Lines changed: 27178 additions & 2 deletions

File tree

DESCRIPTION

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: rticles
22
Type: Package
33
Title: Article Formats for R Markdown
4-
Version: 0.4.2
4+
Version: 0.4.2.9000
55
Authors@R: c(
66
person("JJ", "Allaire", role = c("aut", "cre"), email = "jj@rstudio.com"),
77
person(family = "R Foundation", role = c("aut", "cph")),
@@ -23,7 +23,9 @@ Authors@R: c(
2323
person("Miao", "Yu", role = c("aut", "cph"), email = "yufreecas@gmail.com"),
2424
person("Daniel", "Emaasit", role = c("aut", "cph"), email = "daniel.emaasit@gmail.com"),
2525
person("Thierry", "Onkelinx", role = c("aut", "cph"), email = "thierry.onkelinx@inbo.be"),
26-
person("Marc-Andre", "Desautels", role = c("aut", "cph"), email = "marc-andre.desautels@cstjean.qc.ca")
26+
person("Marc-Andre", "Desautels", role = c("aut", "cph"), email = "marc-andre.desautels@cstjean.qc.ca"),
27+
person("Dominik", "Leutnant", role = c("aut", "cph"), email = "leutnant@fh-muenster.de"),
28+
person(family = "MDPI", role = c("aut", "cph"))
2729
)
2830
Description: A suite of custom R Markdown formats and templates for
2931
authoring journal articles and conference submissions.

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export(ctex_template)
1111
export(elsevier_article)
1212
export(ieee_article)
1313
export(jss_article)
14+
export(mdpi_article)
1415
export(peerj_article)
1516
export(plos_article)
1617
export(pnas_article)

R/mdpi_article.R

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#' MDPI journal format.
2+
#'
3+
#' Format for creating submissions to Multidisciplinary Digital Publishing
4+
#' Institute (MDPI) journals. Adapted from
5+
#' \href{http://www.mdpi.com/authors/latex}{http://www.mdpi.com/authors/latex}.
6+
#'
7+
#' @inheritParams rmarkdown::pdf_document
8+
#' @param ... Additional arguments to \code{rmarkdown::pdf_document}
9+
#'
10+
#' @return R Markdown output format to pass to
11+
#' \code{\link[rmarkdown:render]{render}}
12+
#'
13+
#' @examples
14+
#'
15+
#' \dontrun{
16+
#' library(rmarkdown)
17+
#' draft("MyArticle.Rmd", template = "mdpi_article", package = "rticles")
18+
#' }
19+
#'
20+
#' @export
21+
mdpi_article <- function(..., keep_tex = TRUE) {
22+
inherit_pdf_document(...,
23+
keep_tex = keep_tex,
24+
template = find_resource("mdpi_article", "template.tex"),
25+
citation_package = "natbib")
26+
}

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ The **rticles** package provides a suite of custom [R Markdown](http://rmarkdown
4444

4545
- [Bulletin de l'AMQ](https://www.amq.math.ca/bulletin/) journal submissions
4646

47+
- [MDPI](http://www.mdpi.com) journal submissions
48+
4749
Under the hood, LaTeX templates are used to ensure that documents conform precisely to submission standards. At the same time, composition and formatting can be done using lightweight [markdown](http://rmarkdown.rstudio.com/authoring_basics.html) syntax, and R code and its output can be seamlessly included using [knitr](http://yihui.name/knitr/).
4850

4951
Using **rticles** requires the prerequisites described below. You can get most of these automatically by installing the latest release of RStudio (instructions for using **rticles** without RStudio are also provided).

inst/NEWS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
rticles 0.4.1.9000
2+
---------------------------------------------------------------------
3+
4+
- Add MDPI journal template
5+
16
rticles 0.4.1
27
---------------------------------------------------------------------
38

Lines changed: 227 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,227 @@
1+
% LaTeX support: latex@mdpi.com
2+
% In case you need support, please attach all files that are necessary for compiling as well as the log file, and specify the details of your LaTeX setup (which operating system and LaTeX version / tools you are using).
3+
4+
% You need to save the "mdpi.cls" and "mdpi.bst" files into the same folder as this template file.
5+
6+
%=================================================================
7+
\documentclass[$journal$,$type$,$status$,moreauthors,pdftex,10pt,a4paper]{mdpi}
8+
9+
%% Some pieces required from the pandoc template
10+
\providecommand{\tightlist}{%
11+
\setlength{\itemsep}{0pt}\setlength{\parskip}{4pt}}
12+
\setlist[itemize]{leftmargin=*,labelsep=5.8mm}
13+
\setlist[enumerate]{leftmargin=*,labelsep=4.9mm}
14+
15+
\usepackage{longtable}
16+
17+
% see https://stackoverflow.com/a/47122900
18+
$if(highlighting-macros)$
19+
$highlighting-macros$
20+
$endif$
21+
22+
%
23+
%--------------------
24+
% Class Options:
25+
%--------------------
26+
% journal
27+
%----------
28+
% Choose between the following MDPI journals:
29+
% actuators, addictions, admsci, aerospace, agriculture, agronomy, algorithms, animals, antibiotics, antibodies, antioxidants, applsci, arts, asi, atmosphere, atoms, axioms, batteries, bdcc, behavsci, beverages, bioengineering, biology, biomedicines, biomimetics, biomolecules, biosensors, brainsci, buildings, carbon, cancers, catalysts, cells, ceramics, challenges, chemengineering, chemosensors, children, chromatography, climate, coatings, colloids, computation, computers, condensedmatter, cosmetics, cryptography, crystals, cybersecurity, data, dentistry, designs, diagnostics, diseases, diversity, econometrics, economies, education, electrochemistry, electronics, energies, entropy, environments, epigenomes, est, fermentation, fibers, fire, fishes, fluids, foods, forests, fractalfract, futureinternet, galaxies, games, gastrointestdisord, gels, genealogy, genes, geosciences, geriatrics, hazardousmatters, healthcare, heritage, highthroughput, horticulturae, humanities, hydrology, informatics, information, infrastructures, inorganics, insects, instruments, ijerph, ijfs, ijms, ijgi, ijtpp, inventions, j, jcdd, jcm, jcs, jdb, jfb, jfmk, jimaging, jof, jintelligence, jlpea, jmmp, jmse, jpm, jrfm, jsan, land, languages, laws, life, literature, logistics, lubricants, machines, magnetochemistry, make, marinedrugs, materials, mathematics, mca, mti, medsci, medicines, membranes, metabolites, metals, microarrays, micromachines, microorganisms, minerals, modelling, molbank, molecules, mps, nanomaterials, ncrna, neonatalscreening, neuroglia, nitrogen, nutrients, ohbm, particles, pathogens, pharmaceuticals, pharmaceutics, pharmacy, philosophies, photonics, plants, plasma, polymers, polysaccharides, preprints, proceedings, processes, proteomes, publications, quaternary, qubs, recycling, religions, remotesensing, reports, resources, risks, robotics, safety, scipharm, sensors, separations, sexes, sinusitis, socsci, societies, soils, sports, standards, stats, surgeries, sustainability, symmetry, systems, technologies, toxics, toxins, tropicalmed, universe, urbansci, vaccines, vetsci, vibration, viruses, vision, water, wem
30+
%---------
31+
% article
32+
%---------
33+
% The default type of manuscript is article, but can be replaced by:
34+
% abstract, addendum, article, benchmark, book, bookreview, briefreport, casereport, changes, comment, commentary, communication, conceptpaper, correction, conferenceproceedings, conferencereport, expressionofconcern, meetingreport, creative, datadescriptor, discussion, editorial, essay, erratum, hypothesis, interestingimages, letter, meetingreport, newbookreceived, opinion, obituary, projectreport, reply, reprint, retraction, review, perspective, protocol, shortnote, supfile, technicalnote, viewpoint
35+
% supfile = supplementary materials
36+
% protocol: If you are preparing a "Protocol" paper, please refer to http://www.mdpi.com/journal/mps/instructions for details on its expected structure and content.
37+
%----------
38+
% submit
39+
%----------
40+
% The class option "submit" will be changed to "accept" by the Editorial Office when the paper is accepted. This will only make changes to the frontpage (e.g. the logo of the journal will get visible), the headings, and the copyright information. Also, line numbering will be removed. Journal info and pagination for accepted papers will also be assigned by the Editorial Office.
41+
%------------------
42+
% moreauthors
43+
%------------------
44+
% If there is only one author the class option oneauthor should be used. Otherwise use the class option moreauthors.
45+
%---------
46+
% pdftex
47+
%---------
48+
% The option pdftex is for use with pdfLaTeX. If eps figures are used, remove the option pdftex and use LaTeX and dvi2pdf.
49+
50+
%=================================================================
51+
\firstpage{1}
52+
\makeatletter
53+
\setcounter{page}{\@firstpage}
54+
\makeatother
55+
\articlenumber{x}
56+
\doinum{10.3390/------}
57+
\pubvolume{xx}
58+
\pubyear{2018}
59+
\copyrightyear{2018}
60+
\externaleditor{Academic Editor: name}
61+
\history{Received: date; Accepted: date; Published: date}
62+
63+
%------------------------------------------------------------------
64+
% The following line should be uncommented if the LaTeX file is uploaded to arXiv.org
65+
%\pdfoutput=1
66+
67+
%=================================================================
68+
% Add packages and commands here. The following packages are loaded in our class file: fontenc, calc, indentfirst, fancyhdr, graphicx, lastpage, ifthen, lineno, float, amsmath, setspace, enumitem, mathpazo, booktabs, titlesec, etoolbox, amsthm, hyphenat, natbib, hyperref, footmisc, geometry, caption, url, mdframed, tabto, soul, multirow, microtype, tikz
69+
70+
%=================================================================
71+
%% Please use the following mathematics environments: Theorem, Lemma, Corollary, Proposition, Characterization, Property, Problem, Example, ExamplesandDefinitions, Hypothesis, Remark, Definition
72+
%% For proofs, please use the proof environment (the amsthm package is loaded by the MDPI class).
73+
74+
%=================================================================
75+
% Full title of the paper (Capitalized)
76+
\Title{$title$}
77+
78+
% Authors, for the paper (add full first names)
79+
\Author{$for(author)$$author.name$$$^{$author.affil$}$$$if(author.orcid)$\href{https://orcid.org/$author.orcid$}{\orcidicon}$endif$$sep$, $endfor$}
80+
81+
% Authors, for metadata in PDF
82+
\AuthorNames{$for(author)$$author.name$$sep$, $endfor$}
83+
84+
% Affiliations / Addresses (Add [1] after \address if there is only one affiliation.)
85+
\address{%
86+
$for(affiliation)$
87+
$$^{$affiliation.num$}$$ \quad $affiliation.address$; $affiliation.email$\\
88+
$endfor$
89+
}
90+
% Contact information of the corresponding author
91+
\corres{Correspondence: $correspondence$}
92+
93+
% Current address and/or shared authorship
94+
$if(firstnote)$\firstnote{$firstnote$}$endif$
95+
$if(secondnote)$\secondnote{$secondnote$}$endif$
96+
$if(thirdnote)$\thirdnote{$thirdnote$}$endif$
97+
$if(fourthnote)$\fourthnote{$fourthnote$}$endif$
98+
$if(fifthnote)$\fifthnote{$fifthnote$}$endif$
99+
$if(sixthnote)$\sixthnote{$sixthnote$}$endif$
100+
$if(seventhnote)$\seventhnote{$seventhnote$}$endif$
101+
$if(eighthnote)$\eighthnote{$eighthnote$}$endif$
102+
% The commands \thirdnote{} till \eighthnote{} are available for further notes
103+
104+
% Simple summary
105+
$if(simplesummary)$
106+
\simplesumm{$simplesummary$}
107+
$endif$
108+
109+
% Abstract (Do not insert blank lines, i.e. \\)
110+
$if(abstract)$
111+
\abstract{$abstract$}
112+
$endif$
113+
114+
% Keywords
115+
$if(keywords)$
116+
\keyword{$keywords$}
117+
$endif$
118+
119+
% The fields PACS, MSC, and JEL may be left empty or commented out if not applicable
120+
%\PACS{J0101}
121+
%\MSC{}
122+
%\JEL{}
123+
124+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
125+
% Only for the journal Applied Sciences:
126+
%\featuredapplication{Authors are encouraged to provide a concise description of the specific application or a potential application of the work. This section is not mandatory.}
127+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
128+
129+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
130+
% Only for the journal Data:
131+
%\dataset{DOI number or link to the deposited data set in cases where the data set is published or set to be published separately. If the data set is submitted and will be published as a supplement to this paper in the journal Data, this field will be filled by the editors of the journal. In this case, please make sure to submit the data set as a supplement when entering your manuscript into our manuscript editorial system.}
132+
133+
%\datasetlicense{license under which the data set is made available (CC0, CC-BY, CC-BY-SA, CC-BY-NC, etc.)}
134+
135+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
136+
% Only for the journal Toxins
137+
%\keycontribution{The breakthroughs or highlights of the manuscript. Authors can write one or two sentences to describe the most important part of the paper.}
138+
139+
%\setcounter{secnumdepth}{4}
140+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
141+
142+
\begin{document}
143+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
144+
%% Only for the journal Gels: Please place the Experimental Section after the Conclusions
145+
146+
$body$
147+
148+
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
149+
% %% optional
150+
% \supplementary{The following are available online at www.mdpi.com/link, Figure S1: title, Table S1: title, Video S1: title.}
151+
%
152+
% % Only for the journal Methods and Protocols:
153+
% % If you wish to submit a video article, please do so with any other supplementary material.
154+
% % \supplementary{The following are available at www.mdpi.com/link: Figure S1: title, Table S1: title, Video S1: title. A supporting video article is available at doi: link.}
155+
156+
\vspace{6pt}
157+
158+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
159+
$if(acknowledgement)$
160+
\acknowledgments{$acknowledgement$}
161+
$endif$
162+
163+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
164+
$if(authorcontributions)$
165+
\authorcontributions{$authorcontributions$}
166+
$endif$
167+
168+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
169+
$if(conflictsofinterest)$
170+
\conflictsofinterest{$conflictsofinterest$}
171+
$endif$
172+
173+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
174+
%% optional
175+
$if(abbreviations)$
176+
\abbreviations{The following abbreviations are used in this manuscript:\\
177+
178+
\noindent
179+
\begin{tabular}{@{}ll}
180+
$for(abbreviations)$
181+
$abbreviations.short$ & $abbreviations.long$ \\
182+
$endfor$
183+
\end{tabular}}
184+
$endif$
185+
186+
$if(appendix)$
187+
\input{"$appendix$"}
188+
$endif$
189+
190+
191+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
192+
% Citations and References in Supplementary files are permitted provided that they also appear in the reference list here.
193+
194+
%=====================================
195+
% References, variant A: internal bibliography
196+
%=====================================
197+
% \reftitle{References}
198+
% \begin{thebibliography}{999}
199+
% % Reference 1
200+
% \bibitem[Author1(year)]{ref-journal}
201+
% Author1, T. The title of the cited article. {\em Journal Abbreviation} {\bf 2008}, {\em 10}, 142-149, DOI.
202+
% % Reference 2
203+
% \bibitem[Author2(year)]{ref-book}
204+
% Author2, L. The title of the cited contribution. In {\em The Book Title}; Editor1, F., Editor2, A., Eds.; Publishing House: City, Country, 2007; pp. 32-58, ISBN.
205+
% \end{thebibliography}
206+
207+
% The following MDPI journals use author-date citation: Arts, Econometrics, Economies, Genealogy, Humanities, IJFS, JRFM, Laws, Religions, Risks, Social Sciences. For those journals, please follow the formatting guidelines on http://www.mdpi.com/authors/references
208+
% To cite two works by the same author: \citeauthor{ref-journal-1a} (\citeyear{ref-journal-1a}, \citeyear{ref-journal-1b}). This produces: Whittaker (1967, 1975)
209+
% To cite two works by the same author with specific pages: \citeauthor{ref-journal-3a} (\citeyear{ref-journal-3a}, p. 328; \citeyear{ref-journal-3b}, p.475). This produces: Wong (1999, p. 328; 2000, p. 475)
210+
211+
%=====================================
212+
% References, variant B: external bibliography
213+
%=====================================
214+
$if(bibliography)$
215+
\reftitle{References}
216+
\externalbibliography{yes}
217+
\bibliography{$bibliography$}
218+
$endif$
219+
220+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
221+
%% optional
222+
$if(sampleavailability)$
223+
\sampleavailability{$sampleavailability$}
224+
$endif$
225+
226+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
227+
\end{document}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
%% optional
2+
\appendixtitles{no} %Leave argument "no" if all appendix headings stay EMPTY (then no dot is printed after "Appendix A"). If the appendix sections contain a heading then change the argument to "yes".
3+
\appendixsections{multiple} %Leave argument "multiple" if there are multiple sections. Then a counter is printed ("Appendix A"). If there is only one appendix section then change the argument to "one" and no counter is printed ("Appendix").
4+
\appendix
5+
\section{}
6+
\subsection{}
7+
The appendix is an optional section that can contain details and data supplemental to the main text. For example, explanations of experimental details that would disrupt the flow of the main text, but nonetheless remain crucial to understanding and reproducing the research shown; figures of replicates for experiments of which representative data is shown in the main text can be added here if brief, or as Supplementary data. Mathematical proofs of results not central to the paper can be added as an appendix.
8+
9+
\section{}
10+
All appendix sections must be cited in the main text. In the appendixes, Figures, Tables, etc. should be labeled starting with `A', e.g., Figure A1, Figure A2, etc.

0 commit comments

Comments
 (0)