0

I am trying to compile an (R) markdown document that includes a journal style file. The following line produces the following error:

\newcommand\@titlenote{}
%! LaTeX Error: Command \@ already defined.
%               Or name \end... illegal, see p.192 of the manual.

I'm not really familiar with macros so I don't know if this should be valid or not! I know that it is used later in the style file:

\let\footnote\thanks 
{\fontsize{20}{22}\usefont{OT1}{phv}{b}{n} \@title \par {\small{\@titlenote}} }
\vskip 1.5em
{\@author \par}
\end{minipage}
\vskip 1em \par
}

In case this isn't enough information, this is my full setup. This markdown in foo.Rmd

---
title: "The foo bar: a novel metal bar for holding fire doors"
author:
- name: Bar Baz
  affiliation: 
  - Bar Institute
  email: foo@bar.baz
abstract: |
  Lorem ipsum dolor.
keywords: Foo, Bar, Baz
output: 
  BiocWorkflowTools::f1000_article:
    includes:
      in_header: f1000_styles.sty
urlcolor: Orange
subparagraph: yes
geometry: "hmargin=1.8cm,vmargin=2.2cm"
---

Lorem ipsum dolor.

where f1000_styles.sty is available here.

This document can be built by running rmarkdown::render("foo.Rmd"). Sorry that it's a bit roundabout. This is as close to minimal as I managed.

  • 1
    Change \newcommand\@titlenote{} to \makeatletter\newcommand\@titlenote{}\makeatother – Ulrike Fischer Feb 26 '20 at 11:05
  • Thanks, works perfectly (make it an answer if you like). I find it weird that this is in a style file recommended by this software package - is there a way this could compile without error? – alan ocallaghan Feb 26 '20 at 11:11
  • 1
    If you would use the style with \usepackage{f1000_styles} it would work, as this would set the \makeatletter generally. But it doesn't work if you copy the content of the style in some preamble. – Ulrike Fischer Feb 26 '20 at 11:15
  • Ah, thanks again! I didn't fully understand the difference between usepackage and include in this context. – alan ocallaghan Feb 26 '20 at 11:18
  • you used \include to include the macros? never use \include before \begin{document} – David Carlisle Feb 26 '20 at 15:49

0 Answers0