Closed arnold-c closed 2 years ago
Thanks for the contribution of this new template.
but am currently running into a problem when I try to knit skeleton.Rmd: Error: 'wellcomeor_article' is not an exported object from 'namespace:rticles'
Did you install the development version of this package (from your branch) ?
Using the Knit button will use the install version. If you are using devtools::load_all()
you would need to use command line rmarkdown::render
I think
Sorry for the delay in response @cderv, and thanks for reminding me to build and install the development version! I'm now getting this issue
Error compiling template "/Users/user/Library/R/x86_64/4.1/library/rticles/rmarkdown/templates/wellcomeor/resources/template.tex" (line 77, column 1):
unexpected end of input
expecting " ", "\t", "$--", "\n", "\r\n", "\r", "$", "${" or "$$"
Error: pandoc document conversion failed with error 5
Execution halted
Looking in both skeleton.Rmd
and template.tex
I can't see any code that would be causing these issues, but I'm obviously missing something. I've tried removing the majority of the body
text in an attempt to see if some of the LaTeX code was causing the error, but this didn't seem to help.
This type of error is thrown by Pandoc when something is not correct regarding syntax in the template. There must be a Pandoc template syntax not correct in the template. It could be an $endif$
missing or any other $
missing around variables.
Thanks @cderv. I've added the Pandoc requirements you linked, along with your other suggestions, and removed the arXiv files that accidentally were made when I was examining the template.
It is no longer throwing the Pandoc error, but I am now getting the following error
! Undefined control sequence.
<argument> ...sed on Wellcome Open Research \href
{https://www.overleaf.com/...
l.62 Latex template}}
l.62
refers to
\emph{Text based on Wellcome Open Research
\href{https://www.overleaf.com/project/6131911644b635ad3aaa4cb2}{Overleaf
Latex template}}
When removing _Text based on Wellcome Open Research [Overleaf Latex template](https://www.overleaf.com/project/6131911644b635ad3aaa4cb2)_
from skeleton.Rmd
, I instead get the following error:
! Undefined control sequence.
l.60 \hypertarget
{introduction}{%
Which refers to:
\hypertarget{introduction}{%
\section{Introduction}\label{introduction}}
Thanks
I've updated the template and it now produces a pdf. The only remaining issues I couldn't figure out is how to disable link coloring (setting it using hypersetup{}
didn't seem to work), and the author affiliation number isn't correct and doesn't allow for multiple authors. I tried to copy across code from the OUP template, which allows for it, but couldn't get it to work I'm afraid. I also get font warning, but it seems like that is also an warning on the Overleaf template, so I don't think it's too much of an issue that should be fixed on our end.
Warning message:
LaTeX Warning: Font shape declaration has incorrect series value `mc'.
It should not contain an `m'! Please correct it.
Found on input line 53.
I couldn't figure out is how to disable link coloring
It is possible this is something produced by Pandoc. Did you try opting out using the variables ? https://pandoc.org/MANUAL.html#links
Something like
colorlinks: false
in the YAML header ?
the author affiliation number isn't correct and doesn't allow for multiple authors.
This can be tricky and require to modify the template. Several formats have different trick for this kind of thing.
I could try to have a look. That would be helpful if you know what syntax it should look like in the .tex
output ?
We could then adapt as template for Pandoc.
Thanks
Assuming the comments are all OK and it passes all the checks, I think this is ready to be merged. Thanks for your help and patience!
All look good to me so I just went ahead and committed the suggestions. Thanks
Thanks @arnold-c !
There were also the discussion box above my last comment 😅 sorry for that, Github have separated them from the other. Can you validate those too ?
Especially this one: https://github.com/rstudio/rticles/pull/436#discussion_r765659670
Thanks
Sorry about that. I've just gone through and confirmed it all works as expected after those suggestions (I think I got them all)
We must just redocument following new arguments in function. I'll do that tommorow and merge it.
To contribute a new article template to this package, please make sure you have done the following things (note that
journalname_article
below is only an example name):[x] This project uses a Contributor Licence Agreement (CLA) that you'll be asked to sign when opening a PR. This is required for a significant pull request (it is fine not to sign it if a PR is only intended to fix a few typos). We use a tool called CLA assistant for that.
You could also, unless you have done it in any other RStudio's projects before, sign the individual or corporate contributor agreement. You can send the signed copy to jj@rstudio.com.
[x] Add the
journalname_article()
function toR/article.R
if the output format is simple enough, otherwise create a separateR/journalname_article.R
.[x] Add the Pandoc LaTeX template
inst/rmarkdown/templates/journalname/resources/template.tex
.[x] Add a skeleton article
inst/rmarkdown/templates/journalname/skeleton/skeleton.Rmd
.[x] Add a description of the template
inst/rmarkdown/templates/journalname/template.yaml
.[x] Please include the document class file (
*.cls
) if needed, but please do not include standard LaTeX packages (*.sty
) that can be downloaded from CTAN. If you are using TinyTeX or TeX Live, you can verify if a package is available on CTAN viatinytex::parse_packages(files = "FILENAME"")
(e.g., whenFILENAME
isplain.bst
, it should return"bibtex"
, which means this file is from a standard CTAN package). Please keep the number of new files absolutely minimal (e.g., do not include PDF output files), and also make examples minimal (e.g., if you need a.bib
example, try to only leave one or two bibliography entries in it, and don't include too many items in it without using all of them).[x] Update Rd and namespace (could be done by
devtools::document()
).[x] Update NEWS.
[x] Update README with a link to the newly supported journal. Please add your Github username and the full name of the journal (follow other examples in the list).
[x] Add a test to
tests/testit/test-formats.R
by adding a linetest_format("journalname")
. We try to keep them in alphabetical order.[x] Add your name to the list of authors
Authors@R
in DESCRIPTION. You don't need to bump the package version in DESCRIPTION.Lastly, please try your best to do only one thing per pull request (e.g., if you want to add two output formats, do them in two separate pull requests), and refrain from making cosmetic changes in the code base: https://yihui.name/en/2018/02/bite-sized-pull-requests/
Thank you!
Hi,
I'm afraid I'm relatively inexperienced at both package development and LaTeX, so have adapted the template as much as I can, but am currently running into a problem when I try to knit
skeleton.Rmd
:Error: 'wellcomeor_article' is not an exported object from 'namespace:rticles'
. If anyone can point me in the right direction, that'd be much appreciated, and I can see if the template works as expected.Thanks,