Skip to content

Commit f5cee5c

Browse files
committed
getting ready
1 parent b9029fd commit f5cee5c

6 files changed

Lines changed: 59 additions & 33 deletions

File tree

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Package: stevetemplates
22
Type: Package
33
Title: Steve's R Markdown Templates
44
Depends: R (>= 3.5.0)
5-
Version: 1.3.0
5+
Version: 1.3.9
66
Authors@R: person("Steven", "Miller",
77
email = "steve@svmiller.com",
88
role = c("aut", "cre"),

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# stevetemplates 1.4.0
22

3+
- `article2` and `article3` will likely be superseded going forward in favor of their Quarto equivalents.
4+
- `article2` renames `sansitup` to be `acmsans`.
5+
- `article2` functionality copied from Quarto template, except for how authors and affiliations are handled. That's one limitation in R Markdown.
6+
- Skeleton example of `article2` changed.
37
- `article2` and `article3` have fixes for use of `endfloat` package in LaTeX. Additionally, `endfloat` must be declared as argument in YAML and is honored only when `anonymous: TRUE`.
48
- Assorted documentation changes for clarity.
59

R/article2.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
#' | `appendix` | optional, but specifies appendix figure/table prefices |
3131
#' | `endnotes` | logical, defaults to `FALSE`. If `TRUE`, makes R Markdown footnotes as endnotes |
3232
#' | `pandocparas` | logical, defaults to `FALSE`. If `TRUE`, keeps Pandoc's default paragraph format |
33-
#' | `sansitup` | logical, defaults to `FALSE`. If `TRUE`, better mimics ACM's use of sans fonts for section headers |
33+
#' | `acmsans` | logical, defaults to `FALSE`. If `TRUE`, better mimics ACM's use of sans fonts for section headers |
3434
#' | `mainfont` | optional (I think?), but it's the main font to use with `xelatex`. I use `cochineal` here. |
35-
#' | `sansfont` | optional, only necessary if `sansitup: TRUE`. Specifies sans font. I recommend Linux Biolinum |
35+
#' | `sansfont` | optional, only necessary if `sansitup: TRUE`. Specifies sans font. I recommend Linux Biolinum or Libertinus Sans |
3636
#' | `doublespacing` | optional, if anything is here to process, this will double-space the document. |
3737
#' | `endfloat` | logical, defaults to `FALSE`. If `TRUE`, figures/tables moved to back of document with "Figure/Table about here" placeholder text. Observed only when `anonymous: TRUE` and depends on figure/table captions. |
3838

inst/rmarkdown/templates/article2/resources/template.tex

Lines changed: 46 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@
464464
% \vskip 2em%
465465
% \begin{center}%
466466
\let \footnote \thanks
467-
$if(sansitup)$
467+
$if(acmsans)$
468468
{\fontsize{14.5}{20}\selectfont\bfseries\sffamily\raggedright \setlength{\parindent}{0pt} \@title \par}%
469469
$else$
470470
{\fontsize{18}{20}\selectfont\raggedright \setlength{\parindent}{0pt} \@title \par}
@@ -475,16 +475,16 @@
475475

476476

477477
$if(title)$
478-
\title{$title$$if(subtitle)$: $subtitle$$endif$$if(anonymous)$$else$$if(thanks)$\thanks{$thanks$} $endif$$endif$ }
478+
\title{$title$$if(title-subtitle)$$if(subtitle)$: $subtitle$$endif$$else$$endif$$if(anonymous)$$else$$if(thanks)$\thanks{$thanks$} $endif$$endif$ }
479479
$endif$
480480

481481
\date{}
482482

483483
\usepackage{titlesec}
484484

485-
% $if(sansitup)$\sffamily\uppercase$else$$endif$
486-
\titleformat*{\section}{\large\bfseries$if(sansitup)$\sffamily\uppercase$else$$endif$}
487-
\titleformat*{\subsection}{$if(sansitup)$\bfseries\sffamily$else$\normalsize\itshape$endif$} % \small\uppercase
485+
% $if(acmsans)$\sffamily\uppercase$else$$endif$
486+
\titleformat*{\section}{\large\bfseries$if(acmsans)$\sffamily\uppercase$else$$endif$}
487+
\titleformat*{\subsection}{$if(acmsans)$\bfseries\sffamily$else$\normalsize\itshape$endif$} % \small\uppercase
488488
\titleformat*{\subsubsection}{\normalsize\itshape}
489489
\titleformat*{\paragraph}{\normalsize\itshape}
490490
\titleformat*{\subparagraph}{\normalsize\itshape}
@@ -505,7 +505,7 @@
505505
unicode=false, % unicode breaks when used with xetex
506506
xetex]{hyperref}
507507
\else
508-
\PassOptionsToPackage{hyphens}{url}\usepackage[draft,unicode=true]{hyperref}
508+
\PassOptionsToPackage{hyphens}{url}\usepackage[unicode=true]{hyperref}
509509
\fi
510510
}
511511

@@ -555,12 +555,6 @@
555555
\def\fps@figure{htbp}
556556
\makeatother
557557

558-
559-
560-
$for(header-includes)$
561-
$header-includes$
562-
$endfor$
563-
564558
\newtheorem{hypothesis}{Hypothesis}
565559

566560
$if(doublespacing)$
@@ -571,6 +565,16 @@
571565
% trick for moving figures to back of document
572566
% really wish we'd knock this shit off with moving tables/figures to back of document
573567
% but, alas...
568+
569+
570+
\usepackage{longtable}
571+
\LTcapwidth=.95\textwidth
572+
\linespread{1.05}
573+
574+
$for(header-includes)$
575+
$header-includes$
576+
$endfor$
577+
574578
$if(anonymous)$ % begin anonymous-if
575579
$if(endfloat)$ % begin endfloat-if...
576580
\usepackage[notablist,nofiglist]{endfloat}
@@ -591,8 +595,22 @@
591595
$endif$ % end endfloat-if
592596
$endif$ % end anonymous-if
593597

594-
% DOCUMENT BEGINS NOW...
598+
% This is for cases where the document has a minimal appendix included at the
599+
% end. I would discourage users from doing too much with appendices in this
600+
% case. However, it works fine if the appendix is just supposed to be a simple
601+
% table or two. In cases where the appendix is much longer, it makes sense to
602+
% make it a separate document.
603+
604+
\newcommand{\beginappendix}{
605+
\renewcommand{\thesection}{A}
606+
\setcounter{table}{0}
607+
\renewcommand{\thetable}{A.\arabic{table}}
608+
\setcounter{figure}{0}
609+
\renewcommand{\thefigure}{A.\arabic{figure}}
610+
}
595611

612+
613+
% DOCUMENT BEGINS NOW...
596614
\begin{document}
597615

598616
% \textsf{\textbf{This is sans-serif bold text.}}
@@ -609,15 +627,16 @@
609627
\thispagestyle{plain}
610628
{%\fontsize{18}{20}\selectfont\raggedright
611629
\maketitle % title \par
612-
613630
}
614631

615-
616-
632+
$if(title-subtitle)$
633+
$else$
634+
$if(subtitle)$\emph{$subtitle$}$endif$
635+
$endif$
617636

618637
{
619638
\vskip 13.5pt\relax \normalsize\fontsize{11}{12}
620-
$if(sansitup)$
639+
$if(acmsans)$
621640
$if(anonymous)$\hfill $else$$for(author)$\MakeUppercase{\textsf{\large $author.name$}}, \small{$author.affiliation$} $sep$ \par $endfor$ $endif$
622641
$else$
623642
$if(anonymous)$\hfill $else$$for(author)$\MakeUppercase{$author.name$}, \small{$author.affiliation$} $sep$ \par \vskip -3.5pt $endfor$ $endif$
@@ -645,23 +664,20 @@
645664
\noindent \small{$abstract$}
646665

647666
$if(keywords)$
648-
649667
\vskip 8.5pt \noindent \emph{Keywords}: $keywords$ \par
650-
651-
% \hbox{\vrule height .2pt width 39.14pc}
652-
653-
654668
$else$
669+
$endif$
655670

656-
% \hbox{\vrule height .2pt width 39.14pc}
657-
671+
$if(paper-info)$
672+
$for(paper-info)$$paper-info$$sep$\vspace{1pt}\par
673+
$endfor$
658674
$endif$
659675

660676
\end{abstract}
661677

662678
$endif$
663679

664-
\vskip -8.5pt
680+
\vskip 8.5pt
665681

666682
$if(toc)$
667683
{
@@ -725,6 +741,11 @@
725741
% Remember to cut it out later before bib
726742
$body$
727743

744+
$if(endnotes)$
745+
\newpage
746+
\theendnotes
747+
$endif$
748+
728749
$if(has-frontmatter)$
729750
\backmatter
730751
$endif$

inst/rmarkdown/templates/article2/skeleton/skeleton.Rmd

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ output:
55
dev: cairo_pdf
66
keep_tex: true
77
biblio-style: apsr
8-
title: "Another Pandoc Markdown Article Starter and Template"
8+
title: "They Should Not Be Rebooting *Murder, She Wrote*"
99
thanks: "Replication files are available on the author's Github account (http://github.com/svmiller/svm-r-markdown-templates). **Current version**: `r format(Sys.time(), '%B %d, %Y')`; **Corresponding author**: steven.v.miller@gmail.com."
1010
author:
1111
- name: Steven V. Miller
@@ -14,7 +14,8 @@ author:
1414
affiliation: The Ohio State University
1515
- name: A Graduate Student
1616
affiliation: University of Alabama
17-
abstract: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sit amet libero justo. Pellentesque eget nibh ex. Aliquam tincidunt egestas lectus id ullamcorper. Proin tellus orci, posuere sed cursus at, bibendum ac odio. Nam consequat non ante eget aliquam. Nulla facilisis tincidunt elit. Nunc hendrerit pellentesque quam, eu imperdiet ipsum porttitor ut. Interdum et malesuada fames ac ante ipsum primis in faucibus. Suspendisse potenti. Duis vitae nibh mauris. Duis nec sem sit amet ante dictum mattis. Suspendisse diam velit, maximus eget commodo at, faucibus et nisi. Ut a pellentesque eros, sit amet suscipit eros. Nunc tincidunt quis risus suscipit vestibulum. Quisque eu fringilla massa."
17+
abstract: "
18+
They should not be [rebooting *Murder, She Wrote*](https://www.theguardian.com/film/2026/mar/25/jamie-lee-curtis-murder-she-wrote-reboot). That show was wonderful; truly one of mankind's greatest artistic achievements. However, some things are just a moment in time that you can't get back and trying to get them back is just lazily reheating intellectual property for dinner. This is *Murder, She Wrote*, not baked ziti. The idea that 1) a book writer can 2) live in apparently the murder (per capita) capital of the world, 3) moonlight as a detective, 4) actively interfere with police investigations, and 5) somehow coerce confessions *every single time* from people who do not know how to keep their damn mouth shut is just something that does not age well today. Viewers expect forensic evidence that was almost never acknowledged on that show. Plus, Jamie Lee Curtis is probably okay but she's no Angela Lansbury. There is no actor befitting William Windom's role of Dr. Seth Hazlitt. Just, please, don't. Do something else."
1819
keywords: "pandoc, r markdown, knitr"
1920
date: "`r format(Sys.time(), '%B %d, %Y')`"
2021
geometry: margin=1in
@@ -24,7 +25,7 @@ fontsize: 11pt
2425
# doublespacing: TRUE
2526
endnote: no
2627
# pandocparas: TRUE
27-
sansitup: FALSE
28+
acmsans: FALSE
2829
header-includes:
2930
- \usepackage{longtable}
3031
- \LTcapwidth=.95\textwidth

man/article2.Rd

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)