Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add acs template #15

Merged
merged 2 commits into from
Nov 5, 2014
Merged

add acs template #15

merged 2 commits into from
Nov 5, 2014

Conversation

yufree
Copy link
Contributor

@yufree yufree commented Nov 3, 2014

add plos one namespace and revise yaml
Right now the acs(American Chemistry Society) template is more like a tex document than markdown document.
There are three issues:

  1. the email in the yaml can't be a link. I tried to add the hyperref package in the template but the document can't be complied
  2. the author can't be more than one, I think this issue due to the conflict between the yaml grammar and some wired definitions in the achemso package
  3. achemso package defined many environments while markdown were not support that, so I just write plain tex in the template

add plos one namespace and revise yaml
@jjallaire
Copy link
Member

You cite a couple of issues, I'm assuming that this means that the PR is not yet ready to review/merge. Let me know when these issues have been resolved and I'll review.

csl <- find_resource("acs" ,"american-chemical-society.csl")

rmarkdown::pdf_document(
keep_tex = TRUE,
Copy link
Member

Choose a reason for hiding this comment

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

I think you mean keep_tex = keep_tex here.

@yihui
Copy link
Member

yihui commented Nov 3, 2014

Regarding the three issues you mentioned:

  1. Does an email address have to be a hyperlink? (i.e. is this an official rule from ACS?) If not, I'd say just leave it alone. I do not think it is a super important issue.
  2. What is the native LaTeX syntax to write multiple authors using the achemso package?
  3. No big deal. If ACS publications customize LaTeX environments/commands so heavily, we do not have to use native Markdown. My only concern is the R code chunks and their output. I'm not sure if the default output satisfy the publication requirement of ACS. I think you will need to give one or two examples on this. Without R code chunks in R Markdown documents, it does not make much sense using R Markdown at all (you can always write a pure LaTeX document).

@yufree
Copy link
Contributor Author

yufree commented Nov 4, 2014

I have solved the second issue and add R code chunks in the text in a new push. So the only issue is the email.
In ACS publications, the address should not to be a hyperlink. However, without the hyperref package, the email address will be shown as follows in the tex file:

\email{\href{mailto:s.k.laborator@bigpharma.co}{s.k.laborator@bigpharma.co}}

When complied, the final pdf will show as plain tex.

However, when I add the hyperref package, the compiling totally failed and I think this issue due to some wired definition of \email in the achemso package.

Another way is just removing the \href{mailto:s.k.laborator@bigpharma.co} to make the email part look like the following code:

\email{s.k.laborator@bigpharma.co}

This make the compile passed. So I think the easiest way is remove some parameters from pandoc to let markdown not convert email address into a hyperlink mode automatically. However, it seemed I can only add parameter instead of removing them in Rmarkdown and I need some help here.

You may test the email issue in the following code:

devtools::install_github('yufree/rticles')

Thank you!

@yufree
Copy link
Contributor Author

yufree commented Nov 5, 2014

I think I have found the solution. When I remove the --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash from the pandoc command(in fact, just remove +autolink_bare_uris will help), the output will be fine. But it seemed that this command was added to any knit command and I have no idea about how to remove this parameter from the default command. Maybe some optional from Rstudio will fix this issue.

@yihui
Copy link
Member

yihui commented Nov 5, 2014

Does it work if you do not use the \email{} command at all?

@yufree
Copy link
Contributor Author

yufree commented Nov 5, 2014

I tried, but it failed. It seemed the achemso package has a strict definition about \email to make sure the email show at a proper position. This package even contain no \maketitle to show the title and author in the tex file.

@yihui yihui merged commit 4cbedd7 into rstudio:master Nov 5, 2014
@yihui
Copy link
Member

yihui commented Nov 5, 2014

Fair enough. That is why I sometimes really hate LaTeX...

This particular problem is not too difficult to solve, though. You just use raw commands \email{} in R Markdown. I have fixed it and merged the PR. Thanks!

@yufree
Copy link
Contributor Author

yufree commented Nov 5, 2014

Thank you very much! Finally I could write my paper in Rstudio. If I submit to another publication, I'd like to make such template for this package.

P.S.: achemso package template could deal with about 40+ journals for rticles package.

@yihui
Copy link
Member

yihui commented Nov 5, 2014

Cool. Please feel free to improve the existing template or contribute new ones. Thanks!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants