Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add pihph_article() #362

Merged
merged 29 commits into from
Feb 9, 2021
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
e3a21dc
add pihph_article()
Dec 26, 2020
d5d6951
fix latex build failure (support older versions of pandoc)
Jan 2, 2021
c068472
add comment to mark pandoc highlighting code
Jan 6, 2021
01a16f8
add conditional for gloss package
Jan 6, 2021
6d8f4a2
add include-before in template
Jan 6, 2021
c17dcae
capitalise words in template name
Jan 6, 2021
0a481f2
fix wrong closing tag in pihph template
Jan 6, 2021
eb006ee
include url of PiHPh journal in the function docs
Jan 6, 2021
56b22d9
use 'mainfont' in pihph template
Jan 6, 2021
b7e91b8
move comment about fonts in pihph template
Jan 6, 2021
2550a74
move comment about default fonts in pihph template
Jan 6, 2021
7526884
add pandoc citation processing code
Jan 6, 2021
4612e89
fix author details in pihph template
Jan 6, 2021
68600e0
fix wrong if closing tag; add options for single/double quotes
Jan 17, 2021
9ca8f28
add missing pihph specific variables in skeleton
Jan 17, 2021
763df93
use polyglossia in pihph article
Jan 17, 2021
168e8be
add bib example in pihph article
Jan 17, 2021
5b9c448
add english variety option in pihph article
Jan 17, 2021
fa8e40d
fix fonts issue in the pihph format, other improvements
Jan 20, 2021
bafd378
remove unused variables from pihph latex template, use knitr::include…
Jan 21, 2021
3909d62
style
cderv Feb 9, 2021
8cb691b
Add the shortname in template
cderv Feb 9, 2021
284b993
Merge branch 'master' into pihph-article
cderv Feb 9, 2021
26bdf81
Use correct case in short name
cderv Feb 9, 2021
3019f99
Also set citation package has an argument keeping biblatex as default
cderv Feb 9, 2021
c123158
Add PR number to README
cderv Feb 9, 2021
548d23f
Document default behavoir for this format
cderv Feb 9, 2021
544ea4c
we prefer output as last part of the YAML as other template
cderv Feb 9, 2021
7c24ad9
add comments and order as in the template
cderv Feb 9, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
---------------------------------------------------------------------

Expand Down
9 changes: 9 additions & 0 deletions R/article.R
Original file line number Diff line number Diff line change
Expand Up @@ -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}.
stefanocoretta marked this conversation as resolved.
Show resolved Hide resolved
#' @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
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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()` |
Expand Down
292 changes: 292 additions & 0 deletions inst/rmarkdown/templates/pihph/resources/template.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,292 @@
% === 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}
$endif$
$if(alt-fonts)$
\setmainfont{Caladea}
\setlicensefont{Carlito}
\setlogofont{Lekton}
$endif$
$if(main)$
\setmainfont{$main$}
stefanocoretta marked this conversation as resolved.
Show resolved Hide resolved
$endif$
$if(licensefont)$
\setlicensefont{$licensefont$}
$endif$
$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
stefanocoretta marked this conversation as resolved.
Show resolved Hide resolved

% 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
stefanocoretta marked this conversation as resolved.
Show resolved Hide resolved

\usepackage{polyglossia} % or use babel if desired
\setmainlanguage[variant=british]{english} % or use babel if desired
stefanocoretta marked this conversation as resolved.
Show resolved Hide resolved
\usepackage[autostyle, english=british]{csquotes} % remove the english=british option for double quotes
stefanocoretta marked this conversation as resolved.
Show resolved Hide resolved
$if(gloss)$
\usepackage{$gloss$} % for examples, feel free to use anything else
stefanocoretta marked this conversation as resolved.
Show resolved Hide resolved
$end$
stefanocoretta marked this conversation as resolved.
Show resolved Hide resolved

$if(listings)$
\usepackage{listings}
$endif$
$if(lhs)$
\lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{}
$endif$
% Pandoc syntax highlighting
$if(highlighting-macros)$
$highlighting-macros$
$endif$
stefanocoretta marked this conversation as resolved.
Show resolved Hide resolved
$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$

stefanocoretta marked this conversation as resolved.
Show resolved Hide resolved
$for(header-includes)$
$header-includes$
$endfor$

\begin{document}
\setcounter{page}{1}
\maketitle
\thispagestyle{empty}

$if(abstract)$
\begin{abstract}
\noindent $abstract$
\end{abstract}
$endif$

stefanocoretta marked this conversation as resolved.
Show resolved Hide resolved
$for(include-before)$
$include-before$
$endif$
stefanocoretta marked this conversation as resolved.
Show resolved Hide resolved

$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$
stefanocoretta marked this conversation as resolved.
Show resolved Hide resolved

$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}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading