From e3a21dca920a17a80a4c0425b10aa42bf69c322b Mon Sep 17 00:00:00 2001 From: stefanocoretta Date: Sat, 26 Dec 2020 18:02:40 +0100 Subject: [PATCH 01/28] add pihph_article() --- DESCRIPTION | 3 +- NAMESPACE | 1 + NEWS.md | 2 + R/article.R | 9 + README.md | 1 + .../templates/pihph/resources/template.tex | 285 ++++++++++++++++++ .../templates/pihph/skeleton/pihph-logo.png | Bin 0 -> 7217 bytes .../templates/pihph/skeleton/skeleton.Rmd | 97 ++++++ inst/rmarkdown/templates/pihph/template.yaml | 5 + man/article.Rd | 9 + tests/testit/test-formats.R | 1 + 11 files changed, 412 insertions(+), 1 deletion(-) create mode 100644 inst/rmarkdown/templates/pihph/resources/template.tex create mode 100644 inst/rmarkdown/templates/pihph/skeleton/pihph-logo.png create mode 100644 inst/rmarkdown/templates/pihph/skeleton/skeleton.Rmd create mode 100644 inst/rmarkdown/templates/pihph/template.yaml diff --git a/DESCRIPTION b/DESCRIPTION index 73967a88a..c5504cff4 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -44,7 +44,8 @@ Authors@R: c( person("Shixiang", "Wang", role = c("aut", "ctb"), email = "w_shixiang@163.com", comment = c(ORCID = "0000-0001-9855-7357")), person('Jay', 'Hesselberth', role = c('aut', 'ctb'), email = 'jay.hesselberth@gmail.com', comment = c(ORCID = '0000-0002-6299-179X')), person("Alfredo", "Hernández", role = c("ctb"), email = "aldomann.designs@gmail.com", comment = c(ORCID = "0000-0002-2660-4545")), - person("Christophe", "Dervieux", role = c("aut"), email = "cderv@rstudio.com", comment = c(ORCID = "0000-0003-4474-2498")) + person("Christophe", "Dervieux", role = c("aut"), email = "cderv@rstudio.com", comment = c(ORCID = "0000-0003-4474-2498")), + person("Stefano", "Coretta", role = c("ctb"), email = "stefano.coretta@gmail.com", comment = c(ORCID = "0000-0001-9627-5532", github = "stefanocoretta")) ) Description: A suite of custom R Markdown formats and templates for authoring journal articles and conference submissions. diff --git a/NAMESPACE b/NAMESPACE index 476d8615c..30ae223c8 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -25,6 +25,7 @@ export(mdpi_article) export(mnras_article) export(oup_article) export(peerj_article) +export(pihph_article) export(plos_article) export(pnas_article) export(rjournal_article) diff --git a/NEWS.md b/NEWS.md index 793cad51a..213316311 100644 --- a/NEWS.md +++ b/NEWS.md @@ -17,6 +17,8 @@ fix for the LaTeX problem sanitized with the last `rticles` update (thanks, @RLu - Update all templates regarding CSLReference environment following changes in Pandoc's default template. +- Add article template `pihph_article()` for the *Papers in Historical Phonology* (PiHPh). + rticles 0.17 --------------------------------------------------------------------- diff --git a/R/article.R b/R/article.R index 7f78626c3..3ab040d0f 100644 --- a/R/article.R +++ b/R/article.R @@ -249,6 +249,15 @@ peerj_article <- function(..., keep_tex = TRUE) { pdf_document_format("peerj", keep_tex = keep_tex, ...) } +#' @section \code{pihph_article}: Format for creating submissions to the +#' Papers in Historical Phonology. Adapted from +#' \url{https://github.com/pihph/templates}. +#' @export +#' @rdname article +pihph_article <- function(..., keep_tex = TRUE, latex_engine = "xelatex") { + pdf_document_format("pihph", keep_tex = keep_tex, latex_engine = latex_engine, ...) +} + #' @section \code{plos_article}: Format for creating submissions to PLOS #' journals. Adapted from \url{https://journals.plos.org/ploscompbiol/s/latex}. #' @export diff --git a/README.md b/README.md index 4960a2cb6..6bf1bf0d0 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,7 @@ Currently included templates and their contributors are the following: | [MNRAS: Monthly Notices of the Royal Astronomical Society](https://academic.oup.com/mnras) | [@oleskiewicz](https://github.com/oleskiewicz) | [#175](https://github.com/rstudio/rticles/pull/175) | `mnras_article()` | | [OUP: Oxford University Press](https://academic.oup.com/journals/pages/authors/preparing_your_manuscript) | [@dmkaplan](https://github.com/dmkaplan) | [#284](https://github.com/rstudio/rticles/pull/284) | `oup_articles()` | | [PeerJ: Journal of Life and Environmental Sciences](https://peerj.com) | [@zkamvar](https://github.com/zkamvar) | [#127](https://github.com/rstudio/rticles/pull/127) | `peerj_article()` | +| [PiHPh: Papers in Historical Phonology](http://journals.ed.ac.uk/pihph/about/submissions) | [@stefanocoretta](https://github.com/stefanocoretta) | | `pihph_article()` | | [PLOS](https://plos.org/#journals) | [@sjmgarnier](https://github.com/sjmgarnier) | [#12](https://github.com/rstudio/rticles/pull/12) | `plos_article()` | | [PNAS: Proceedings of the National Academy of Sciences](https://www.pnas.org/) | [@cboettig](https://github.com/cboettig) | [#72](https://github.com/rstudio/rticles/pull/72) | `pnas_article()` | | [RSOS: Royal Society Open Science](https://www.royalsocietypublishing.org/journal/rsos) | [@ThierryO](https://github.com/ThierryO) | [#135](https://github.com/rstudio/rticles/pull/135) | `rsos_article()` | diff --git a/inst/rmarkdown/templates/pihph/resources/template.tex b/inst/rmarkdown/templates/pihph/resources/template.tex new file mode 100644 index 000000000..3ef79ec66 --- /dev/null +++ b/inst/rmarkdown/templates/pihph/resources/template.tex @@ -0,0 +1,285 @@ +% === GO TO THE USER CUSTOMIZATION SECTION TO MAKE CHANGES + +\documentclass[article, a4paper, 12pt, $for(classoption)$$classoption$$sep$,$endfor$]{memoir} + +% Please use XeLaTeX to compile + +\usepackage{xltxtra} +\defaultfontfeatures{Ligatures=TeX} +\usepackage{hyphenat} + +\newcommand\setlogofont[1]{\newfontfamily\logofont{#1}} +\newcommand\setlicensefont[1]{\newfontfamily\licensefont{#1}} +\usepackage{microtype} +\usepackage{rotating} +\usepackage{hyperxmp} +\usepackage[colorlinks=true, unicode=true, breaklinks=true, linkcolor=black, urlcolor=blue, citecolor=black]{hyperref} + +\counterwithout{section}{chapter} +\setsecnumdepth{subsubsection} +\setcounter{tocdepth}{3} + +\usepackage[export]{adjustbox} +\usepackage{graphicx} +\usepackage[type={CC}, modifier={by}, version=4.0]{doclicense} + +\newcommand\affiliation[1]{{\normalfont\normalsize\itshape#1}} + +\pagestyle{simple} +\makeevenfoot{simple}{}{}{} +\makeoddfoot{simple}{}{}{} +\raggedbottom + +\newcommand\authorheader[1]{\makeevenhead{simple}{\footnotesize\itshape#1}{}{\footnotesize\thepage}} +\newcommand\titleheader[1]{\makeoddhead{simple}{\footnotesize\thepage}{}{\footnotesize\itshape#1}} + +\newcommand\thisdoi{10.2218/pihph.201x.x.xxxx} +\newcommand\thisdoilink{http://dx.doi.org/\thisdoi} + +\renewcommand{\maketitlehooka}{% + \vspace*{-60pt} + \noindent\hspace*{-25pt}\begin{minipage}[t]{2.5cm} + \vspace*{-16pt} + \includegraphics[valign=t, width=2.5cm]{pihph-logo.png} + \end{minipage} + \begin{minipage}[t]{.75\linewidth} + \centering + $if(logofont)$\logofont$endif$$if(default-fonts)$\logofont$endif$$if(alt-fonts)$\logofont$endif$\Large Papers in Historical Phonology\\[5pt] + + \footnotesize + + http://journals.ed.ac.uk/pihph + + ISSN 2399-6714 + + \footnotesize\vspace*{5pt} + + Volume 1, \thepage--\thelastpage + + DOI: \thisdoi + \end{minipage} + \begin{minipage}[t]{2.1cm} + \centering + \vspace*{-14pt} + \adjustbox{valign=t}{\doclicenseImage[imagewidth=2.1cm]}\\ + $if(licensefont)$\licensefont$endif$$if(default-fonts)$\licensefont$endif$$if(alt-fonts)$\licensefont$endif$\tiny Licensed under~a \doclicenseLongNameRef{} License + \end{minipage} +} + +\pretitle{\vspace*{24pt}\begin{center}\large\bfseries} +\preauthor{\begin{center}\large\scshape\begin{tabular}[t]{c}} +\postauthor{\end{tabular}\end{center}\vspace*{12pt}} + +\predate{\relax} +\postdate{\relax} +\date{} + +\captionnamefont{\footnotesize\bfseries} +\captiontitlefont{\footnotesize} + +\renewcommand\abstractnamefont{\normalfont\footnotesize\bfseries} +\renewcommand\abstracttextfont{\normalfont\footnotesize} +\setlength\absleftindent{1cm} +\setlength\absrightindent{1cm} +\setlength{\abstitleskip}{-17pt} +\setbeforesecskip{-18pt} +\setaftersecskip{6pt} +\setsecheadstyle{\normalfont\bfseries} +\setbeforesubsecskip{-18pt} +\setaftersubsecskip{6pt} +\setsubsecheadstyle{\normalfont\bfseries} +\setbeforesubsubsecskip{-18pt} +\setaftersubsubsecskip{6pt} +\setsubsubsecheadstyle{\normalfont\bfseries} +\renewenvironment{quote}{\list{}{\leftmargin=0.7cm\rightmargin=0.7cm}\item[]\footnotesize}{\endlist} + +\setlrmarginsandblock{4cm}{4cm}{*} +\setulmarginsandblock{4.5cm}{4.5cm}{*} +\checkandfixthelayout + +\setlength{\footmarkwidth}{0em} +\setlength{\footmarksep}{0em} +\footmarkstyle{\textsuperscript{#1}\hspace{.3em}} +\setfootins{24pt}{\bigskipamount} +\renewcommand*{\footnoterule}{% + \kern-3pt% + \hrule width 0.4\columnwidth + \kern 2.6pt + \vspace{12pt}} + +\usepackage[usenames]{xcolor} +\definecolor{pihphgreen}{RGB}{118, 146, 60} +\usepackage[most]{tcolorbox} + +\newtcolorbox{tcdoublebox}[1][]{% + enhanced jigsaw, + sharp corners, + colback=white, + text width=.95\textwidth, + before={\vspace*{18pt}\noindent}, + left skip=-5mm, + borderline={1pt}{-2pt}{black}, + #1 +} + +\newcommand\commentsinvited{ +\begin{tcdoublebox} + +\section*{\textcolor{pihphgreen}{Comments invited}} + +\textit{PiHPh} relies on post-publication review of the papers that it publishes. If you have any comments on this piece, please add them to its comments site. You are encouraged to consult this site after reading the paper, as there may be comments from other readers there, and replies from the author. This paper's site is here: + +\vspace*{1ex}\noindent \url{\thisdoilink} + +\end{tcdoublebox} +} + +\widowpenalty=10000 +\clubpenalty=10000 + +% === START OF USER CUSTOMIZATION + + +\title{$title$$if(subtitle)$:\\$subtitle$$endif$} +\author{$for(author)$$author.name$\\\affiliation{$author.affiliation$}$sep$ \and $endfor$} + +\authorheader{$if(author-header)$$author-header$$else$$for(author)$$author.name$$sep$, $endfor$$endif$} +\titleheader{$if(title-header)$$title-header$$else$$title$$endif$} + +$if(default-fonts)$ +\setmainfont{Cambria} +\setlicensefont{Calibri} +\setlogofont{Lekton} +$elseif(alt-fonts)$ +\setmainfont{Caladea} +\setlicensefont{Carlito} +\setlogofont{Lekton} +$else$ +$if(main)$ +\setmainfont{$main$} +$endif$ +$if(licensefont)$ +\setlicensefont{$licensefont$} +$endif$ +$if(logofont)$ +\setlogofont{$logofont$} +$endif$ +$endif$ + + +% If you do not have access to Cambria, you can use the metric-equivalent Caladea: https://fontlibrary.org/en/font/caladea +% If you do not have access to Calibri, you can use the metric-equivalent Carlito: https://fontlibrary.org/en/font/carlito +% Lekton available at https://www.fontsquirrel.com/fonts/lekton + +% If any of these fonts are not available on your system, feel free to +% change them here, but of course the final layout will then differ + +\usepackage{polyglossia} % or use babel if desired +\setmainlanguage[variant=british]{english} % or use babel if desired +\usepackage[autostyle, english=british]{csquotes} % remove the english=british option for double quotes +\usepackage{$gloss$} % for examples, feel free to use anything else + +$if(listings)$ +\usepackage{listings} +$endif$ +$if(lhs)$ +\lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{} +$endif$ +$if(highlighting-macros)$ +$highlighting-macros$ +$endif$ +$if(verbatim-in-note)$ +\usepackage{fancyvrb} +\VerbatimFootnotes % allows verbatim text in footnotes +$endif$ + +% Some recommended packages + +\usepackage{booktabs} % for nice tables + +$if(biblatex)$ +% BibLaTeX setup, recommended +\usepackage[backend=biber, + style=langsci-unified, % available on CTAN + mincrossrefs=50, + maxcitenames=3, + maxbibnames=50, + useprefix=true, + doi=false]{biblatex} +$for(bibliography)$ +\addbibresource{$bibliography$} +$endfor$ +% remember to include the .bib extension +% remember to run biber rather than bibtex if using this option +\AtEveryCitekey{\ifciteseen{}{\defcounter{maxnames}{99}}} +$endif$ +$if(natbib)$ +% BibTeX setup, deprecated +\usepackage{natbib} +\bibpunct[:]{(}{)}{;}{a}{}{,} +\setlength\bibsep{0pt} +$endif$ + +$for(header-includes)$ +$header-includes$ +$endfor$ + +\begin{document} +\setcounter{page}{1} +\maketitle +\thispagestyle{empty} + +$if(abstract)$ +\begin{abstract} +\noindent $abstract$ +\end{abstract} +$endif$ + +$body$ + +\commentsinvited % Please do not change this + +$if(acknowledgements)$ +\section*{Acknowledgements} +$acknowledgements$ +$endif$ + +$if(supplement)$ +\section*{Associated material} +$supplement$ +$endif$ + +\section*{Author's contact details} +\label{sec:auth-cont-deta} + +$for(author)$ +$if(author.email)$ +\noindent \textit{$author.name$} + +\noindent $author.affiliation$ + +$if(author.address)$ + +\noindent $author.address$ +$endif$ +\vspace*{5pt} +\noindent \textit{$author.email$} + +$endif$ +$endfor$ + +$if(biblatex)$ +% BibLaTeX setup, recommended +\printbibliography[title=References] +$endif$ +$if(natbib)$ +% BibTeX setup, deprecated +\bibliographystyle{unified} % unified.bst can be obtained at http://cexlj.org/downloads/unified.bst +\renewcommand\bibsection{\section*{References}} +\bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$} +$endif$ + +$for(include-after)$ +$include-after$ +$endfor$ +\end{document} diff --git a/inst/rmarkdown/templates/pihph/skeleton/pihph-logo.png b/inst/rmarkdown/templates/pihph/skeleton/pihph-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..5974130291cc538f5905e73d2fe9be8bb4317d86 GIT binary patch literal 7217 zcmV-19M0p3P)4Tx05}naRo`#hR1`jmZ&IWdKOk5~hl<6oRa0BJ8yc;~21%2p?MfD<>DVeH z9(p*dx19w`~g7O0}n_%Aq@s%d)fBDv`JHkDym6Hd+5XuAtvnwRpGmK zVkc9?T=n|PIo~X-eVh__(Z?q}P9Z-Dj?gOW6|D%o20XmjW-qs4UjrD(li^iv8@eK9k+ZFm zVRFymFOPAzG5-%Pn|1W;U4vNroTa&AxDScmEA~{ri9gr1^c?U@uwSpaNnw8l_>cP1 zd;)kMQS_;jeRSUEM_*s96y65j1$)tOrwdK{YIQMt92l|D^(E_=$Rjw{b!QT@q!)ni zR`|5oW9X5n$Wv+HVc@|^eX5yXnsHX8PF3UX~a6)MwxDE0HaPjyrlI!;jX{6Kvuh*8ej?;85ekN$?5uuCiS zBTvvVG+XTxAO{m@bvM#Jr)z6J><&E22D|vq?Y?Vkbo_DijopiF$2PET#mZ8eu=y$(ArYkv7@Ex`GL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>qVcJzW?#7s4GbIL#$b<98s{p^u%@XUYh!Ktc_tCQVmMs|5A?t5wj?%lEk z3{#^TCld~7V9_PCtJ81ri75eH{L}{e!H>Ux6uwu3%yfJ@E9OwioNL9*JU5#Hne~32pE7!|FU-z6+mtoboa}@YE)3-Fhw38Mfr*UM4Y^g)}jWXyC2Hf-c=M2V|9ZZQOxy#l36r z_!FzKu++g&C^52Vfa+7+#KeLwm@|;vNBel%+%o*&$6IjQtqYYE8ok_qRQHJ_=4(h8 z=puXxs8(kt?sQPtk@AvRh9ofUb=qCxHz?C$pI2W%1t{&rDoSyv%3QQ5`Y8~{!T%|-J zk5deKBAcq0rBXl#U8RJEjymWX0$XjW4!TMS4IOpRH3YWWR2_7c5*j+{plb+hwW&Jj zDkU^@)Irw}*lJUC&{axk=%|CPA+Xh^>Y%HX(9lr_T|;22P1QkHDWRdG4!VZGR-3AW zu2MonM;&wxfvq-GiIL;t057OF^y7@DK+pdJv^&L++kb}E00000NkvXXu0mjfqN^XN literal 0 HcmV?d00001 diff --git a/inst/rmarkdown/templates/pihph/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/pihph/skeleton/skeleton.Rmd new file mode 100644 index 000000000..6c3342a9c --- /dev/null +++ b/inst/rmarkdown/templates/pihph/skeleton/skeleton.Rmd @@ -0,0 +1,97 @@ +--- +title: This is a title and this is too +subtitle: A subtitle goes on another line +author: +- name: Author's name + affiliation: Author's affiliation + email: e-mail@uni.edu +- name: Second author's name (if there is one) + affiliation: Second author's affiliation +output: rticles::pihph_article +gloss: expex # feel free to use your preferred package for the examples +# FONTS +# If default-fonts is true, alt-fonts should be set to false, and vice versa. +default-fonts: false # set to true if you want to use the defaults fonts +# The default fonts are: Cambria, Calibri, and Lekton +# Lekton can be found at: https://www.fontsquirrel.com/fonts/lekton +alt-fonts: false # set to true if you want to use alternative fonts +# The alternative fonts are: Caladea, Carlito, and Lekton +# Caladea can be found at: https://fontlibrary.org/en/font/caladea +# Carlito can be found at: https://fontlibrary.org/en/font/carlito +# Lekton can be found at: https://www.fontsquirrel.com/fonts/lekton +# +# If any of these fonts are not available on your system, feel free to +# change them here, but of course the final layout will then differ. +# Uncomment the following lines and set the chosen fonts: +# mainfont: Charis SIL +# licensefont: Arial +# logofont: Arial +# +# Finally, if you'd rather use the default XeLaTeX fonts, just leave +# both default-fonts and alt-fonts set to false and don't specify mainfont, +# licensefont, nor logofont. +abstract: | + This is the template for \LaTeX{} users; we also have a Word template available, so feel free to use that if you're not into \LaTeX. All submissions to PiHPh should aim to follow the formatting set out in this template precisely, as there is no separate typesetting phase. Most styles in this template have been set up to insert the necessary white space where needed. You should use the styles that are provided in this template consistently to ensure that your submission is quickly processed. Do not change the margins or header/footer properties, including the material on this first page (such as volume, page numbers and DOI), which we will update when your submission is ready. Make sure to look at the user customization part of the preamble to this \texttt{.tex} source to change titles, running headers, bibliography etc. All the packages used here should be available in a recent version of \TeX Live. All articles should include an abstract in this position, of no more than 200 words. +acknowledgements: Include any acknowledgements in an unnumbered section here, rather than in a footnote early in the paper. +supplement: If you would like to post any data sets, statistical data, scripts or similar material that links to your article, you can include a description of it all at the end of the paper. +--- + +```{r setup, include=FALSE} +knitr::opts_chunk$set(echo = TRUE) +``` + +# Heading level 1 + +The first paragraph under all headings will not be indented.^[This is a footnote example] The font for everything is Cambria --- use Xe\LaTeX{} to compile the document to achieve this. Cambria should hopefully have all the transcription symbols that you will need, but if you have any problems using symbols, get in touch (pihph@\hspace{0pt}mlist.ed.ac.uk). Use normal phonological conventions when transcribing: [skweːɹ] brackets for surface/narrow transcriptions and /slantɪd/ brackets for underlying/broad transcriptions. It’s fine to use either IPA conventions (e.g., /t͡ʃ, ɾ, j, y/) or Americanist conventions (e.g., /č, ᴅ, y, ü/), but if there is any possibility of ambiguity or if you need to use a non-conventional symbol, you should explain what it stands for. + +All paragraphs other than the first in a section will be indented by 0.7cm. Make sure that you use the shaftless arrow \enquote{>} for diachronic correspondences. The shafted arrow \enquote{→} (or `$\rightarrow$`) should be used for synchronic derivations. Use \enquote{smart quotation marks}, not \'straight quotation marks\' (we recommend the csquotes package, as in this template). Either British or American English spelling is fine, as long as you are consistent. It is crucial that you spellcheck and carefully proofread your piece before submission. Use a hyphen \enquote{-} only to join together two parts of a compound (as in \enquote{affrico-palatalisation}). For number ranges (as in \enquote{1999–2002}), use an en dash \enquote{--}. For all other purposes, use an em dash \enquote{---}. + +# Heading level 2 + +Quotations of under 25 words should be included in the running text \enquote{as a wise person once said} (with an associated full reference, including page numbers). All references should follow the normal Author (date, page number) system. Longer quotations should be set out as follows, which represents the words of Bloggs (1937, 23). + + +> This is the format for a quotation of 25 words or more, with indentation of 0.7 cm throughout the quotation on both sides and a font size of 10 points (this is set up in the template) and a reference in the text above it, unless there is a good reason to give the reference elsewhere. + +All examples and anything that is not a table or figure should be given a number for reference, as normal. You can set out your examples, diagrams and other similar items in any way that you think sensible (within the general constraints of this template). We recommend the expex package for example, but you are welcome to use any others. Put the example number in brackets, but if you use subexamples the numbering is up to you. The numbers for examples should not be indented. + +```{=latex} +\ex\begin{tabular}[t]{lll} + /ɛɡzampl/ & [ɛɡzámpl̩] & `example' + \end{tabular} +\xe + +\ex\labels\begin{tabular}[t]{>{\tl}llll} % or use \pex +& /tu e/ & [tʰʉː eː] & `two a' \\ +& /tu bi/ & [tʰʉː biː] & `two b' +\end{tabular} +\xe +``` + +If you need to include translations for examples, use single quotation marks. Do not use bold or underlining anywhere in an article (apart from where required by the template in headings and the like). Use italics for linguistic examples in the running text, for the titles of publications and for any kind of emphasis. If you encounter any problems with setting out your examples and similar things, contact us for advice (pihph@\hspace{0pt}mlist.is.ed.ac.uk). + +Captions for figures and tables should be set out below the figure or table. We recommend, but do not insist, that you avoid vertical rules in your tables (we recommend the booktabs package). Otherwise, the setting of figures and tables is also up to you. Everything should be placed in your article where you would like it to appear in the published PDF. Do not place anything at the end of an article unless it clearly belongs in an appendix (that is, it consists of material that a casual reader will not want to consult, but may be of interest to specialists). You will be able to host data sets, statistical data, scripts, and the like separately (within reason) if you would like to make them available in connection with an article. Contact us if you would like to discuss this (pihph@\hspace{0pt}mlist.is.ed.ac.uk). + +\begin{figure}[h] + \centering + \rule{.1pt}{2cm} \rule{2cm}{.1pt} \rule{.1pt}{2cm} + \caption{Caption} + \label{fig:example} +\end{figure} + +# Another section + +## And another subsection + +As previously, the first line in this paragraph, under a section heading, is not indented. + +Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur? + +## And another level for headings + +Do not use more than three levels of structure. Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur? + +# Conclusion + +The following sections show the kinds of things that you might include at the end of your paper. Use the +`\section*` to produce unnumbered sections. diff --git a/inst/rmarkdown/templates/pihph/template.yaml b/inst/rmarkdown/templates/pihph/template.yaml new file mode 100644 index 000000000..a41991920 --- /dev/null +++ b/inst/rmarkdown/templates/pihph/template.yaml @@ -0,0 +1,5 @@ +name: Papers in Historical Phonology article +description: > + Template for creating an article for submission to the Papers + in Historical Phonology +create_dir: true diff --git a/man/article.Rd b/man/article.Rd index efaa28575..9a9a9c111 100644 --- a/man/article.Rd +++ b/man/article.Rd @@ -20,6 +20,7 @@ \alias{mnras_article} \alias{oup_article} \alias{peerj_article} +\alias{pihph_article} \alias{plos_article} \alias{pnas_article} \alias{sage_article} @@ -93,6 +94,8 @@ oup_article(..., keep_tex = TRUE, md_extensions = c("-autolink_bare_uris")) peerj_article(..., keep_tex = TRUE) +pihph_article(..., keep_tex = TRUE, latex_engine = "xelatex") + plos_article(..., keep_tex = TRUE, md_extensions = c("-autolink_bare_uris")) pnas_article(..., keep_tex = TRUE) @@ -232,6 +235,12 @@ custom Pandoc LaTeX template and different default values for other arguments Overleaf Template}. } +\section{\code{pihph_article}}{ + Format for creating submissions to the + Papers in Historical Phonology. Adapted from + \url{https://github.com/pihph/templates}. +} + \section{\code{plos_article}}{ Format for creating submissions to PLOS journals. Adapted from \url{https://journals.plos.org/ploscompbiol/s/latex}. diff --git a/tests/testit/test-formats.R b/tests/testit/test-formats.R index 627dc3852..8831751c8 100644 --- a/tests/testit/test-formats.R +++ b/tests/testit/test-formats.R @@ -51,6 +51,7 @@ test_format("mdpi") test_format("mnras") test_format("oup") test_format("peerj") +test_format("pihph") test_format("plos") test_format("pnas") test_format("rjournal") From d5d6951c385800078b4d4ae4eb1d697c8c9743be Mon Sep 17 00:00:00 2001 From: stefanocoretta Date: Sat, 2 Jan 2021 15:21:14 +0100 Subject: [PATCH 02/28] fix latex build failure (support older versions of pandoc) --- inst/rmarkdown/templates/pihph/resources/template.tex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/inst/rmarkdown/templates/pihph/resources/template.tex b/inst/rmarkdown/templates/pihph/resources/template.tex index 3ef79ec66..401d78806 100644 --- a/inst/rmarkdown/templates/pihph/resources/template.tex +++ b/inst/rmarkdown/templates/pihph/resources/template.tex @@ -150,11 +150,12 @@ \section*{\textcolor{pihphgreen}{Comments invited}} \setmainfont{Cambria} \setlicensefont{Calibri} \setlogofont{Lekton} -$elseif(alt-fonts)$ +$endif$ +$if(alt-fonts)$ \setmainfont{Caladea} \setlicensefont{Carlito} \setlogofont{Lekton} -$else$ +$endif$ $if(main)$ \setmainfont{$main$} $endif$ @@ -164,7 +165,6 @@ \section*{\textcolor{pihphgreen}{Comments invited}} $if(logofont)$ \setlogofont{$logofont$} $endif$ -$endif$ % If you do not have access to Cambria, you can use the metric-equivalent Caladea: https://fontlibrary.org/en/font/caladea From c068472bc41b718fd174db2ce3943f45e8c11c29 Mon Sep 17 00:00:00 2001 From: Stefano Coretta Date: Wed, 6 Jan 2021 14:25:22 +0100 Subject: [PATCH 03/28] add comment to mark pandoc highlighting code Co-authored-by: Christophe Dervieux --- inst/rmarkdown/templates/pihph/resources/template.tex | 1 + 1 file changed, 1 insertion(+) diff --git a/inst/rmarkdown/templates/pihph/resources/template.tex b/inst/rmarkdown/templates/pihph/resources/template.tex index 401d78806..4ad491702 100644 --- a/inst/rmarkdown/templates/pihph/resources/template.tex +++ b/inst/rmarkdown/templates/pihph/resources/template.tex @@ -185,6 +185,7 @@ \section*{\textcolor{pihphgreen}{Comments invited}} $if(lhs)$ \lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{} $endif$ +% Pandoc syntax highlighting $if(highlighting-macros)$ $highlighting-macros$ $endif$ From 01a16f85e8d278c6bbb938db88b07fd06367db99 Mon Sep 17 00:00:00 2001 From: Stefano Coretta Date: Wed, 6 Jan 2021 14:27:00 +0100 Subject: [PATCH 04/28] add conditional for gloss package In case user removes `gloss` in the yaml preamble. Co-authored-by: Christophe Dervieux --- inst/rmarkdown/templates/pihph/resources/template.tex | 2 ++ 1 file changed, 2 insertions(+) diff --git a/inst/rmarkdown/templates/pihph/resources/template.tex b/inst/rmarkdown/templates/pihph/resources/template.tex index 4ad491702..34e24874d 100644 --- a/inst/rmarkdown/templates/pihph/resources/template.tex +++ b/inst/rmarkdown/templates/pihph/resources/template.tex @@ -177,7 +177,9 @@ \section*{\textcolor{pihphgreen}{Comments invited}} \usepackage{polyglossia} % or use babel if desired \setmainlanguage[variant=british]{english} % or use babel if desired \usepackage[autostyle, english=british]{csquotes} % remove the english=british option for double quotes +$if(gloss)$ \usepackage{$gloss$} % for examples, feel free to use anything else +$end$ $if(listings)$ \usepackage{listings} From 6d8f4a291979b7f641b5d111249768a81ac41019 Mon Sep 17 00:00:00 2001 From: Stefano Coretta Date: Wed, 6 Jan 2021 14:27:22 +0100 Subject: [PATCH 05/28] add include-before in template Co-authored-by: Christophe Dervieux --- inst/rmarkdown/templates/pihph/resources/template.tex | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/inst/rmarkdown/templates/pihph/resources/template.tex b/inst/rmarkdown/templates/pihph/resources/template.tex index 34e24874d..002a8d487 100644 --- a/inst/rmarkdown/templates/pihph/resources/template.tex +++ b/inst/rmarkdown/templates/pihph/resources/template.tex @@ -238,6 +238,10 @@ \section*{\textcolor{pihphgreen}{Comments invited}} \end{abstract} $endif$ +$for(include-before)$ +$include-before$ +$endif$ + $body$ \commentsinvited % Please do not change this From c17dcae62368260aaf7d46f05e08aa4ca18d100d Mon Sep 17 00:00:00 2001 From: Stefano Coretta Date: Wed, 6 Jan 2021 14:29:52 +0100 Subject: [PATCH 06/28] capitalise words in template name Co-authored-by: Christophe Dervieux --- inst/rmarkdown/templates/pihph/template.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/rmarkdown/templates/pihph/template.yaml b/inst/rmarkdown/templates/pihph/template.yaml index a41991920..520ffd9cf 100644 --- a/inst/rmarkdown/templates/pihph/template.yaml +++ b/inst/rmarkdown/templates/pihph/template.yaml @@ -1,4 +1,4 @@ -name: Papers in Historical Phonology article +name: Papers in Historical Phonology Article description: > Template for creating an article for submission to the Papers in Historical Phonology From 0a481f229937f5a2308468ab6869164162b60ac8 Mon Sep 17 00:00:00 2001 From: Stefano Coretta Date: Wed, 6 Jan 2021 16:19:02 +0100 Subject: [PATCH 07/28] fix wrong closing tag in pihph template Co-authored-by: Christophe Dervieux --- inst/rmarkdown/templates/pihph/resources/template.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/rmarkdown/templates/pihph/resources/template.tex b/inst/rmarkdown/templates/pihph/resources/template.tex index 002a8d487..d27afea9f 100644 --- a/inst/rmarkdown/templates/pihph/resources/template.tex +++ b/inst/rmarkdown/templates/pihph/resources/template.tex @@ -240,7 +240,7 @@ \section*{\textcolor{pihphgreen}{Comments invited}} $for(include-before)$ $include-before$ -$endif$ +$endfor$ $body$ From eb006ee544a08f5642c8a59ef3533ca0e3db8959 Mon Sep 17 00:00:00 2001 From: stefanocoretta Date: Wed, 6 Jan 2021 14:35:29 +0100 Subject: [PATCH 08/28] include url of PiHPh journal in the function docs --- R/article.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/article.R b/R/article.R index 3ab040d0f..f14226707 100644 --- a/R/article.R +++ b/R/article.R @@ -250,7 +250,7 @@ peerj_article <- function(..., keep_tex = TRUE) { } #' @section \code{pihph_article}: Format for creating submissions to the -#' Papers in Historical Phonology. Adapted from +#' Papers in Historical Phonology (\url{http://journals.ed.ac.uk/pihph/about/submissions}). Adapted from #' \url{https://github.com/pihph/templates}. #' @export #' @rdname article From 56b22d9a033f41c5a04ba1093478d7b04283b1cd Mon Sep 17 00:00:00 2001 From: stefanocoretta Date: Wed, 6 Jan 2021 14:36:46 +0100 Subject: [PATCH 09/28] use 'mainfont' in pihph template --- inst/rmarkdown/templates/pihph/resources/template.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/rmarkdown/templates/pihph/resources/template.tex b/inst/rmarkdown/templates/pihph/resources/template.tex index d27afea9f..bc7414f39 100644 --- a/inst/rmarkdown/templates/pihph/resources/template.tex +++ b/inst/rmarkdown/templates/pihph/resources/template.tex @@ -157,7 +157,7 @@ \section*{\textcolor{pihphgreen}{Comments invited}} \setlogofont{Lekton} $endif$ $if(main)$ -\setmainfont{$main$} +\setmainfont{$mainfont$} $endif$ $if(licensefont)$ \setlicensefont{$licensefont$} From b7e91b8117d4f096b37e16c5efc204662c9c4a59 Mon Sep 17 00:00:00 2001 From: stefanocoretta Date: Wed, 6 Jan 2021 14:37:47 +0100 Subject: [PATCH 10/28] move comment about fonts in pihph template --- .../templates/pihph/resources/template.tex | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/inst/rmarkdown/templates/pihph/resources/template.tex b/inst/rmarkdown/templates/pihph/resources/template.tex index bc7414f39..b146a6e0c 100644 --- a/inst/rmarkdown/templates/pihph/resources/template.tex +++ b/inst/rmarkdown/templates/pihph/resources/template.tex @@ -151,6 +151,12 @@ \section*{\textcolor{pihphgreen}{Comments invited}} \setlicensefont{Calibri} \setlogofont{Lekton} $endif$ +% If you do not have access to Cambria, you can use the metric-equivalent Caladea: https://fontlibrary.org/en/font/caladea +% If you do not have access to Calibri, you can use the metric-equivalent Carlito: https://fontlibrary.org/en/font/carlito +% Lekton available at https://www.fontsquirrel.com/fonts/lekton + +% If any of these fonts are not available on your system, feel free to +% change them here, but of course the final layout will then differ $if(alt-fonts)$ \setmainfont{Caladea} \setlicensefont{Carlito} @@ -166,14 +172,6 @@ \section*{\textcolor{pihphgreen}{Comments invited}} \setlogofont{$logofont$} $endif$ - -% If you do not have access to Cambria, you can use the metric-equivalent Caladea: https://fontlibrary.org/en/font/caladea -% If you do not have access to Calibri, you can use the metric-equivalent Carlito: https://fontlibrary.org/en/font/carlito -% Lekton available at https://www.fontsquirrel.com/fonts/lekton - -% If any of these fonts are not available on your system, feel free to -% change them here, but of course the final layout will then differ - \usepackage{polyglossia} % or use babel if desired \setmainlanguage[variant=british]{english} % or use babel if desired \usepackage[autostyle, english=british]{csquotes} % remove the english=british option for double quotes From 2550a745aaf69bada0b2cc97a2cc45356c0f45fc Mon Sep 17 00:00:00 2001 From: stefanocoretta Date: Wed, 6 Jan 2021 14:39:12 +0100 Subject: [PATCH 11/28] move comment about default fonts in pihph template --- inst/rmarkdown/templates/pihph/resources/template.tex | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/inst/rmarkdown/templates/pihph/resources/template.tex b/inst/rmarkdown/templates/pihph/resources/template.tex index b146a6e0c..a18540b69 100644 --- a/inst/rmarkdown/templates/pihph/resources/template.tex +++ b/inst/rmarkdown/templates/pihph/resources/template.tex @@ -154,14 +154,13 @@ \section*{\textcolor{pihphgreen}{Comments invited}} % If you do not have access to Cambria, you can use the metric-equivalent Caladea: https://fontlibrary.org/en/font/caladea % If you do not have access to Calibri, you can use the metric-equivalent Carlito: https://fontlibrary.org/en/font/carlito % Lekton available at https://www.fontsquirrel.com/fonts/lekton - -% If any of these fonts are not available on your system, feel free to -% change them here, but of course the final layout will then differ $if(alt-fonts)$ \setmainfont{Caladea} \setlicensefont{Carlito} \setlogofont{Lekton} $endif$ +% If any of these default fonts are not available on your system, feel free to +% change them here, but of course the final layout will then differ $if(main)$ \setmainfont{$mainfont$} $endif$ From 75268842da95151b2456b5f57bb6542917e2eeee Mon Sep 17 00:00:00 2001 From: stefanocoretta Date: Wed, 6 Jan 2021 14:45:12 +0100 Subject: [PATCH 12/28] add pandoc citation processing code --- .../templates/pihph/resources/template.tex | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/inst/rmarkdown/templates/pihph/resources/template.tex b/inst/rmarkdown/templates/pihph/resources/template.tex index a18540b69..1a31fc3ba 100644 --- a/inst/rmarkdown/templates/pihph/resources/template.tex +++ b/inst/rmarkdown/templates/pihph/resources/template.tex @@ -220,6 +220,36 @@ \section*{\textcolor{pihphgreen}{Comments invited}} \setlength\bibsep{0pt} $endif$ +% Pandoc citation processing +$if(csl-refs)$ +\newlength{\csllabelwidth} +\setlength{\csllabelwidth}{3em} +\newlength{\cslhangindent} +\setlength{\cslhangindent}{1.5em} +% for Pandoc 2.8 to 2.10.1 +\newenvironment{cslreferences}% + {$if(csl-hanging-indent)$\setlength{\parindent}{0pt}% + \everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces$endif$}% + {\par} +% For Pandoc 2.11+ +\newenvironment{CSLReferences}[3] % #1 hanging-ident, #2 entry spacing + {% don't indent paragraphs + \setlength{\parindent}{0pt} + % turn on hanging indent if param 1 is 1 + \ifodd #1 \everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces\fi + % set entry spacing + \ifnum #2 > 0 + \setlength{\parskip}{#2\baselineskip} + \fi + }% + {} +\usepackage{calc} % for calculating minipage widths +\newcommand{\CSLBlock}[1]{#1\hfill\break} +\newcommand{\CSLLeftMargin}[1]{\parbox[t]{\csllabelwidth}{#1}} +\newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{#1}} +\newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1} +$endif$ + $for(header-includes)$ $header-includes$ $endfor$ From 4612e89d0b28e45e559ee1e6d79be4f3e61d34de Mon Sep 17 00:00:00 2001 From: stefanocoretta Date: Wed, 6 Jan 2021 14:54:45 +0100 Subject: [PATCH 13/28] fix author details in pihph template --- inst/rmarkdown/templates/pihph/resources/template.tex | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/inst/rmarkdown/templates/pihph/resources/template.tex b/inst/rmarkdown/templates/pihph/resources/template.tex index 1a31fc3ba..b0111c20f 100644 --- a/inst/rmarkdown/templates/pihph/resources/template.tex +++ b/inst/rmarkdown/templates/pihph/resources/template.tex @@ -287,18 +287,15 @@ \section*{Author's contact details} \label{sec:auth-cont-deta} $for(author)$ -$if(author.email)$ \noindent \textit{$author.name$} -\noindent $author.affiliation$ +$if(author.affiliation)$\noindent $author.affiliation$$endif$ -$if(author.address)$ +$if(author.address)$\noindent $author.address$$endif$ -\noindent $author.address$ -$endif$ +$if(author.email)$ \vspace*{5pt} \noindent \textit{$author.email$} - $endif$ $endfor$ From 68600e00581079f66b62d864e3de9c07a882c6be Mon Sep 17 00:00:00 2001 From: stefanocoretta Date: Sun, 17 Jan 2021 16:09:12 +0100 Subject: [PATCH 14/28] fix wrong if closing tag; add options for single/double quotes --- inst/rmarkdown/templates/pihph/resources/template.tex | 4 ++-- inst/rmarkdown/templates/pihph/skeleton/skeleton.Rmd | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/inst/rmarkdown/templates/pihph/resources/template.tex b/inst/rmarkdown/templates/pihph/resources/template.tex index b0111c20f..bee4c8335 100644 --- a/inst/rmarkdown/templates/pihph/resources/template.tex +++ b/inst/rmarkdown/templates/pihph/resources/template.tex @@ -173,10 +173,10 @@ \section*{\textcolor{pihphgreen}{Comments invited}} \usepackage{polyglossia} % or use babel if desired \setmainlanguage[variant=british]{english} % or use babel if desired -\usepackage[autostyle, english=british]{csquotes} % remove the english=british option for double quotes +\usepackage[autostyle$if(single-quotes)$,english=british$endif$]{csquotes} % remove the english=british option for double quotes $if(gloss)$ \usepackage{$gloss$} % for examples, feel free to use anything else -$end$ +$endif$ $if(listings)$ \usepackage{listings} diff --git a/inst/rmarkdown/templates/pihph/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/pihph/skeleton/skeleton.Rmd index 6c3342a9c..cf71b00b0 100644 --- a/inst/rmarkdown/templates/pihph/skeleton/skeleton.Rmd +++ b/inst/rmarkdown/templates/pihph/skeleton/skeleton.Rmd @@ -14,7 +14,7 @@ gloss: expex # feel free to use your preferred package for the examples default-fonts: false # set to true if you want to use the defaults fonts # The default fonts are: Cambria, Calibri, and Lekton # Lekton can be found at: https://www.fontsquirrel.com/fonts/lekton -alt-fonts: false # set to true if you want to use alternative fonts +alt-fonts: true # set to true if you want to use alternative fonts # The alternative fonts are: Caladea, Carlito, and Lekton # Caladea can be found at: https://fontlibrary.org/en/font/caladea # Carlito can be found at: https://fontlibrary.org/en/font/carlito @@ -30,6 +30,9 @@ alt-fonts: false # set to true if you want to use alternative fonts # Finally, if you'd rather use the default XeLaTeX fonts, just leave # both default-fonts and alt-fonts set to false and don't specify mainfont, # licensefont, nor logofont. +# +# To use double quotes, set single-quotes to false. +single-quotes: true abstract: | This is the template for \LaTeX{} users; we also have a Word template available, so feel free to use that if you're not into \LaTeX. All submissions to PiHPh should aim to follow the formatting set out in this template precisely, as there is no separate typesetting phase. Most styles in this template have been set up to insert the necessary white space where needed. You should use the styles that are provided in this template consistently to ensure that your submission is quickly processed. Do not change the margins or header/footer properties, including the material on this first page (such as volume, page numbers and DOI), which we will update when your submission is ready. Make sure to look at the user customization part of the preamble to this \texttt{.tex} source to change titles, running headers, bibliography etc. All the packages used here should be available in a recent version of \TeX Live. All articles should include an abstract in this position, of no more than 200 words. acknowledgements: Include any acknowledgements in an unnumbered section here, rather than in a footnote early in the paper. From 9ca8f28d52cf8af1797215533b02c082f3396d80 Mon Sep 17 00:00:00 2001 From: stefanocoretta Date: Sun, 17 Jan 2021 16:18:06 +0100 Subject: [PATCH 15/28] add missing pihph specific variables in skeleton --- inst/rmarkdown/templates/pihph/skeleton/skeleton.Rmd | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/inst/rmarkdown/templates/pihph/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/pihph/skeleton/skeleton.Rmd index cf71b00b0..d1600b8a1 100644 --- a/inst/rmarkdown/templates/pihph/skeleton/skeleton.Rmd +++ b/inst/rmarkdown/templates/pihph/skeleton/skeleton.Rmd @@ -1,12 +1,16 @@ --- title: This is a title and this is too subtitle: A subtitle goes on another line +# Use the following to specify a shorter title for the header. +title-header: A short title author: - name: Author's name affiliation: Author's affiliation email: e-mail@uni.edu - name: Second author's name (if there is one) affiliation: Second author's affiliation +# Use the following to specify a short author name for the header. +author-header: Authors output: rticles::pihph_article gloss: expex # feel free to use your preferred package for the examples # FONTS From 763df93a64a2bd245602faf98c8516b4c4fe2eaa Mon Sep 17 00:00:00 2001 From: stefanocoretta Date: Sun, 17 Jan 2021 16:18:21 +0100 Subject: [PATCH 16/28] use polyglossia in pihph article --- inst/rmarkdown/templates/pihph/resources/template.tex | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/inst/rmarkdown/templates/pihph/resources/template.tex b/inst/rmarkdown/templates/pihph/resources/template.tex index bee4c8335..a7b1608ee 100644 --- a/inst/rmarkdown/templates/pihph/resources/template.tex +++ b/inst/rmarkdown/templates/pihph/resources/template.tex @@ -171,8 +171,9 @@ \section*{\textcolor{pihphgreen}{Comments invited}} \setlogofont{$logofont$} $endif$ -\usepackage{polyglossia} % or use babel if desired -\setmainlanguage[variant=british]{english} % or use babel if desired +% Use polyglossia by default since the engine is xelatex. +\usepackage{polyglossia} +\setmainlanguage[variant=british]{english} \usepackage[autostyle$if(single-quotes)$,english=british$endif$]{csquotes} % remove the english=british option for double quotes $if(gloss)$ \usepackage{$gloss$} % for examples, feel free to use anything else From 168e8be63bd3db7bc074f7e8375178a4ec3543d1 Mon Sep 17 00:00:00 2001 From: stefanocoretta Date: Sun, 17 Jan 2021 17:06:06 +0100 Subject: [PATCH 17/28] add bib example in pihph article --- R/article.R | 7 ++- .../templates/pihph/resources/template.tex | 20 ++++---- .../templates/pihph/skeleton/sample-bib.bib | 48 +++++++++++++++++++ .../templates/pihph/skeleton/skeleton.Rmd | 13 ++++- 4 files changed, 76 insertions(+), 12 deletions(-) create mode 100644 inst/rmarkdown/templates/pihph/skeleton/sample-bib.bib diff --git a/R/article.R b/R/article.R index f14226707..cea5d9170 100644 --- a/R/article.R +++ b/R/article.R @@ -255,7 +255,12 @@ peerj_article <- function(..., keep_tex = TRUE) { #' @export #' @rdname article pihph_article <- function(..., keep_tex = TRUE, latex_engine = "xelatex") { - pdf_document_format("pihph", keep_tex = keep_tex, latex_engine = latex_engine, ...) + pdf_document_format( + "pihph", + keep_tex = keep_tex, + latex_engine = latex_engine, + citation_package = "biblatex", + ...) } #' @section \code{plos_article}: Format for creating submissions to PLOS diff --git a/inst/rmarkdown/templates/pihph/resources/template.tex b/inst/rmarkdown/templates/pihph/resources/template.tex index a7b1608ee..80479338b 100644 --- a/inst/rmarkdown/templates/pihph/resources/template.tex +++ b/inst/rmarkdown/templates/pihph/resources/template.tex @@ -214,12 +214,12 @@ \section*{\textcolor{pihphgreen}{Comments invited}} % remember to run biber rather than bibtex if using this option \AtEveryCitekey{\ifciteseen{}{\defcounter{maxnames}{99}}} $endif$ -$if(natbib)$ + % BibTeX setup, deprecated -\usepackage{natbib} -\bibpunct[:]{(}{)}{;}{a}{}{,} -\setlength\bibsep{0pt} -$endif$ +% \usepackage{natbib} +% \bibpunct[:]{(}{)}{;}{a}{}{,} +% \setlength\bibsep{0pt} + % Pandoc citation processing $if(csl-refs)$ @@ -304,12 +304,12 @@ \section*{Author's contact details} % BibLaTeX setup, recommended \printbibliography[title=References] $endif$ -$if(natbib)$ + % BibTeX setup, deprecated -\bibliographystyle{unified} % unified.bst can be obtained at http://cexlj.org/downloads/unified.bst -\renewcommand\bibsection{\section*{References}} -\bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$} -$endif$ +% \bibliographystyle{unified} % unified.bst can be obtained at http://cexlj.org/downloads/unified.bst +% \renewcommand\bibsection{\section*{References}} +%\bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$} + $for(include-after)$ $include-after$ diff --git a/inst/rmarkdown/templates/pihph/skeleton/sample-bib.bib b/inst/rmarkdown/templates/pihph/skeleton/sample-bib.bib new file mode 100644 index 000000000..68d504dae --- /dev/null +++ b/inst/rmarkdown/templates/pihph/skeleton/sample-bib.bib @@ -0,0 +1,48 @@ + + +@article{blust2009, + author = {Blust, Robert}, + journal = {Oceanic Linguistics}, + number = {2}, + pages = {307--336}, + title = {Palauan Historical Phonology: Whence the Intrusive Velar Nasal?}, + volume = {48}, + year = {2009}} + +@article{sen2016, + author = {Sen, Ranjan}, + doi = {10.2218/pihph.1.2016.1691}, + journal = {Papers in Historical Phonology}, + pages = {5--5}, + title = {Examining the life cycle of phonological processes: considerations for historical research}, + volume = {1}, + year = {2016}} + +@article{ramsammy2016, + author = {Ramsammy, Michael and Strycharczuk, Patrycja}, + doi = {10.2218/pihph.1.2016.1704}, + journal = {Papers in Historical Phonology}, + pages = {285--315}, + title = {From phonetic enhancement to phonological underspecification: hybrid voicing contrast in {European Portuguese}}, + volume = {1}, + year = {2016}} + +@book{hyman1975, + author = {Hyman, Larry M.}, + publisher = {New York: Holt, Rinehart and Winston}, + title = {Phonology: theory and analysis}, + year = {1975}} + +@book{goldsmith1990, + author = {Goldsmith, John A.}, + publisher = {Oxford: Blackwell}, + title = {Autosegmental and metrical phonology}, + year = {1990}} + +@incollection{bermudez-otero2015, + author = {Berm{\'u}dez-Otero, Ricardo}, + booktitle = {The {O}xford handbook of historical phonology}, + pages = {374--399}, + publisher = {Oxford: Oxford University Press}, + title = {Amphichronic explanation and the life cycle of phonological processes}, + year = {2015}} diff --git a/inst/rmarkdown/templates/pihph/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/pihph/skeleton/skeleton.Rmd index d1600b8a1..6b1dae253 100644 --- a/inst/rmarkdown/templates/pihph/skeleton/skeleton.Rmd +++ b/inst/rmarkdown/templates/pihph/skeleton/skeleton.Rmd @@ -37,6 +37,8 @@ alt-fonts: true # set to true if you want to use alternative fonts # # To use double quotes, set single-quotes to false. single-quotes: true +# This format uses BibLaTeX by default, as recommended by the journal. +bibliography: sample-bib.bib abstract: | This is the template for \LaTeX{} users; we also have a Word template available, so feel free to use that if you're not into \LaTeX. All submissions to PiHPh should aim to follow the formatting set out in this template precisely, as there is no separate typesetting phase. Most styles in this template have been set up to insert the necessary white space where needed. You should use the styles that are provided in this template consistently to ensure that your submission is quickly processed. Do not change the margins or header/footer properties, including the material on this first page (such as volume, page numbers and DOI), which we will update when your submission is ready. Make sure to look at the user customization part of the preamble to this \texttt{.tex} source to change titles, running headers, bibliography etc. All the packages used here should be available in a recent version of \TeX Live. All articles should include an abstract in this position, of no more than 200 words. acknowledgements: Include any acknowledgements in an unnumbered section here, rather than in a footnote early in the paper. @@ -55,7 +57,7 @@ All paragraphs other than the first in a section will be indented by 0.7cm. Make # Heading level 2 -Quotations of under 25 words should be included in the running text \enquote{as a wise person once said} (with an associated full reference, including page numbers). All references should follow the normal Author (date, page number) system. Longer quotations should be set out as follows, which represents the words of Bloggs (1937, 23). +Quotations of under 25 words should be included in the running text \enquote{as a wise person once said} (with an associated full reference, including page numbers). All references should follow the normal Author (date, page number) system. Longer quotations should be set out as follows. > This is the format for a quotation of 25 words or more, with indentation of 0.7 cm throughout the quotation on both sides and a font size of 10 points (this is set up in the template) and a reference in the text above it, unless there is a good reason to give the reference elsewhere. @@ -86,6 +88,15 @@ Captions for figures and tables should be set out below the figure or table. We \label{fig:example} \end{figure} +# Bibliography and citations + +By default, this template uses Bib\LaTeX. To learn about Bib\LaTeX, see https://www.overleaf.com/learn/latex/Articles/Getting_started_with_BibLaTeX +# for a quick intro and the package documentation for detailed info. The `langsci-unified` style is used. + +To cite a reference, you can use the standard pandoc syntax `@blust2009` for a citation without parentheses, as in @blust2009, and `[@blust2009]` with parenthesis [@blust2009]. + +These are other examples: @ramsammy2016 [p. 287], [but see @sen2016; @bermudez-otero2015]. Goldsmith is a relevant reference [-@goldsmith1990], although we should not forget @hyman1975. + # Another section ## And another subsection From 5b9c448fad6214187df3cb99617f706de9269391 Mon Sep 17 00:00:00 2001 From: stefanocoretta Date: Sun, 17 Jan 2021 17:10:55 +0100 Subject: [PATCH 18/28] add english variety option in pihph article --- inst/rmarkdown/templates/pihph/resources/template.tex | 2 +- inst/rmarkdown/templates/pihph/skeleton/skeleton.Rmd | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/inst/rmarkdown/templates/pihph/resources/template.tex b/inst/rmarkdown/templates/pihph/resources/template.tex index 80479338b..9199b9dbb 100644 --- a/inst/rmarkdown/templates/pihph/resources/template.tex +++ b/inst/rmarkdown/templates/pihph/resources/template.tex @@ -173,7 +173,7 @@ \section*{\textcolor{pihphgreen}{Comments invited}} % Use polyglossia by default since the engine is xelatex. \usepackage{polyglossia} -\setmainlanguage[variant=british]{english} +\setmainlanguage[$if(en-variant)$variant=$en-variant$$endif$]{english} \usepackage[autostyle$if(single-quotes)$,english=british$endif$]{csquotes} % remove the english=british option for double quotes $if(gloss)$ \usepackage{$gloss$} % for examples, feel free to use anything else diff --git a/inst/rmarkdown/templates/pihph/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/pihph/skeleton/skeleton.Rmd index 6b1dae253..acca7cf7c 100644 --- a/inst/rmarkdown/templates/pihph/skeleton/skeleton.Rmd +++ b/inst/rmarkdown/templates/pihph/skeleton/skeleton.Rmd @@ -34,9 +34,8 @@ alt-fonts: true # set to true if you want to use alternative fonts # Finally, if you'd rather use the default XeLaTeX fonts, just leave # both default-fonts and alt-fonts set to false and don't specify mainfont, # licensefont, nor logofont. -# -# To use double quotes, set single-quotes to false. -single-quotes: true +en-variant: british # Set to "american" for American English. +single-quotes: true # To use double quotes, set single-quotes to false. # This format uses BibLaTeX by default, as recommended by the journal. bibliography: sample-bib.bib abstract: | From fa8e40dece0cd34891dc15aad61a286831e7e440 Mon Sep 17 00:00:00 2001 From: stefanocoretta Date: Wed, 20 Jan 2021 22:07:53 +0100 Subject: [PATCH 19/28] fix fonts issue in the pihph format, other improvements --- .../templates/pihph/resources/template.tex | 20 ++----- .../templates/pihph/skeleton/skeleton.Rmd | 53 ++++++------------- man/article.Rd | 2 +- 3 files changed, 22 insertions(+), 53 deletions(-) diff --git a/inst/rmarkdown/templates/pihph/resources/template.tex b/inst/rmarkdown/templates/pihph/resources/template.tex index 9199b9dbb..ae8005a85 100644 --- a/inst/rmarkdown/templates/pihph/resources/template.tex +++ b/inst/rmarkdown/templates/pihph/resources/template.tex @@ -146,22 +146,7 @@ \section*{\textcolor{pihphgreen}{Comments invited}} \authorheader{$if(author-header)$$author-header$$else$$for(author)$$author.name$$sep$, $endfor$$endif$} \titleheader{$if(title-header)$$title-header$$else$$title$$endif$} -$if(default-fonts)$ -\setmainfont{Cambria} -\setlicensefont{Calibri} -\setlogofont{Lekton} -$endif$ -% If you do not have access to Cambria, you can use the metric-equivalent Caladea: https://fontlibrary.org/en/font/caladea -% If you do not have access to Calibri, you can use the metric-equivalent Carlito: https://fontlibrary.org/en/font/carlito -% Lekton available at https://www.fontsquirrel.com/fonts/lekton -$if(alt-fonts)$ -\setmainfont{Caladea} -\setlicensefont{Carlito} -\setlogofont{Lekton} -$endif$ -% If any of these default fonts are not available on your system, feel free to -% change them here, but of course the final layout will then differ -$if(main)$ +$if(mainfont)$ \setmainfont{$mainfont$} $endif$ $if(licensefont)$ @@ -170,6 +155,9 @@ \section*{\textcolor{pihphgreen}{Comments invited}} $if(logofont)$ \setlogofont{$logofont$} $endif$ +% If you do not have access to Cambria, you can use the metric-equivalent Caladea: https://fontlibrary.org/en/font/caladea +% If you do not have access to Calibri, you can use the metric-equivalent Carlito: https://fontlibrary.org/en/font/carlito +% Lekton available at https://www.fontsquirrel.com/fonts/lekton % Use polyglossia by default since the engine is xelatex. \usepackage{polyglossia} diff --git a/inst/rmarkdown/templates/pihph/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/pihph/skeleton/skeleton.Rmd index acca7cf7c..358e2f8ab 100644 --- a/inst/rmarkdown/templates/pihph/skeleton/skeleton.Rmd +++ b/inst/rmarkdown/templates/pihph/skeleton/skeleton.Rmd @@ -1,8 +1,11 @@ --- +output: rticles::pihph_article + title: This is a title and this is too subtitle: A subtitle goes on another line # Use the following to specify a shorter title for the header. title-header: A short title + author: - name: Author's name affiliation: Author's affiliation @@ -11,31 +14,22 @@ author: affiliation: Second author's affiliation # Use the following to specify a short author name for the header. author-header: Authors -output: rticles::pihph_article + gloss: expex # feel free to use your preferred package for the examples -# FONTS -# If default-fonts is true, alt-fonts should be set to false, and vice versa. -default-fonts: false # set to true if you want to use the defaults fonts -# The default fonts are: Cambria, Calibri, and Lekton -# Lekton can be found at: https://www.fontsquirrel.com/fonts/lekton -alt-fonts: true # set to true if you want to use alternative fonts -# The alternative fonts are: Caladea, Carlito, and Lekton -# Caladea can be found at: https://fontlibrary.org/en/font/caladea -# Carlito can be found at: https://fontlibrary.org/en/font/carlito -# Lekton can be found at: https://www.fontsquirrel.com/fonts/lekton -# -# If any of these fonts are not available on your system, feel free to -# change them here, but of course the final layout will then differ. -# Uncomment the following lines and set the chosen fonts: -# mainfont: Charis SIL -# licensefont: Arial -# logofont: Arial + +# The journal uses Cambria, Calibri, and Lekton. If you don't have access to +# Cambria and Calibri, you can use the metrically equivalent Caladea and +# Carlito. Caladea, Carlito, and Lekton are available for download: +# - Caladea: https://fontlibrary.org/en/font/caladea +# - Carlito: https://fontlibrary.org/en/font/carlito +# - Lekton: https://www.fontsquirrel.com/fonts/lekton # -# Finally, if you'd rather use the default XeLaTeX fonts, just leave -# both default-fonts and alt-fonts set to false and don't specify mainfont, -# licensefont, nor logofont. +# mainfont: Cambria # or Caladea +# licensefont: Calibri # or Carlito +# logofont: Lekton en-variant: british # Set to "american" for American English. single-quotes: true # To use double quotes, set single-quotes to false. + # This format uses BibLaTeX by default, as recommended by the journal. bibliography: sample-bib.bib abstract: | @@ -54,7 +48,7 @@ The first paragraph under all headings will not be indented.^[This is a footnote All paragraphs other than the first in a section will be indented by 0.7cm. Make sure that you use the shaftless arrow \enquote{>} for diachronic correspondences. The shafted arrow \enquote{→} (or `$\rightarrow$`) should be used for synchronic derivations. Use \enquote{smart quotation marks}, not \'straight quotation marks\' (we recommend the csquotes package, as in this template). Either British or American English spelling is fine, as long as you are consistent. It is crucial that you spellcheck and carefully proofread your piece before submission. Use a hyphen \enquote{-} only to join together two parts of a compound (as in \enquote{affrico-palatalisation}). For number ranges (as in \enquote{1999–2002}), use an en dash \enquote{--}. For all other purposes, use an em dash \enquote{---}. -# Heading level 2 +## Heading level 2 Quotations of under 25 words should be included in the running text \enquote{as a wise person once said} (with an associated full reference, including page numbers). All references should follow the normal Author (date, page number) system. Longer quotations should be set out as follows. @@ -89,25 +83,12 @@ Captions for figures and tables should be set out below the figure or table. We # Bibliography and citations -By default, this template uses Bib\LaTeX. To learn about Bib\LaTeX, see https://www.overleaf.com/learn/latex/Articles/Getting_started_with_BibLaTeX -# for a quick intro and the package documentation for detailed info. The `langsci-unified` style is used. +By default, this template uses Bib\LaTeX. To learn about Bib\LaTeX, see https://www.overleaf.com/learn/latex/Articles/Getting_started_with_BibLaTeX for a quick intro and the package documentation for detailed info. The `langsci-unified` style is used. To cite a reference, you can use the standard pandoc syntax `@blust2009` for a citation without parentheses, as in @blust2009, and `[@blust2009]` with parenthesis [@blust2009]. These are other examples: @ramsammy2016 [p. 287], [but see @sen2016; @bermudez-otero2015]. Goldsmith is a relevant reference [-@goldsmith1990], although we should not forget @hyman1975. -# Another section - -## And another subsection - -As previously, the first line in this paragraph, under a section heading, is not indented. - -Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur? - -## And another level for headings - -Do not use more than three levels of structure. Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur? - # Conclusion The following sections show the kinds of things that you might include at the end of your paper. Use the diff --git a/man/article.Rd b/man/article.Rd index 9a9a9c111..9229d1659 100644 --- a/man/article.Rd +++ b/man/article.Rd @@ -237,7 +237,7 @@ custom Pandoc LaTeX template and different default values for other arguments \section{\code{pihph_article}}{ Format for creating submissions to the - Papers in Historical Phonology. Adapted from + Papers in Historical Phonology (\url{http://journals.ed.ac.uk/pihph/about/submissions}). Adapted from \url{https://github.com/pihph/templates}. } From bafd378d1d201a11ae9ac9a521e5bc73ef199d76 Mon Sep 17 00:00:00 2001 From: stefanocoretta Date: Thu, 21 Jan 2021 17:49:25 +0100 Subject: [PATCH 20/28] remove unused variables from pihph latex template, use knitr::include_graphics() --- inst/rmarkdown/templates/pihph/resources/template.tex | 4 ++-- inst/rmarkdown/templates/pihph/skeleton/skeleton.Rmd | 9 +++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/inst/rmarkdown/templates/pihph/resources/template.tex b/inst/rmarkdown/templates/pihph/resources/template.tex index ae8005a85..015e67c07 100644 --- a/inst/rmarkdown/templates/pihph/resources/template.tex +++ b/inst/rmarkdown/templates/pihph/resources/template.tex @@ -44,7 +44,7 @@ \end{minipage} \begin{minipage}[t]{.75\linewidth} \centering - $if(logofont)$\logofont$endif$$if(default-fonts)$\logofont$endif$$if(alt-fonts)$\logofont$endif$\Large Papers in Historical Phonology\\[5pt] + $if(logofont)$\logofont$endif$\Large Papers in Historical Phonology\\[5pt] \footnotesize @@ -62,7 +62,7 @@ \centering \vspace*{-14pt} \adjustbox{valign=t}{\doclicenseImage[imagewidth=2.1cm]}\\ - $if(licensefont)$\licensefont$endif$$if(default-fonts)$\licensefont$endif$$if(alt-fonts)$\licensefont$endif$\tiny Licensed under~a \doclicenseLongNameRef{} License + $if(licensefont)$\licensefont$endif$\tiny Licensed under~a \doclicenseLongNameRef{} License \end{minipage} } diff --git a/inst/rmarkdown/templates/pihph/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/pihph/skeleton/skeleton.Rmd index 358e2f8ab..082751b8b 100644 --- a/inst/rmarkdown/templates/pihph/skeleton/skeleton.Rmd +++ b/inst/rmarkdown/templates/pihph/skeleton/skeleton.Rmd @@ -74,12 +74,9 @@ If you need to include translations for examples, use single quotation marks. Do Captions for figures and tables should be set out below the figure or table. We recommend, but do not insist, that you avoid vertical rules in your tables (we recommend the booktabs package). Otherwise, the setting of figures and tables is also up to you. Everything should be placed in your article where you would like it to appear in the published PDF. Do not place anything at the end of an article unless it clearly belongs in an appendix (that is, it consists of material that a casual reader will not want to consult, but may be of interest to specialists). You will be able to host data sets, statistical data, scripts, and the like separately (within reason) if you would like to make them available in connection with an article. Contact us if you would like to discuss this (pihph@\hspace{0pt}mlist.is.ed.ac.uk). -\begin{figure}[h] - \centering - \rule{.1pt}{2cm} \rule{2cm}{.1pt} \rule{.1pt}{2cm} - \caption{Caption} - \label{fig:example} -\end{figure} +```{r example, fig.cap="Caption", fig.align='center'} +knitr::include_graphics("pihph-logo.png") +``` # Bibliography and citations From 3909d626f3d44961f3060ff5afada79e6f4c5780 Mon Sep 17 00:00:00 2001 From: christophe dervieux Date: Tue, 9 Feb 2021 13:45:17 +0100 Subject: [PATCH 21/28] style --- R/article.R | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/R/article.R b/R/article.R index cea5d9170..86f04ee5d 100644 --- a/R/article.R +++ b/R/article.R @@ -256,11 +256,8 @@ peerj_article <- function(..., keep_tex = TRUE) { #' @rdname article pihph_article <- function(..., keep_tex = TRUE, latex_engine = "xelatex") { pdf_document_format( - "pihph", - keep_tex = keep_tex, - latex_engine = latex_engine, - citation_package = "biblatex", - ...) + "pihph", keep_tex = keep_tex, latex_engine = latex_engine, + citation_package = "biblatex", ...) } #' @section \code{plos_article}: Format for creating submissions to PLOS From 8cb691b02a8374f3d391f04eb19a33f8e9e587d1 Mon Sep 17 00:00:00 2001 From: christophe dervieux Date: Tue, 9 Feb 2021 13:47:11 +0100 Subject: [PATCH 22/28] Add the shortname in template --- inst/rmarkdown/templates/pihph/template.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/rmarkdown/templates/pihph/template.yaml b/inst/rmarkdown/templates/pihph/template.yaml index 520ffd9cf..a934c23a1 100644 --- a/inst/rmarkdown/templates/pihph/template.yaml +++ b/inst/rmarkdown/templates/pihph/template.yaml @@ -1,4 +1,4 @@ -name: Papers in Historical Phonology Article +name: Papers in Historical Phonology Article (pihph) description: > Template for creating an article for submission to the Papers in Historical Phonology From 26bdf817c4adb05956d82eaafe1c3c8742989530 Mon Sep 17 00:00:00 2001 From: christophe dervieux Date: Tue, 9 Feb 2021 13:49:35 +0100 Subject: [PATCH 23/28] Use correct case in short name --- inst/rmarkdown/templates/pihph/template.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/rmarkdown/templates/pihph/template.yaml b/inst/rmarkdown/templates/pihph/template.yaml index a934c23a1..d96fb18b7 100644 --- a/inst/rmarkdown/templates/pihph/template.yaml +++ b/inst/rmarkdown/templates/pihph/template.yaml @@ -1,4 +1,4 @@ -name: Papers in Historical Phonology Article (pihph) +name: Papers in Historical Phonology Article (PiHPh) description: > Template for creating an article for submission to the Papers in Historical Phonology From 3019f9987a70ba63bb17d4287167c93ba6caf372 Mon Sep 17 00:00:00 2001 From: christophe dervieux Date: Tue, 9 Feb 2021 13:53:09 +0100 Subject: [PATCH 24/28] Also set citation package has an argument keeping biblatex as default --- R/article.R | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/R/article.R b/R/article.R index a80102db4..00b78e6a8 100644 --- a/R/article.R +++ b/R/article.R @@ -268,10 +268,13 @@ peerj_article <- function(..., keep_tex = TRUE) { #' \url{https://github.com/pihph/templates}. #' @export #' @rdname article -pihph_article <- function(..., keep_tex = TRUE, latex_engine = "xelatex") { +pihph_article <- function( + ..., keep_tex = TRUE, latex_engine = "xelatex", + citation_package = "biblatex" +) { pdf_document_format( "pihph", keep_tex = keep_tex, latex_engine = latex_engine, - citation_package = "biblatex", ...) + citation_package = citation_package, ...) } #' @section \code{plos_article}: Format for creating submissions to PLOS From c123158febae25752b2fb752bf405e4f55e3f49f Mon Sep 17 00:00:00 2001 From: christophe dervieux Date: Tue, 9 Feb 2021 13:54:05 +0100 Subject: [PATCH 25/28] Add PR number to README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 487b7ca9c..e5478ba07 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ Currently included templates and their contributors are the following: | [MNRAS: Monthly Notices of the Royal Astronomical Society](https://academic.oup.com/mnras) | [@oleskiewicz](https://github.com/oleskiewicz) | [#175](https://github.com/rstudio/rticles/pull/175) | `mnras_article()` | | [OUP: Oxford University Press](https://academic.oup.com/journals/pages/authors/preparing_your_manuscript) | [@dmkaplan](https://github.com/dmkaplan) | [#284](https://github.com/rstudio/rticles/pull/284) | `oup_articles()` | | [PeerJ: Journal of Life and Environmental Sciences](https://peerj.com) | [@zkamvar](https://github.com/zkamvar) | [#127](https://github.com/rstudio/rticles/pull/127) | `peerj_article()` | -| [PiHPh: Papers in Historical Phonology](http://journals.ed.ac.uk/pihph/about/submissions) | [@stefanocoretta](https://github.com/stefanocoretta) | | `pihph_article()` | +| [PiHPh: Papers in Historical Phonology](http://journals.ed.ac.uk/pihph/about/submissions) | [@stefanocoretta](https://github.com/stefanocoretta) | [#362](https://github.com/rstudio/rticles/pull/362) | `pihph_article()` | | [PLOS](https://plos.org/#journals) | [@sjmgarnier](https://github.com/sjmgarnier) | [#12](https://github.com/rstudio/rticles/pull/12) | `plos_article()` | | [PNAS: Proceedings of the National Academy of Sciences](https://www.pnas.org/) | [@cboettig](https://github.com/cboettig) | [#72](https://github.com/rstudio/rticles/pull/72) | `pnas_article()` | | [RSOS: Royal Society Open Science](https://www.royalsocietypublishing.org/journal/rsos) | [@ThierryO](https://github.com/ThierryO) | [#135](https://github.com/rstudio/rticles/pull/135) | `rsos_article()` | From 548d23f8b72a313be11c6db4f38d96e4f3ff53aa Mon Sep 17 00:00:00 2001 From: christophe dervieux Date: Tue, 9 Feb 2021 13:57:09 +0100 Subject: [PATCH 26/28] Document default behavoir for this format --- R/article.R | 11 ++++++++--- man/article.Rd | 18 ++++++++++++++---- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/R/article.R b/R/article.R index 00b78e6a8..d9eb80f09 100644 --- a/R/article.R +++ b/R/article.R @@ -263,9 +263,14 @@ peerj_article <- function(..., keep_tex = TRUE) { pdf_document_format("peerj", keep_tex = keep_tex, ...) } -#' @section \code{pihph_article}: Format for creating submissions to the -#' Papers in Historical Phonology (\url{http://journals.ed.ac.uk/pihph/about/submissions}). Adapted from -#' \url{https://github.com/pihph/templates}. +#' @section \code{pihph_article}: Format for creating submissions to the Papers +#' in Historical Phonology +#' (\url{http://journals.ed.ac.uk/pihph/about/submissions}). Adapted from +#' \url{https://github.com/pihph/templates}. This format works well with +#' \code{latex_engine = "xelatex"} and \code{citation_package="biblatex"}, +#' which are the default. It may not work correctly if you change these value. +#' In that case, please open an issue and, a PR to contribute a change in the +#' template. #' @export #' @rdname article pihph_article <- function( diff --git a/man/article.Rd b/man/article.Rd index b42d34974..0082d7629 100644 --- a/man/article.Rd +++ b/man/article.Rd @@ -102,7 +102,12 @@ oup_article(..., keep_tex = TRUE, md_extensions = c("-autolink_bare_uris")) peerj_article(..., keep_tex = TRUE) -pihph_article(..., keep_tex = TRUE, latex_engine = "xelatex") +pihph_article( + ..., + keep_tex = TRUE, + latex_engine = "xelatex", + citation_package = "biblatex" +) plos_article(..., keep_tex = TRUE, md_extensions = c("-autolink_bare_uris")) @@ -250,9 +255,14 @@ custom Pandoc LaTeX template and different default values for other arguments } \section{\code{pihph_article}}{ - Format for creating submissions to the - Papers in Historical Phonology (\url{http://journals.ed.ac.uk/pihph/about/submissions}). Adapted from - \url{https://github.com/pihph/templates}. + Format for creating submissions to the Papers + in Historical Phonology + (\url{http://journals.ed.ac.uk/pihph/about/submissions}). Adapted from + \url{https://github.com/pihph/templates}. This format works well with + \code{latex_engine = "xelatex"} and \code{citation_package="biblatex"}, + which are the default. It may not work correctly if you change these value. + In that case, please open an issue and, a PR to contribute a change in the + template. } \section{\code{plos_article}}{ From 544ea4cc0c6d6d5a9a990c511d6eeea06e007222 Mon Sep 17 00:00:00 2001 From: christophe dervieux Date: Tue, 9 Feb 2021 13:58:13 +0100 Subject: [PATCH 27/28] we prefer output as last part of the YAML as other template --- inst/rmarkdown/templates/pihph/skeleton/skeleton.Rmd | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/inst/rmarkdown/templates/pihph/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/pihph/skeleton/skeleton.Rmd index 082751b8b..f0c87fb78 100644 --- a/inst/rmarkdown/templates/pihph/skeleton/skeleton.Rmd +++ b/inst/rmarkdown/templates/pihph/skeleton/skeleton.Rmd @@ -1,6 +1,4 @@ --- -output: rticles::pihph_article - title: This is a title and this is too subtitle: A subtitle goes on another line # Use the following to specify a shorter title for the header. @@ -36,6 +34,7 @@ abstract: | This is the template for \LaTeX{} users; we also have a Word template available, so feel free to use that if you're not into \LaTeX. All submissions to PiHPh should aim to follow the formatting set out in this template precisely, as there is no separate typesetting phase. Most styles in this template have been set up to insert the necessary white space where needed. You should use the styles that are provided in this template consistently to ensure that your submission is quickly processed. Do not change the margins or header/footer properties, including the material on this first page (such as volume, page numbers and DOI), which we will update when your submission is ready. Make sure to look at the user customization part of the preamble to this \texttt{.tex} source to change titles, running headers, bibliography etc. All the packages used here should be available in a recent version of \TeX Live. All articles should include an abstract in this position, of no more than 200 words. acknowledgements: Include any acknowledgements in an unnumbered section here, rather than in a footnote early in the paper. supplement: If you would like to post any data sets, statistical data, scripts or similar material that links to your article, you can include a description of it all at the end of the paper. +output: rticles::pihph_article --- ```{r setup, include=FALSE} From 7c24ad994d6bf14bf8e3269a6ba7f426433feacd Mon Sep 17 00:00:00 2001 From: christophe dervieux Date: Tue, 9 Feb 2021 14:22:12 +0100 Subject: [PATCH 28/28] add comments and order as in the template --- .../templates/pihph/skeleton/skeleton.Rmd | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/inst/rmarkdown/templates/pihph/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/pihph/skeleton/skeleton.Rmd index f0c87fb78..4741e4381 100644 --- a/inst/rmarkdown/templates/pihph/skeleton/skeleton.Rmd +++ b/inst/rmarkdown/templates/pihph/skeleton/skeleton.Rmd @@ -1,7 +1,8 @@ --- title: This is a title and this is too subtitle: A subtitle goes on another line -# Use the following to specify a shorter title for the header. +# Use the following to specify a shorter title for the header. +# If not set, the title will be used. title-header: A short title author: @@ -10,26 +11,29 @@ author: email: e-mail@uni.edu - name: Second author's name (if there is one) affiliation: Second author's affiliation -# Use the following to specify a short author name for the header. +# Use the following to specify a short author name for the header. If not set, +# it will use the authors' name author-header: Authors -gloss: expex # feel free to use your preferred package for the examples - # The journal uses Cambria, Calibri, and Lekton. If you don't have access to # Cambria and Calibri, you can use the metrically equivalent Caladea and # Carlito. Caladea, Carlito, and Lekton are available for download: # - Caladea: https://fontlibrary.org/en/font/caladea # - Carlito: https://fontlibrary.org/en/font/carlito # - Lekton: https://www.fontsquirrel.com/fonts/lekton -# +# # mainfont: Cambria # or Caladea # licensefont: Calibri # or Carlito # logofont: Lekton + en-variant: british # Set to "american" for American English. single-quotes: true # To use double quotes, set single-quotes to false. +# for the example, feel free to use your preferred package for glosses or comment. +gloss: expex # This format uses BibLaTeX by default, as recommended by the journal. bibliography: sample-bib.bib + abstract: | This is the template for \LaTeX{} users; we also have a Word template available, so feel free to use that if you're not into \LaTeX. All submissions to PiHPh should aim to follow the formatting set out in this template precisely, as there is no separate typesetting phase. Most styles in this template have been set up to insert the necessary white space where needed. You should use the styles that are provided in this template consistently to ensure that your submission is quickly processed. Do not change the margins or header/footer properties, including the material on this first page (such as volume, page numbers and DOI), which we will update when your submission is ready. Make sure to look at the user customization part of the preamble to this \texttt{.tex} source to change titles, running headers, bibliography etc. All the packages used here should be available in a recent version of \TeX Live. All articles should include an abstract in this position, of no more than 200 words. acknowledgements: Include any acknowledgements in an unnumbered section here, rather than in a footnote early in the paper.