Skip to content

Commit 8d68165

Browse files
Stefano Corettacderv
andauthored
add pihph_article() (#362)
Co-authored-by: Christophe Dervieux <christophe.dervieux@gmail.com>
1 parent 72d5f02 commit 8d68165

File tree

11 files changed

+496
-0
lines changed

11 files changed

+496
-0
lines changed

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export(mdpi_article)
2626
export(mnras_article)
2727
export(oup_article)
2828
export(peerj_article)
29+
export(pihph_article)
2930
export(plos_article)
3031
export(pnas_article)
3132
export(rjournal_article)

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ rticles 0.19
22
---------------------------------------------------------------------
33
- Update Copernicus Publications template to version 6.2 from 2021-01-15 (thanks, @RLumSK, #366).
44

5+
- Add article template `pihph_article()` for the *Papers in Historical Phonology* (PiHPh) (thanks, @stefanocoretta, #362).
6+
57
rticles 0.18
68
---------------------------------------------------------------------
79

R/article.R

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,25 @@ peerj_article <- function(..., keep_tex = TRUE) {
263263
pdf_document_format("peerj", keep_tex = keep_tex, ...)
264264
}
265265

266+
#' @section \code{pihph_article}: Format for creating submissions to the Papers
267+
#' in Historical Phonology
268+
#' (\url{http://journals.ed.ac.uk/pihph/about/submissions}). Adapted from
269+
#' \url{https://github.com/pihph/templates}. This format works well with
270+
#' \code{latex_engine = "xelatex"} and \code{citation_package="biblatex"},
271+
#' which are the default. It may not work correctly if you change these value.
272+
#' In that case, please open an issue and, a PR to contribute a change in the
273+
#' template.
274+
#' @export
275+
#' @rdname article
276+
pihph_article <- function(
277+
..., keep_tex = TRUE, latex_engine = "xelatex",
278+
citation_package = "biblatex"
279+
) {
280+
pdf_document_format(
281+
"pihph", keep_tex = keep_tex, latex_engine = latex_engine,
282+
citation_package = citation_package, ...)
283+
}
284+
266285
#' @section \code{plos_article}: Format for creating submissions to PLOS
267286
#' journals. Adapted from \url{https://journals.plos.org/ploscompbiol/s/latex}.
268287
#' @export

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ Currently included templates and their contributors are the following:
4949
| [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()` |
5050
| [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()` |
5151
| [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()` |
52+
| [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()` |
5253
| [PLOS](https://plos.org/#journals) | [@sjmgarnier](https://github.com/sjmgarnier) | [#12](https://github.com/rstudio/rticles/pull/12) | `plos_article()` |
5354
| [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()` |
5455
| [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()` |
Lines changed: 305 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,305 @@
1+
% === GO TO THE USER CUSTOMIZATION SECTION TO MAKE CHANGES
2+
3+
\documentclass[article, a4paper, 12pt, $for(classoption)$$classoption$$sep$,$endfor$]{memoir}
4+
5+
% Please use XeLaTeX to compile
6+
7+
\usepackage{xltxtra}
8+
\defaultfontfeatures{Ligatures=TeX}
9+
\usepackage{hyphenat}
10+
11+
\newcommand\setlogofont[1]{\newfontfamily\logofont{#1}}
12+
\newcommand\setlicensefont[1]{\newfontfamily\licensefont{#1}}
13+
\usepackage{microtype}
14+
\usepackage{rotating}
15+
\usepackage{hyperxmp}
16+
\usepackage[colorlinks=true, unicode=true, breaklinks=true, linkcolor=black, urlcolor=blue, citecolor=black]{hyperref}
17+
18+
\counterwithout{section}{chapter}
19+
\setsecnumdepth{subsubsection}
20+
\setcounter{tocdepth}{3}
21+
22+
\usepackage[export]{adjustbox}
23+
\usepackage{graphicx}
24+
\usepackage[type={CC}, modifier={by}, version=4.0]{doclicense}
25+
26+
\newcommand\affiliation[1]{{\normalfont\normalsize\itshape#1}}
27+
28+
\pagestyle{simple}
29+
\makeevenfoot{simple}{}{}{}
30+
\makeoddfoot{simple}{}{}{}
31+
\raggedbottom
32+
33+
\newcommand\authorheader[1]{\makeevenhead{simple}{\footnotesize\itshape#1}{}{\footnotesize\thepage}}
34+
\newcommand\titleheader[1]{\makeoddhead{simple}{\footnotesize\thepage}{}{\footnotesize\itshape#1}}
35+
36+
\newcommand\thisdoi{10.2218/pihph.201x.x.xxxx}
37+
\newcommand\thisdoilink{http://dx.doi.org/\thisdoi}
38+
39+
\renewcommand{\maketitlehooka}{%
40+
\vspace*{-60pt}
41+
\noindent\hspace*{-25pt}\begin{minipage}[t]{2.5cm}
42+
\vspace*{-16pt}
43+
\includegraphics[valign=t, width=2.5cm]{pihph-logo.png}
44+
\end{minipage}
45+
\begin{minipage}[t]{.75\linewidth}
46+
\centering
47+
$if(logofont)$\logofont$endif$\Large Papers in Historical Phonology\\[5pt]
48+
49+
\footnotesize
50+
51+
http://journals.ed.ac.uk/pihph
52+
53+
ISSN 2399-6714
54+
55+
\footnotesize\vspace*{5pt}
56+
57+
Volume 1, \thepage--\thelastpage
58+
59+
DOI: \thisdoi
60+
\end{minipage}
61+
\begin{minipage}[t]{2.1cm}
62+
\centering
63+
\vspace*{-14pt}
64+
\adjustbox{valign=t}{\doclicenseImage[imagewidth=2.1cm]}\\
65+
$if(licensefont)$\licensefont$endif$\tiny Licensed under~a \doclicenseLongNameRef{} License
66+
\end{minipage}
67+
}
68+
69+
\pretitle{\vspace*{24pt}\begin{center}\large\bfseries}
70+
\preauthor{\begin{center}\large\scshape\begin{tabular}[t]{c}}
71+
\postauthor{\end{tabular}\end{center}\vspace*{12pt}}
72+
73+
\predate{\relax}
74+
\postdate{\relax}
75+
\date{}
76+
77+
\captionnamefont{\footnotesize\bfseries}
78+
\captiontitlefont{\footnotesize}
79+
80+
\renewcommand\abstractnamefont{\normalfont\footnotesize\bfseries}
81+
\renewcommand\abstracttextfont{\normalfont\footnotesize}
82+
\setlength\absleftindent{1cm}
83+
\setlength\absrightindent{1cm}
84+
\setlength{\abstitleskip}{-17pt}
85+
\setbeforesecskip{-18pt}
86+
\setaftersecskip{6pt}
87+
\setsecheadstyle{\normalfont\bfseries}
88+
\setbeforesubsecskip{-18pt}
89+
\setaftersubsecskip{6pt}
90+
\setsubsecheadstyle{\normalfont\bfseries}
91+
\setbeforesubsubsecskip{-18pt}
92+
\setaftersubsubsecskip{6pt}
93+
\setsubsubsecheadstyle{\normalfont\bfseries}
94+
\renewenvironment{quote}{\list{}{\leftmargin=0.7cm\rightmargin=0.7cm}\item[]\footnotesize}{\endlist}
95+
96+
\setlrmarginsandblock{4cm}{4cm}{*}
97+
\setulmarginsandblock{4.5cm}{4.5cm}{*}
98+
\checkandfixthelayout
99+
100+
\setlength{\footmarkwidth}{0em}
101+
\setlength{\footmarksep}{0em}
102+
\footmarkstyle{\textsuperscript{#1}\hspace{.3em}}
103+
\setfootins{24pt}{\bigskipamount}
104+
\renewcommand*{\footnoterule}{%
105+
\kern-3pt%
106+
\hrule width 0.4\columnwidth
107+
\kern 2.6pt
108+
\vspace{12pt}}
109+
110+
\usepackage[usenames]{xcolor}
111+
\definecolor{pihphgreen}{RGB}{118, 146, 60}
112+
\usepackage[most]{tcolorbox}
113+
114+
\newtcolorbox{tcdoublebox}[1][]{%
115+
enhanced jigsaw,
116+
sharp corners,
117+
colback=white,
118+
text width=.95\textwidth,
119+
before={\vspace*{18pt}\noindent},
120+
left skip=-5mm,
121+
borderline={1pt}{-2pt}{black},
122+
#1
123+
}
124+
125+
\newcommand\commentsinvited{
126+
\begin{tcdoublebox}
127+
128+
\section*{\textcolor{pihphgreen}{Comments invited}}
129+
130+
\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:
131+
132+
\vspace*{1ex}\noindent \url{\thisdoilink}
133+
134+
\end{tcdoublebox}
135+
}
136+
137+
\widowpenalty=10000
138+
\clubpenalty=10000
139+
140+
% === START OF USER CUSTOMIZATION
141+
142+
143+
\title{$title$$if(subtitle)$:\\$subtitle$$endif$}
144+
\author{$for(author)$$author.name$\\\affiliation{$author.affiliation$}$sep$ \and $endfor$}
145+
146+
\authorheader{$if(author-header)$$author-header$$else$$for(author)$$author.name$$sep$, $endfor$$endif$}
147+
\titleheader{$if(title-header)$$title-header$$else$$title$$endif$}
148+
149+
$if(mainfont)$
150+
\setmainfont{$mainfont$}
151+
$endif$
152+
$if(licensefont)$
153+
\setlicensefont{$licensefont$}
154+
$endif$
155+
$if(logofont)$
156+
\setlogofont{$logofont$}
157+
$endif$
158+
% If you do not have access to Cambria, you can use the metric-equivalent Caladea: https://fontlibrary.org/en/font/caladea
159+
% If you do not have access to Calibri, you can use the metric-equivalent Carlito: https://fontlibrary.org/en/font/carlito
160+
% Lekton available at https://www.fontsquirrel.com/fonts/lekton
161+
162+
% Use polyglossia by default since the engine is xelatex.
163+
\usepackage{polyglossia}
164+
\setmainlanguage[$if(en-variant)$variant=$en-variant$$endif$]{english}
165+
\usepackage[autostyle$if(single-quotes)$,english=british$endif$]{csquotes} % remove the english=british option for double quotes
166+
$if(gloss)$
167+
\usepackage{$gloss$} % for examples, feel free to use anything else
168+
$endif$
169+
170+
$if(listings)$
171+
\usepackage{listings}
172+
$endif$
173+
$if(lhs)$
174+
\lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{}
175+
$endif$
176+
% Pandoc syntax highlighting
177+
$if(highlighting-macros)$
178+
$highlighting-macros$
179+
$endif$
180+
$if(verbatim-in-note)$
181+
\usepackage{fancyvrb}
182+
\VerbatimFootnotes % allows verbatim text in footnotes
183+
$endif$
184+
185+
% Some recommended packages
186+
187+
\usepackage{booktabs} % for nice tables
188+
189+
$if(biblatex)$
190+
% BibLaTeX setup, recommended
191+
\usepackage[backend=biber,
192+
style=langsci-unified, % available on CTAN
193+
mincrossrefs=50,
194+
maxcitenames=3,
195+
maxbibnames=50,
196+
useprefix=true,
197+
doi=false]{biblatex}
198+
$for(bibliography)$
199+
\addbibresource{$bibliography$}
200+
$endfor$
201+
% remember to include the .bib extension
202+
% remember to run biber rather than bibtex if using this option
203+
\AtEveryCitekey{\ifciteseen{}{\defcounter{maxnames}{99}}}
204+
$endif$
205+
206+
% BibTeX setup, deprecated
207+
% \usepackage{natbib}
208+
% \bibpunct[:]{(}{)}{;}{a}{}{,}
209+
% \setlength\bibsep{0pt}
210+
211+
212+
% Pandoc citation processing
213+
$if(csl-refs)$
214+
\newlength{\csllabelwidth}
215+
\setlength{\csllabelwidth}{3em}
216+
\newlength{\cslhangindent}
217+
\setlength{\cslhangindent}{1.5em}
218+
% for Pandoc 2.8 to 2.10.1
219+
\newenvironment{cslreferences}%
220+
{$if(csl-hanging-indent)$\setlength{\parindent}{0pt}%
221+
\everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces$endif$}%
222+
{\par}
223+
% For Pandoc 2.11+
224+
\newenvironment{CSLReferences}[3] % #1 hanging-ident, #2 entry spacing
225+
{% don't indent paragraphs
226+
\setlength{\parindent}{0pt}
227+
% turn on hanging indent if param 1 is 1
228+
\ifodd #1 \everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces\fi
229+
% set entry spacing
230+
\ifnum #2 > 0
231+
\setlength{\parskip}{#2\baselineskip}
232+
\fi
233+
}%
234+
{}
235+
\usepackage{calc} % for calculating minipage widths
236+
\newcommand{\CSLBlock}[1]{#1\hfill\break}
237+
\newcommand{\CSLLeftMargin}[1]{\parbox[t]{\csllabelwidth}{#1}}
238+
\newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{#1}}
239+
\newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1}
240+
$endif$
241+
242+
$for(header-includes)$
243+
$header-includes$
244+
$endfor$
245+
246+
\begin{document}
247+
\setcounter{page}{1}
248+
\maketitle
249+
\thispagestyle{empty}
250+
251+
$if(abstract)$
252+
\begin{abstract}
253+
\noindent $abstract$
254+
\end{abstract}
255+
$endif$
256+
257+
$for(include-before)$
258+
$include-before$
259+
$endfor$
260+
261+
$body$
262+
263+
\commentsinvited % Please do not change this
264+
265+
$if(acknowledgements)$
266+
\section*{Acknowledgements}
267+
$acknowledgements$
268+
$endif$
269+
270+
$if(supplement)$
271+
\section*{Associated material}
272+
$supplement$
273+
$endif$
274+
275+
\section*{Author's contact details}
276+
\label{sec:auth-cont-deta}
277+
278+
$for(author)$
279+
\noindent \textit{$author.name$}
280+
281+
$if(author.affiliation)$\noindent $author.affiliation$$endif$
282+
283+
$if(author.address)$\noindent $author.address$$endif$
284+
285+
$if(author.email)$
286+
\vspace*{5pt}
287+
\noindent \textit{$author.email$}
288+
$endif$
289+
$endfor$
290+
291+
$if(biblatex)$
292+
% BibLaTeX setup, recommended
293+
\printbibliography[title=References]
294+
$endif$
295+
296+
% BibTeX setup, deprecated
297+
% \bibliographystyle{unified} % unified.bst can be obtained at http://cexlj.org/downloads/unified.bst
298+
% \renewcommand\bibsection{\section*{References}}
299+
%\bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$}
300+
301+
302+
$for(include-after)$
303+
$include-after$
304+
$endfor$
305+
\end{document}
7.05 KB
Loading

0 commit comments

Comments
 (0)