Skip to content

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

Closed
@rainer-rq-koelle

Description

@rainer-rq-koelle

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions