Skip to content

Disable -autolink_bare_uris pandoc option? #372

@cboettig

Description

@cboettig

Is there a way to remove options that rmarkdown attaches to the format by default? (e.g. here:

"+autolink_bare_uris",
)

I've tried defining a custom template modifying the call to output_format

output_format(knitr = knitr_options_pdf(fig_width, fig_height,
                                            fig_crop, dev),
                  pandoc = pandoc_options(to = "latex",
                                          from = my_from_rmarkdown(fig_caption), args = args, keep_tex = keep_tex),
                  clean_supporting = !keep_tex, pre_processor = pre_processor)

using the modified definitions

## No autolink bare uris please
my_from_rmarkdown <- function(implicit_figures = TRUE){
  my_rmarkdown_format(ifelse(implicit_figures, "", "-implicit_figures"))
}
my_rmarkdown_format <- function (extensions = NULL)
{
  paste(c("markdown", "-autolink_bare_uris", "+ascii_identifiers",
          "+tex_math_single_backslash", extensions), collapse = "")
}

but get the error that my format is not of the class rmarkdown_output_format. In general a way to turn this off would be useful, for instance, it is responsible for the error in #125 by causing pandoc to put an \href into a LaTeX field that is expecting only a bare email.

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