Skip to content

Commit 5d1b9fd

Browse files
committed
Modified Rjournal.sty to allow either \abstract or \begin{abstract}..\end{abstract}
1 parent 64b13e5 commit 5d1b9fd

File tree

5 files changed

+97
-103
lines changed

5 files changed

+97
-103
lines changed

inst/paper-with-errors/RJournal.sty

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,35 @@
22
% Copyright (C) 2010 by the R Foundation
33
% Copyright (C) 2013 by the R Journal
44
%
5-
% Originally written by Kurt Hornik and Friedrich Leisch with subsequent
5+
% Originally written by Kurt Hornik and Friedrich Leisch with subsequent
66
% edits by the editorial board
77
%
88
% CAUTION:
99
% Do not modify this style file. Any changes to this file will be reset when your
1010
% article is submitted.
11-
% If you must modify the style or add LaTeX packages to the article, these
11+
% If you must modify the style or add LaTeX packages to the article, these
1212
% should be specified in RJwrapper.tex
1313

1414
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
15-
\ProvidesPackage{RJournal}[2022/06/27 v0.14 RJournal package]
15+
\ProvidesPackage{RJournal}[2025/05/07 v0.15 RJournal package]
1616

1717
\RequirePackage{tikz}
1818

1919
% Overall page layout, fonts etc -----------------------------------------------
2020

2121
% Issues of of \emph{The R Journal} are created from the standard \LaTeX{}
22-
% document class \pkg{report}.
22+
% document class \pkg{report}.
2323

2424
\RequirePackage{geometry}
25-
\geometry{a4paper,
25+
\geometry{a4paper,
2626
textwidth=14cm, top=1cm, bottom=1cm,
2727
includehead,includefoot,centering,
2828
footskip=1.5cm}
2929
\raggedbottom
3030

3131
\RequirePackage{fancyhdr}
3232
\fancyhead{}
33-
\fancyheadoffset{2cm}
33+
\fancyheadoffset{2cm}
3434
\fancyhead[L]{\textsc{\RJ@sectionhead}}
3535
\fancyhead[R]{\thepage}
3636
\fancyfoot{}
@@ -39,7 +39,7 @@
3939
\pagestyle{fancy}
4040

4141
% We use the following fonts (all with T1 encoding):
42-
%
42+
%
4343
% rm & palatino
4444
% tt & inconsolata
4545
% sf & helvetica
@@ -97,33 +97,31 @@
9797
\renewcommand{\title} [1]{\def\RJ@title{#1}}
9898
\newcommand {\subtitle} [1]{\def\RJ@subtitle{#1}}
9999

100-
% Control appearance of titles: make slightly smaller than usual, and
100+
% Control appearance of titles: make slightly smaller than usual, and
101101
% suppress section numbering. See http://tex.stackexchange.com/questions/69749
102-
% for why we don't use \setcounter{secnumdepth}{-1}
102+
% for why we don't use \setcounter{secnumdepth}{-1}
103103

104104
\usepackage[medium]{titlesec}
105105
\usepackage{titletoc}
106106
\titleformat{\section} {\normalfont\large\bfseries}{\arabic{section}}{1em}{}
107-
\titleformat{\subsection}{\normalfont\normalsize\bfseries}{}{0em}{}
107+
\titleformat{\subsection}{\normalfont\normalsize\bfseries}{\arabic{section}.\arabic{subsection}}{0.5em}{}
108108
\titlecontents{chapter} [0em]{}{}{}{\titlerule*[1em]{.}\contentspage}
109109

110110
% Article layout ---------------------------------------------------------------
111111

112-
% Environment |article| clears the article header information at its beginning.
112+
% Environment |article| clears the article header information at its beginning.
113113
% We use |\FloatBarrier| from the placeins package to keep floats within
114114
% the article.
115115
\RequirePackage{placeins}
116-
\newenvironment{article}{\author{}\title{}\subtitle{}\FloatBarrier}{\FloatBarrier}
116+
\newenvironment{article}{\author{}\title{}\subtitle{}\FloatBarrier\setstretch{1}\small{\FloatBarrier}
117+
% RJH: Added \setstretch{1}\small above. This was previously inside \abstract
118+
% but was never turned off, so it set the style for the whole paper.
117119

118120
% Refereed articles should have an abstract, so we redefine |\abstract| to
119121
% give the desired style
120122

121-
\renewcommand{\abstract}[1]{%
122-
\setstretch{1}%
123-
\noindent%
124-
\small%
125-
\textbf{Abstract} #1
126-
}
123+
\renewcommand{\abstract}[1]{\noindent\textbf{Abstract} #1}
124+
\renewenvironment{abstract}{\noindent\textbf{Abstract}~}{}
127125

128126
% The real work is done by a redefined version of |\maketitle|. Note
129127
% that even though we do not want chapters (articles) numbered, we
@@ -173,13 +171,14 @@
173171
}
174172

175173
% We want bibliographies as starred sections within articles.
176-
%
174+
%
177175
\RequirePackage[sectionbib,round]{natbib}
178176
\bibliographystyle{abbrvnat}
177+
\renewcommand{\bibsection}{\section*{References}}
179178

180179
% Equations, figures and tables are counted within articles, but we do
181180
% not show the article number. For equations it becomes a bit messy to avoid
182-
% having hyperref getting it wrong.
181+
% having hyperref getting it wrong.
183182

184183
% \numberwithin{equation}{chapter}
185184
\renewcommand{\theequation}{\@arabic\c@equation}
@@ -209,7 +208,7 @@
209208
\fontsize{50pt}{50pt}\selectfont
210209
The \raisebox{-8pt}{\includegraphics[height=77pt]{Rlogo-5}}\hspace{10pt}
211210
Journal
212-
211+
213212
\end{center}
214213
{\large \hfill Volume \RJ@volume/\RJ@number, \RJ@month{} \RJ@year \quad}
215214

inst/rmarkdown/templates/rjournal/skeleton/RJournal.sty

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,35 @@
22
% Copyright (C) 2010 by the R Foundation
33
% Copyright (C) 2013 by the R Journal
44
%
5-
% Originally written by Kurt Hornik and Friedrich Leisch with subsequent
5+
% Originally written by Kurt Hornik and Friedrich Leisch with subsequent
66
% edits by the editorial board
77
%
88
% CAUTION:
99
% Do not modify this style file. Any changes to this file will be reset when your
1010
% article is submitted.
11-
% If you must modify the style or add LaTeX packages to the article, these
11+
% If you must modify the style or add LaTeX packages to the article, these
1212
% should be specified in RJwrapper.tex
1313

1414
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
15-
\ProvidesPackage{RJournal}[2022/06/27 v0.14 RJournal package]
15+
\ProvidesPackage{RJournal}[2025/05/07 v0.15 RJournal package]
1616

1717
\RequirePackage{tikz}
1818

1919
% Overall page layout, fonts etc -----------------------------------------------
2020

2121
% Issues of of \emph{The R Journal} are created from the standard \LaTeX{}
22-
% document class \pkg{report}.
22+
% document class \pkg{report}.
2323

2424
\RequirePackage{geometry}
25-
\geometry{a4paper,
25+
\geometry{a4paper,
2626
textwidth=14cm, top=1cm, bottom=1cm,
2727
includehead,includefoot,centering,
2828
footskip=1.5cm}
2929
\raggedbottom
3030

3131
\RequirePackage{fancyhdr}
3232
\fancyhead{}
33-
\fancyheadoffset{2cm}
33+
\fancyheadoffset{2cm}
3434
\fancyhead[L]{\textsc{\RJ@sectionhead}}
3535
\fancyhead[R]{\thepage}
3636
\fancyfoot{}
@@ -39,7 +39,7 @@
3939
\pagestyle{fancy}
4040

4141
% We use the following fonts (all with T1 encoding):
42-
%
42+
%
4343
% rm & palatino
4444
% tt & inconsolata
4545
% sf & helvetica
@@ -97,33 +97,31 @@
9797
\renewcommand{\title} [1]{\def\RJ@title{#1}}
9898
\newcommand {\subtitle} [1]{\def\RJ@subtitle{#1}}
9999

100-
% Control appearance of titles: make slightly smaller than usual, and
100+
% Control appearance of titles: make slightly smaller than usual, and
101101
% suppress section numbering. See http://tex.stackexchange.com/questions/69749
102-
% for why we don't use \setcounter{secnumdepth}{-1}
102+
% for why we don't use \setcounter{secnumdepth}{-1}
103103

104104
\usepackage[medium]{titlesec}
105105
\usepackage{titletoc}
106106
\titleformat{\section} {\normalfont\large\bfseries}{\arabic{section}}{1em}{}
107-
\titleformat{\subsection}{\normalfont\normalsize\bfseries}{}{0em}{}
107+
\titleformat{\subsection}{\normalfont\normalsize\bfseries}{\arabic{section}.\arabic{subsection}}{0.5em}{}
108108
\titlecontents{chapter} [0em]{}{}{}{\titlerule*[1em]{.}\contentspage}
109109

110110
% Article layout ---------------------------------------------------------------
111111

112-
% Environment |article| clears the article header information at its beginning.
112+
% Environment |article| clears the article header information at its beginning.
113113
% We use |\FloatBarrier| from the placeins package to keep floats within
114114
% the article.
115115
\RequirePackage{placeins}
116-
\newenvironment{article}{\author{}\title{}\subtitle{}\FloatBarrier}{\FloatBarrier}
116+
\newenvironment{article}{\author{}\title{}\subtitle{}\FloatBarrier\setstretch{1}\small{\FloatBarrier}
117+
% RJH: Added \setstretch{1}\small above. This was previously inside \abstract
118+
% but was never turned off, so it set the style for the whole paper.
117119

118120
% Refereed articles should have an abstract, so we redefine |\abstract| to
119121
% give the desired style
120122

121-
\renewcommand{\abstract}[1]{%
122-
\setstretch{1}%
123-
\noindent%
124-
\small%
125-
\textbf{Abstract} #1
126-
}
123+
\renewcommand{\abstract}[1]{\noindent\textbf{Abstract} #1}
124+
\renewenvironment{abstract}{\noindent\textbf{Abstract}~}{}
127125

128126
% The real work is done by a redefined version of |\maketitle|. Note
129127
% that even though we do not want chapters (articles) numbered, we
@@ -173,13 +171,14 @@
173171
}
174172

175173
% We want bibliographies as starred sections within articles.
176-
%
174+
%
177175
\RequirePackage[sectionbib,round]{natbib}
178176
\bibliographystyle{abbrvnat}
177+
\renewcommand{\bibsection}{\section*{References}}
179178

180179
% Equations, figures and tables are counted within articles, but we do
181180
% not show the article number. For equations it becomes a bit messy to avoid
182-
% having hyperref getting it wrong.
181+
% having hyperref getting it wrong.
183182

184183
% \numberwithin{equation}{chapter}
185184
\renewcommand{\theequation}{\@arabic\c@equation}
@@ -209,7 +208,7 @@
209208
\fontsize{50pt}{50pt}\selectfont
210209
The \raisebox{-8pt}{\includegraphics[height=77pt]{Rlogo-5}}\hspace{10pt}
211210
Journal
212-
211+
213212
\end{center}
214213
{\large \hfill Volume \RJ@volume/\RJ@number, \RJ@month{} \RJ@year \quad}
215214

inst/sample-article/RJournal.sty

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,35 @@
22
% Copyright (C) 2010 by the R Foundation
33
% Copyright (C) 2013 by the R Journal
44
%
5-
% Originally written by Kurt Hornik and Friedrich Leisch with subsequent
5+
% Originally written by Kurt Hornik and Friedrich Leisch with subsequent
66
% edits by the editorial board
77
%
88
% CAUTION:
99
% Do not modify this style file. Any changes to this file will be reset when your
1010
% article is submitted.
11-
% If you must modify the style or add LaTeX packages to the article, these
11+
% If you must modify the style or add LaTeX packages to the article, these
1212
% should be specified in RJwrapper.tex
1313

1414
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
15-
\ProvidesPackage{RJournal}[2022/06/27 v0.14 RJournal package]
15+
\ProvidesPackage{RJournal}[2025/05/07 v0.15 RJournal package]
1616

1717
\RequirePackage{tikz}
1818

1919
% Overall page layout, fonts etc -----------------------------------------------
2020

2121
% Issues of of \emph{The R Journal} are created from the standard \LaTeX{}
22-
% document class \pkg{report}.
22+
% document class \pkg{report}.
2323

2424
\RequirePackage{geometry}
25-
\geometry{a4paper,
25+
\geometry{a4paper,
2626
textwidth=14cm, top=1cm, bottom=1cm,
2727
includehead,includefoot,centering,
2828
footskip=1.5cm}
2929
\raggedbottom
3030

3131
\RequirePackage{fancyhdr}
3232
\fancyhead{}
33-
\fancyheadoffset{2cm}
33+
\fancyheadoffset{2cm}
3434
\fancyhead[L]{\textsc{\RJ@sectionhead}}
3535
\fancyhead[R]{\thepage}
3636
\fancyfoot{}
@@ -39,7 +39,7 @@
3939
\pagestyle{fancy}
4040

4141
% We use the following fonts (all with T1 encoding):
42-
%
42+
%
4343
% rm & palatino
4444
% tt & inconsolata
4545
% sf & helvetica
@@ -97,9 +97,9 @@
9797
\renewcommand{\title} [1]{\def\RJ@title{#1}}
9898
\newcommand {\subtitle} [1]{\def\RJ@subtitle{#1}}
9999

100-
% Control appearance of titles: make slightly smaller than usual, and
100+
% Control appearance of titles: make slightly smaller than usual, and
101101
% suppress section numbering. See http://tex.stackexchange.com/questions/69749
102-
% for why we don't use \setcounter{secnumdepth}{-1}
102+
% for why we don't use \setcounter{secnumdepth}{-1}
103103

104104
\usepackage[medium]{titlesec}
105105
\usepackage{titletoc}
@@ -109,21 +109,19 @@
109109

110110
% Article layout ---------------------------------------------------------------
111111

112-
% Environment |article| clears the article header information at its beginning.
112+
% Environment |article| clears the article header information at its beginning.
113113
% We use |\FloatBarrier| from the placeins package to keep floats within
114114
% the article.
115115
\RequirePackage{placeins}
116-
\newenvironment{article}{\author{}\title{}\subtitle{}\FloatBarrier}{\FloatBarrier}
116+
\newenvironment{article}{\author{}\title{}\subtitle{}\FloatBarrier\setstretch{1}\small{\FloatBarrier}
117+
% RJH: Added \setstretch{1}\small above. This was previously inside \abstract
118+
% but was never turned off, so it set the style for the whole paper.
117119

118120
% Refereed articles should have an abstract, so we redefine |\abstract| to
119121
% give the desired style
120122

121-
\renewcommand{\abstract}[1]{%
122-
\setstretch{1}%
123-
\noindent%
124-
\small%
125-
\textbf{Abstract} #1
126-
}
123+
\renewcommand{\abstract}[1]{\noindent\textbf{Abstract} #1}
124+
\renewenvironment{abstract}{\noindent\textbf{Abstract}~}{}
127125

128126
% The real work is done by a redefined version of |\maketitle|. Note
129127
% that even though we do not want chapters (articles) numbered, we
@@ -173,13 +171,14 @@
173171
}
174172

175173
% We want bibliographies as starred sections within articles.
176-
%
174+
%
177175
\RequirePackage[sectionbib,round]{natbib}
178176
\bibliographystyle{abbrvnat}
177+
\renewcommand{\bibsection}{\section*{References}}
179178

180179
% Equations, figures and tables are counted within articles, but we do
181180
% not show the article number. For equations it becomes a bit messy to avoid
182-
% having hyperref getting it wrong.
181+
% having hyperref getting it wrong.
183182

184183
% \numberwithin{equation}{chapter}
185184
\renewcommand{\theequation}{\@arabic\c@equation}
@@ -209,7 +208,7 @@
209208
\fontsize{50pt}{50pt}\selectfont
210209
The \raisebox{-8pt}{\includegraphics[height=77pt]{Rlogo-5}}\hspace{10pt}
211210
Journal
212-
211+
213212
\end{center}
214213
{\large \hfill Volume \RJ@volume/\RJ@number, \RJ@month{} \RJ@year \quad}
215214

0 commit comments

Comments
 (0)