Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add template for the MNRAS (Monthly Notices of the Royal Astronomical Society) article.#175

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
yihui merged 11 commits intorstudio:masterfromoleskiewicz:master
Jul 5, 2018
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
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
NextNext commit
Add MNRAS templates and skeleton.
  • Loading branch information
Piotr Oleskiewicz committedJul 4, 2018
commitc4feaa920277145a7987c97e42c253056bb19d2a
29 changes: 29 additions & 0 deletionsR/mnras_article.R
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
#' Monthly Notices of Royal Astronomical Society (MNRAS) Journal format.
#'
#' Format for creating an Monthly Notices of Royal Astronomical Society (MNRAS) Journal articles.
#' Adapted from
#' \href{https://www.ras.org.uk/news-and-press/2641-new-version-of-the-mnras-latex-package}{https://www.ras.org.uk/news-and-press/2641-new-version-of-the-mnras-latex-package}.
#'
#' @inheritParams rmarkdown::pdf_document
#' @param ... Arguments to \code{rmarkdown::pdf_document}
#'
#' @return R Markdown output format to pass to \code{\link[rmarkdown:render]{render}}
#' @examples
#'
#' \dontrun{
#' library(rmarkdown)
#' draft("MyArticle.Rmd", template = "mnras_article", package = "rticles")
#' }
#'
#' @export
mnras_article <- function(...,
keep_tex = TRUE,
md_extensions = c(),
fig_caption = TRUE){
pdf_document_format(...,
keep_tex = keep_tex,
md_extensions = md_extensions,
format = "mnras_article",
template = "template.tex",
csl = "mnras.csl")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

You need to usesystem.file() to refer to these (as the current code assumes they are in the current working directory)

}
2 changes: 2 additions & 0 deletionsinst/rmarkdown/templates/mnras_article/.gitignore
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
*.pdf
*.tex
118 changes: 118 additions & 0 deletionsinst/rmarkdown/templates/mnras_article/resources/template.tex
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
% mnras_template.tex
%
% LaTeX template for creating an MNRAS paper
%
% v3.0 released 14 May 2015
% (version numbers match those of mnras.cls)
%
% Copyright (C) Royal Astronomical Society 2015
% Authors:
% Keith T. Smith (Royal Astronomical Society)

% Change log
%
% v3.0 May 2015
% Renamed to match the new package name
% Version number matches mnras.cls
% A few minor tweaks to wording
% v1.0 September 2013
% Beta testing only - never publicly released
% First version: a simple (ish) template for creating an MNRAS paper

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Basic setup. Most papers should leave these options alone.
\documentclass[a4paper,fleqn,usenatbib]{mnras}

% MNRAS is set in Times font. If you don't have this installed (most LaTeX
% installations will be fine) or prefer the old Computer Modern fonts, comment
% out the following line
\usepackage{newtxtext,newtxmath}
% Depending on your LaTeX fonts installation, you might get better results with one of these:
%\usepackage{mathptmx}
%\usepackage{txfonts}

% Use vector fonts, so it zooms properly in on-screen viewing software
% Don't change these lines unless you know what you are doing
\usepackage[T1]{fontenc}
\usepackage{ae,aecompl}


%%%%% AUTHORS - PLACE YOUR OWN PACKAGES HERE %%%%%

% Only include extra packages if you really need them. Common packages are:
\usepackage{graphicx}% Including figure files
\usepackage{amsmath}% Advanced maths commands
\usepackage{amssymb}% Extra maths symbols
\usepackage{hyperref}
\usepackage{url}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%% AUTHORS - PLACE YOUR OWN COMMANDS HERE %%%%%

% Please keep new commands to a minimum, and use \newcommand not \def to avoid
% overwriting existing commands. Example:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%% TITLE PAGE %%%%%%%%%%%%%%%%%%%

% Title of the paper, and the short title which is used in the headers.
% Keep the title short and informative.
$if(title)$
\title{$title$}
$endif$

% The list of authors, and the short list which is used in the headers.
% If you need two or more lines of authors, add an extra line using \newauthor

\author[et al.]{
$for(author)$
$author.name$\\
$endfor$
}

% These dates will be filled out by the publisher
\date{Accepted XXX. Received YYY; in original form ZZZ}

% Enter the current year, for the copyright statements etc.
\pubyear{2015}

% Don't change these lines
\begin{document}
\label{firstpage}
\pagerange{\pageref{firstpage}--\pageref{lastpage}}
$if(title)$
\maketitle
$endif$

% Abstract of the paper
$if(abstract)$
\begin{abstract}
$abstract$
\end{abstract}
$endif$

% Select between one and six entries from the list of approved keywords.
% Don't make up new ones.
$if(keywords)$
\begin{keywords}
$for(keywords)$$keywords$$sep$ -- $endfor$
\end{keywords}
$endif$

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%% BODY OF PAPER %%%%%%%%%%%%%%%%%%

$body$

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


% Don't change these lines
\bsp% typesetting comment
\label{lastpage}
\end{document}

% End of mnras_template.tex
3 changes: 3 additions & 0 deletionsinst/rmarkdown/templates/mnras_article/skeleton/README.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
# pandoc-mnras

A template for building MNRAS Journal articles in pandoc.
Loading

[8]ページ先頭

©2009-2025 Movatter.jp