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

pdf knit fails with 'Environment Shaded undefined' Error for IEEE template --> stackoverflow solution #182

Closed
rainer-rq-koelle opened this issue Aug 3, 2018 · 6 comments
Milestone

Comments

@rainer-rq-koelle
Copy link

rainer-rq-koelle commented Aug 3, 2018

Dear all,
((I am not sure whether this is a feature request. But a bug report, did not feel right.))
I struggled heavily to work through a sort of trivial problem (c.f. my question and a related question):

Using the rticles IEEE paper template, I wanted to print a R code-chunk.

The default workaround offered on Stackoverflow is to "circumnavigate" the problem by not showing the chunk (aka setting the chunk option echo = FALSE which is not the desired behaviour).
It took me a while to figure out where, i.e. template.tex in the respective rticles R library sub-folder to change the LATEX for a possible solution.

The solution is to add a 3 line LATEX statement in the preamble of template.tex to support the highlighting:

$if(highlighting-macros)$
  $highlighting-macros$
  $endif$ 

Mickey provided an elegant solution in response to the aforementioned fix identified by coatless that is based on a separate header.tex file. I know too little about LATEX, but given the number of lines I find this solution pretty sophisticated.

Still, I believe, the support for the highlighting, i.e. Shaded environment, should be included in the rticles templates out of the box.

Thanks for considering the fix offered by coatless in the next update of the IEEE paper (and possible other templates).

@yihui yihui closed this as completed in bc8a239 Aug 5, 2018
@yihui yihui added this to the v0.6 milestone Aug 5, 2018
@yihui
Copy link
Member

yihui commented Aug 5, 2018

Many thanks for asking and answering the question on SO! I have added the fix to ieee_article().

@rainer-rq-koelle
Copy link
Author

rainer-rq-koelle commented Aug 6, 2018 via email

@m-macaskill
Copy link

Under rticles version 0.9, this error still occurs for PeerJ-formatted documents.

@yihui
Copy link
Member

yihui commented Jul 14, 2019

@m-macaskill Cc @zkamvar (#127)

zkamvar added a commit to zkamvar/rticles that referenced this issue Jul 14, 2019
yihui pushed a commit that referenced this issue Jul 14, 2019
* this allows syntax highlighting for PeerJ

see #182 (comment)

* add NEWS

* fix parens error in DESCRIPTION

* Update NEWS.md
@yihui
Copy link
Member

yihui commented Jul 14, 2019

@m-macaskill Fixed now by @zkamvar via #238. Thanks!

@github-actions
Copy link

github-actions bot commented Nov 2, 2020

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.

@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

No branches or pull requests

3 participants