From 0d434033ec03b3875cfbc05f3b87936af777bef5 Mon Sep 17 00:00:00 2001 From: Scott Kostyshak Date: Thu, 16 May 2013 22:40:10 -0400 Subject: [PATCH] Add a layout and template for the R Journal Patch by Yihui Xie. --- lib/layouts/RJournal.layout | 63 ++++++ lib/templates/RJournal.lyx | 439 ++++++++++++++++++++++++++++++++++++ 2 files changed, 502 insertions(+) create mode 100644 lib/layouts/RJournal.layout create mode 100644 lib/templates/RJournal.lyx diff --git a/lib/layouts/RJournal.layout b/lib/layouts/RJournal.layout new file mode 100644 index 0000000000..6f11bc0f73 --- /dev/null +++ b/lib/layouts/RJournal.layout @@ -0,0 +1,63 @@ +# \DeclareLaTeXClass[report,RJournal.sty,booktabs.sty,natbib.sty]{report (R Journal)} + +Format 35 + +Input stdclass.inc + +Provides natbib-internal 1 + +ClassOptions + Other a4paper +End + +DefaultModule knitr + +AddToPreamble + \usepackage{RJournal} + \usepackage[round]{natbib} + \bibliographystyle{abbrvnat} + \usepackage{booktabs} + + % use Schunk, Sinput and Soutput environments defined by RJournal + <>= + render_sweave() + set_header(highlight = '') + knit_hooks$set(document = hook_rjournal) + @ + + \fancyhf{} + \fancyhead[LO,RE]{\textsc{Contributed Article}} + \fancyhead[RO,LE]{\thepage} + \fancyfoot[L]{The R Journal Vol. X/Y, Month, Year} + \fancyfoot[R]{ISSN 2073-4859} +EndPreamble + +InsetLayout "Flex:Abstract" + LabelString "Abstract" + LatexType Command + LaTexName abstract + LyXType Custom + LabelFont + Color latex + EndFont +End + +InsetLayout "Flex:Address" + LabelString "Address" + LatexType Command + LaTexName address + LyXType Custom + LabelFont + Color latex + EndFont +End + +InsetLayout "Flex:Email" + LabelString "Email" + LatexType Command + LaTexName email + LyXType Custom + LabelFont + Color latex + EndFont +End diff --git a/lib/templates/RJournal.lyx b/lib/templates/RJournal.lyx new file mode 100644 index 0000000000..558dfd0aa5 --- /dev/null +++ b/lib/templates/RJournal.lyx @@ -0,0 +1,439 @@ +#LyX 2.0 created this file. For more info see http://www.lyx.org/ +\lyxformat 413 +\begin_document +\begin_header +\textclass RJournal +\use_default_options true +\begin_modules +knitr +\end_modules +\maintain_unincluded_children false +\language english +\language_package none +\inputencoding auto +\fontencoding global +\font_roman default +\font_sans default +\font_typewriter default +\font_default_family default +\use_non_tex_fonts false +\font_sc false +\font_osf false +\font_sf_scale 100 +\font_tt_scale 100 + +\graphics default +\default_output_format default +\output_sync 0 +\bibtex_command default +\index_command default +\paperfontsize default +\spacing single +\use_hyperref false +\papersize default +\use_geometry false +\use_amsmath 1 +\use_esint 1 +\use_mhchem 1 +\use_mathdots 1 +\cite_engine natbib_authoryear +\use_bibtopic false +\use_indices false +\paperorientation portrait +\suppress_date false +\use_refstyle 1 +\index Index +\shortcut idx +\color #008000 +\end_index +\secnumdepth 3 +\tocdepth 3 +\paragraph_separation indent +\paragraph_indentation default +\quotes_language english +\papercolumns 1 +\papersides 1 +\paperpagestyle default +\tracking_changes false +\output_changes false +\html_math_output 0 +\html_css_as_file 0 +\html_be_strict false +\end_header + +\begin_body + +\begin_layout Standard +\begin_inset Note Note +status open + +\begin_layout Plain Layout +You have to put the body of your article inside the +\begin_inset Quotes eld +\end_inset + +article +\begin_inset Quotes erd +\end_inset + + enviroment defined by RJournal.sty. +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset ERT +status collapsed + +\begin_layout Plain Layout + + +\backslash +begin{article} +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset ERT +status open + +\begin_layout Plain Layout + +<>= +\end_layout + +\begin_layout Plain Layout + +render_sweave() # use Schunk, Sinput and Soutput environments defined by + RJournal +\end_layout + +\begin_layout Plain Layout + +set_header(highlight = '') # no need to +\backslash +usepackage{Sweave} +\end_layout + +\begin_layout Plain Layout + +@ +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Title +Capitalized Title Here +\end_layout + +\begin_layout Author +by Author A and Author B +\end_layout + +\begin_layout Standard +\begin_inset Flex Abstract +status open + +\begin_layout Plain Layout +An abstract of less than 150 words. +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Section +Section title in sentence case +\end_layout + +\begin_layout Standard +Write something here. + A sample citation is +\begin_inset CommandInset citation +LatexCommand citet +key "Lam94" + +\end_inset + +. +\end_layout + +\begin_layout Section +R code chunks +\end_layout + +\begin_layout Standard +Press +\family sans +Ctrl+L +\family default + and input R code chunks which will be compiled by the +\series bold +knitr +\series default + package ( +\begin_inset Flex URL +status collapsed + +\begin_layout Plain Layout + +http://yihui.name/knitr/ +\end_layout + +\end_inset + +). +\end_layout + +\begin_layout Standard +\begin_inset ERT +status open + +\begin_layout Plain Layout + +<>= +\end_layout + +\begin_layout Plain Layout + +x=1:10 +\end_layout + +\begin_layout Plain Layout + +rev(x) +\end_layout + +\begin_layout Plain Layout + +summary(x) +\end_layout + +\begin_layout Plain Layout + +@ +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +You can also plot your data; see Figure +\begin_inset CommandInset ref +LatexCommand ref +reference "fig:sample-figure" + +\end_inset + + for example. +\end_layout + +\begin_layout Standard +\begin_inset Float figure +placement tbph +wide false +sideways false +status open + +\begin_layout Plain Layout +\begin_inset ERT +status open + +\begin_layout Plain Layout + +<>= +\end_layout + +\begin_layout Plain Layout + +par(mar = c(4,4,.1,.1)) +\end_layout + +\begin_layout Plain Layout + +plot(x, pch=19, col=1:10) +\end_layout + +\begin_layout Plain Layout + +@ +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Plain Layout +\begin_inset Caption + +\begin_layout Plain Layout +A sample figure. +\begin_inset CommandInset label +LatexCommand label +name "fig:sample-figure" + +\end_inset + + +\end_layout + +\end_inset + + +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Note Note +status open + +\begin_layout Plain Layout +When you insert BibTeX bibliography here, do not use any bib styles. + The R Journal has declared the style to be +\begin_inset Quotes eld +\end_inset + +abbrvnat +\begin_inset Quotes erd +\end_inset + +. +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset CommandInset bibtex +LatexCommand bibtex +bibfiles "biblio" + +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Flex Address +status collapsed + +\begin_layout Plain Layout +Author A +\begin_inset Newline newline +\end_inset + +Press Ctrl+Enter to input +\begin_inset Newline newline +\end_inset + +address here +\end_layout + +\end_inset + + +\begin_inset Newline newline +\end_inset + + +\begin_inset Flex Email +status collapsed + +\begin_layout Plain Layout +author.a@email +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Flex Address +status collapsed + +\begin_layout Plain Layout +Author B +\end_layout + +\end_inset + + +\begin_inset Newline newline +\end_inset + + +\begin_inset Flex Email +status collapsed + +\begin_layout Plain Layout +author.b@email +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset ERT +status collapsed + +\begin_layout Plain Layout + + +\backslash +end{article} +\end_layout + +\end_inset + + +\begin_inset Note Note +status open + +\begin_layout Plain Layout +Note +\backslash +begin{article} in the beginning of this article; now we close the +\begin_inset Quotes eld +\end_inset + +article +\begin_inset Quotes erd +\end_inset + + environment. +\end_layout + +\end_inset + + +\end_layout + +\end_body +\end_document -- 2.39.2