Skip to content

Printing issue for JSS style #132

Closed
Closed
@benkeser

Description

@benkeser

I'm running into a situation where printing certain objects does not render to .tex properly. I can't sort out what is causing the error and I'm not certain whether this is an issue with rticles or with pandoc. Here's a MWE:

RMD document:


author:

  • name: A girl has no name
    affiliation: An affiliation
    address: >
    An address
    email: \email{anemail@aninstitution.edu}
    url: http://website.com
    title:
    formatted: '\pkg{apackage}'
    plain: 'apackage'
    short: 'apacakge'
    abstract: >
    blah blah blah
    keywords:
    formatted: [key1]
    plain: [key2]
    documentclass: jss
    classoption: article
    output: rticles::jss_article

Introduction

if(!("SuperLearner" %in% row.names(installed.packages()))){
  install.packages("SuperLearner")
}
library(SuperLearner)

This non-exported function prints fine.

SuperLearner:::.SL.require

This one does not.

SuperLearner:::predict.SL.glm

When I build, the relevant part of the .tex file looks like

This one does not.

\textbackslash{}begin\{CodeChunk\}

\begin{CodeInput}
R> SuperLearner:::predict.SL.glm
\end{CodeInput}

\textbackslash{}begin\{CodeOutput\} function (object, newdata, \ldots{})
\{ if (is.matrix(newdata)) \{ newdata = as.data.frame(newdata) \} pred
\textless{}- predict(object = object\$object, newdata = newdata, type =
``response'') pred \} \textless{}environment:
namespace:SuperLearner\textgreater{} \textbackslash{}end\{CodeOutput\}
\textbackslash{}end\{CodeChunk\}

END RMD DOCUMENT

Any guesses as to why the \textbackslash{} is being introduced?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions