quarto-dev / quarto-dev/quarto-cli

Use code line wrap when rendering to PDF

Open
#5,343 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement latex
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

Bug description

When rendering to a PDF, code that flows off the page is lost:

image

It would be nice if quarto would be able to use some kind of line wrap for the code when rendering to PDF.

---
title: Analysis
---

Now that we have the data in a tidy format, let's clean the values:

1. Convert all `"-"` to `"0"`
2. Convert all `"x"` to `"0"`
3. Convert all the values in the `:Value` column to a Float64 and a `:Year` column to an Int

```{julia}
df = transform(df, :Value => ByRow(x -> ifelse(x == "-", "0", x)) => :Value)
df = transform(df, :Value => ByRow(x -> ifelse(x == "x", "0", x)) => :Value)
df = transform(df, :Value => ByRow(x -> parse(Float64, x)) => :Value, :Year => ByRow(x -> parse(Int, x)) => :Year)
first(df, 3) #| hide_line
```

When I run quarto render --to pdf I get a PDF like in the screenshot above.

julia> versioninfo()
Julia Version 1.8.5
Commit 17cfb8e65e (2023-01-08 06:45 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 8 × 11th Gen Intel(R) Core(TM) i5-1145G7 @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, tigerlake)
  Threads: 1 on 8 virtual cores
Environment:
  JULIA_EDITOR = code.cmd -g
$ quarto check

[>] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.1: OK
      Dart Sass version 1.55.0: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
      Version: 1.3.326
      Path: C:\Users\USERNAME\AppData\Local\Programs\Quarto\bin
      CodePage: 1252

[>] Checking basic markdown render....OK

[>] Checking Python 3 installation....OK
      Version: 3.9.12 (Conda)
      Path: C:/Users/USERNAME/Miniconda3/python.exe
      Jupyter: 5.1.0
      Kernels: python3, julia-1.8

[>] Checking Jupyter engine render....OK

[>] Checking R installation...........(None)

      Unable to locate an installed version of R.
      Install R from https://cloud.r-project.org/
Checklist
  • Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
  • Please format your issue so it is easier for us to read the bug report.
  • Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
  • Please document the operating system you're running. If on Linux, please provide the specific distribution.
  • Please provide the output of quarto check so we know which version of quarto and its dependencies you're running.

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

Reproduce the report from the supplied single .qmd example with quarto render --to pdf, using the Julia code and quarto check output as context. Trace the PDF rendering path for code blocks and verify that long code lines wrap instead of disappearing from the page.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
build-system, cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.