Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am attempting to get a LaTeX style to match a journal's specification (PDF)

I have used a revtex document style with a number of tweaks, and I've gotten things close the desired output, but I'm stuck on some specific things created by the \maketitle command. My problems are very similar, so hopefully a solution to just one of them will point me towards how to answer all of them.

  1. Is it possible to use the \abstract{} environment, but have it prefix the printed abstract with a bolded "ABSTRACT: " rather than just print the abstract?
  2. There is a \keywords{} environment in revtex, but by default it displays "Keywords: " in the regular abstract font. I would like to modify this to match the journal's specifications (upper case, bolded)
  3. Is it possible to change how the \date{} is displayed (ie, to change the prefix from "Dated: " to something like "Presented on..."

Code below:

\documentclass[a4paper,twocolumn,notitlepage,   %
    superscriptaddress,showkeys,nopacs,     %
    jmp,10pt]{revtex4-1}                    % "9pt" doesn't actually do anything because revtext has only 10,11,12pt

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Attempt to get a style or template working that matches requirements
% at the two links below:
% http://www.jsae.or.jp/taikai/manuscript_sample_e.pdf
% http://www.jsae.or.jp/taikai/manu_guide_e.pdf
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Various packages that I intend to use in my document - kept here to pre-empt package conflicts
\usepackage{lipsum}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage[demo]{graphicx}
\usepackage{dcolumn}
\usepackage{hyperref}
\usepackage{tabularx}                       % To produce tables with long text
\usepackage[capitalise,noabbrev]{cleveref}  % http://www.howtotex.com/packages/automatic-clever-references-with-cleveref/
\usepackage{epstopdf}                       % http://tug.org/pipermail/texworks/2010q2/002895.html

%%% Set page margins
% Left, right, bottom margins set directly. Top margin set to 20mm + 5mm header-separation
\usepackage[left=18mm,top=20mm,right=18mm,bottom=25mm,includehead,nofoot,headheight=0pt,headsep=5mm]{geometry}

%%% Get numeration of headings with full context (ie, 2.1.3 SubSubsection)
\def\thesection{\arabic{section}}%
\def\thesubsection{\arabic{section}.\arabic{subsection}}%
\def\thesubsubsection{\arabic{section}.\arabic{subsection}.\arabic{subsubsection}}%
\def\theparagraph{\arabic{paragraph}}%
\def\thesubparagraph{\theparagraph.\arabic{subparagraph}}%
\setcounter{secnumdepth}{5}%

%%% Set heading font, style and placement
\usepackage{titlesec}
\titleformat*{\section}{\bfseries\filcenter\MakeUppercase}
\titleformat*{\subsection}{\bfseries}
\titleformat*{\subsubsection}{\bfseries}
%%% Set heading spacing
\titlespacing{\section}{0pt}{1.5em}{0.25em}
\titlespacing{\subsection}{0pt}{1em}{0em}
\titlespacing{\subsubsection}{0pt}{1em}{0em}

%%% Settings to explicitly place text in the top-right corner
\usepackage[absolute]{textpos}
\TPGrid{14}{4}
\textblockorigin{194mm}{10mm} % Start 16mm from the right (210mm) paper edge, 10mm down


\begin{document}

%%% Selects "small" font. For 10pt articles, 9pt is the /small font size
\small

%%% Specify fonts for title and authors' text. The title gets the JSAE recieptNo attached to it.
\newcommand{\JSAEtitle}[1]{\title{\fontsize{10.95}{10.5}\selectfont \hspace{-100pt} \JSAEreceiptnoWprefix{}\hspace{10pt} \fontsize{17.28}{16}\selectfont \textmd{#1}}}
\newcommand{\JSAEauthor}[1]{\author{\fontsize{11}{11}\selectfont \textbf{#1}}}
\newcommand{\JSAEreceiptnoWprefix}{\JSAEreceiptnoPrefix{}-\JSAEreceiptno{}}

%%%%%%% USER INPUT %%%%%%%
% The user must place a JSAEreceiptno, JSAEreceiptnoPrefix, JSAEtitle, and any number of JSAEauthors.
\newcommand{\JSAEreceiptno}{00000000}
\newcommand{\JSAEreceiptnoPrefix}{000}
\JSAEtitle{A sample template for JSAE articles}

\JSAEauthor{J. T. Ripper}
\affiliation{Bethlem Royal Psychiatric Hospital\\
10-2 Gobancho, Chiyoda, Tokyo, 102-0076, Japan (E-mail: taro@jsar.or.jp)}
\JSAEauthor{Bugs Bunny}         \affiliation{Looney Tunes}
\JSAEauthor{Daffy Duck}         \affiliation{Looney Tunes}\affiliation{Warner Brothers}

%%%%%%% USER INPUT %%%%%%%
\begin{abstract}
The abstract is here. \lipsum[1]
\end{abstract}

%%%%%%% USER INPUT %%%%%%%
\pacs{23.23.+x, 56.65.Dy}
\keywords{nuclear form; yrast level}
\date{December 2005}

\maketitle

%%% Place the JSAE receipt no in the top right corner
\begin{textblock}{2}[1,0](0,0)
\begin{flushright}
\fontsize{12}{12} \vspace{-10pt} \textbf{\JSAEreceiptno{}}
\end{flushright}
\end{textblock}

%%% Tweak the line spacing to match what seems to the be the spacing specification
\setlength{\baselineskip}{14pt}

\section{Introduction}
The manuscript elements have been formatted for you 
through the “styles” capability of the software.  To use the styles, 
select the text you wish to apply a style to, then, using the mouse, 
point to the style box on the toolbar.  Click once on the 
downward pointing arrow to the right, and select the appropriate 
style.

\section{Methods}
\subsection{First subsection}
\lipsum[7]
\subsection{Next subsection}
\lipsum[1]
\subsubsection{Now a subsubsection}
\lipsum[1]
\section{Results}
\lipsum[3-4]

\appendix
\section{Optional appendix}
The appendix section itself is optional and rarely used. The \verb+\appendix+ command signals that all following sections are appendices, 
so \verb+\section{title text}+ after \verb+\appendix +will set {title text} as an appendix heading (an empty {title text} is permitted).
For a single appendix, use a \verb+\appendix*+ followed by \verb+\section{title text}+ command to suppress the appendix letter in the section heading.

\end{document}

PS: I'm relatively new at trying to take control of final output... I recognise that much of what I've done could be seen as hacks to get nice looking output. I'd welcome suggestion on how to do things "better".

share|improve this question

2 Answers 2

up vote 3 down vote accepted

For the keywords and the date you can say

\def\@keys@name{\textbf{KEYWORDS: }}
\def\Dated@name{Presented on: }

For the abstract you have to tell revtex some more things:

\@booleantrue\preprintsty@sw
\def\frontmatter@abstractheading{\noindent\textbf{ABSTRACT: }}
\g@addto@macro\abstract{\ignorespaces}

If the boolean \preprintsty@sw is false (as it is in your case), there's no heading for the abstract. Then we redefine the default heading, but we also need to make abstract ignore the end of line after it.

So, finally, the start of your document might be

\documentclass[a4paper,twocolumn,notitlepage,   %
    superscriptaddress,showkeys,nopacs,     %
    jmp,10pt]{revtex4-1}                    % "9pt" doesn't actually do anything because revtext has only 10,11,12pt


\makeatletter
\def\@keys@name{\textbf{KEYWORDS: }}
\def\Dated@name{Presented on: }
\@booleantrue\preprintsty@sw
\def\frontmatter@abstractheading{\noindent\textbf{ABSTRACT: }}
\g@addto@macro\abstract{\ignorespaces}
\makeatother

Note, however, that nopacs and jmp return

LaTeX Warning: Unused global option(s):
    [nopacs,jmp].

so they should be removed.


In order to get the affiliation numbers like in the example, you can try adding also the following code before \makeatother, but I don't guarantee it's without side effects.

\def\frontmatter@makefnmark{\@thefnmark)~}
\def\@affil@present@script@#1{%
 \@ifx{\relax#1}{%
  \@ifx{\@tempa\@empty}{%
   \aftergroup\false@sw
  }{%
   \textsuperscript{\bfseries\expandafter\@affilcomma\@tempa\relax\relax}%
   \aftergroup\true@sw
  }%
 }{%
  \@ifnum{#1=\z@}{}{\appdef\@tempa{{#1)}}}%
  \@affil@present@script@
 }%
} 
share|improve this answer
    
Awesome, thanks for the detailed reply. One question, how would I go about finding these things like @keys@name and Dated@name? –  sven Feb 11 '13 at 22:34
    
@sven Those two are in revtex4-1.cls, I just searched for Keywords and Dated. For the abstract it was a bit more involved. Actually Sašo solution is perhaps easier –  egreg Feb 11 '13 at 22:39
    
Ah yes, I see now that if I searched revtex4-1.cls for "Dated:" I would have found it.... I guess we're getting into "should know what you're doing" territory before I start messing around too much with that stuff :) Can you perhaps point me to where in that file I'd find the little superscript affiliation number above each author? That's not something that has nicely searchable text to give it away... I'm thinking of putting a parentheses after each superscript... –  sven Feb 11 '13 at 22:41
    
@sven It's dangerous territory, yes. Those parentheses are awful, I'll try and see what can be done. –  egreg Feb 11 '13 at 22:46
    
@sven I've added the code. –  egreg Feb 11 '13 at 23:15

Put this in your preamble:

\usepackage{etoolbox}
\appto\abstract{\parindent 0pt \textbf{ABSTRACT: }\ignorespaces}
\makeatletter
\def\@keys@name{\textbf{KEYWORDS:} }
\def\Dated@name{Presented on }
\makeatother
share|improve this answer
    
What's \xspace for? –  egreg Feb 11 '13 at 21:31
    
So that it doesn't matter whether the abstract environment starts with a space or not. –  Sašo Živanović Feb 11 '13 at 21:37
1  
Not at all. You'll have a space nonetheless; \xspace never removes spaces. –  egreg Feb 11 '13 at 21:39
    
duh! I meant \ignorespaces! Thanks!!! –  Sašo Živanović Feb 11 '13 at 21:42
    
Thanks Saso, quick and works well. It was my first question here so I can't upvote yet... but when I can I will. –  sven Feb 11 '13 at 22:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.