rstudio / rstudio/rticles

Text wrapping can mess up latex templaes

Open
#490 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TeX
Stars
1.5k
Forks
517
Avg merge
1d 8h
Merged PRs (30d)
5

Description

The (new?) default pandoc behaviour of wrapping long lines can cause issues in templates if there are comments.

For example, if the template has something like this

% \title{$title$}

and if title is long enough to reach the line-wrap character length, then this gets interpolated into something like

% \title{This is a very long title that pandoc will 
wrap into a new line}

This can create all sorts of errors that are very hard to debug. I encountered this issue during a tutorial on creating LaTeX templates and a student was trying different things and commenting out some of them.

Auto wrap also caused issues in bookdown and distill and was solved by adding --wrap=preserve to pandoc arguments.


By filing an issue to this repo, I promise that

  • [ x ] I have fully read the issue guide at https://yihui.name/issue/.
  • [ x ] I have provided the necessary information about my issue.
    • If I'm asking a question, I have already asked it on Stack Overflow or RStudio Community, waited for at least 24 hours, and included a link to my question there.
    • If I'm filing a bug report, I have included a minimal, self-contained, and reproducible example, and have also included xfun::session_info('rticles'). I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version: remotes::install_github('rstudio/rticles').
    • If I have posted the same issue elsewhere, I have also mentioned it in this issue.
  • [ x ] I have learned the Github Markdown syntax, and formatted my issue correctly.

I understand that my issue may be closed if I don't fulfill my promises.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating where rticles builds Pandoc arguments for LaTeX templates, then reproduce the issue with a long interpolated title inside a commented template line. Compare the generated output with Pandoc wrapping preserved; done means interpolation no longer splits commented LaTeX lines and the relevant checks pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
latex, r
Domain
documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.