Skip to content

Insert cross reference widget doesn't pick up fig-cap from the next line (Support multiline yaml chunk options) #11199

Open

Description

@mine-cetinkaya-rundel

System details

RStudio Edition : Desktop
RStudio Version : RStudio 2022.06.0-daily+388 "Spotted Wakerobin" Daily (499ab6bd1e80eb3e38940fe81878d162dbd1f769, 2022-05-11) for macOS Mozilla/5.0 (Macintosh; Intel Mac OS X 12_3_1) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.12.10 Chrome/69.0.3497.128 Safari/537.36
OS Version      : macOS 12.3.1
R Version       : 4.1.3

Steps to reproduce the problem

Create a Quarto book and add the following to one of the qmd files.

If you like cars see .

```{r}
#| label: fig-cars-1
#| fig-cap: Dist vs. speed of cars.

plot(dist ~ speed, cars)
```

```{r}
#| label: fig-cars-2
#| fig-cap: >
#|   Speed vs. dist of cars.

plot(speed ~ dist, cars)
```

```{r}
#| label: fig-cars-3
#| fig-cap: |
#|   Speed^2 vs. dist of cars.

plot(speed^2 ~ dist, cars)
```

Then, switch over to the visual editor. Put your curser after "see" and use the Insert Anything tool to insert a cross reference.

Describe the problem in detail

Only the caption of the first figure is visible, since the others start with > or |, which are commonly used for long captions spanning multiple lines. If working in a book chapter with lots of figures that use this style for captions, it's impossible to use this tool alone to pick the right figure to reference.

Screen Shot 2022-05-12 at 10 19 17 PM

Describe the behavior you expected

I would expect the next line to be picked up so the caption would be visible in the widget.

Note: I think this is a bug and not a feature request, but I'm not sure.

  • I have read the guide for submitting good bug reports.
  • I have installed the latest version of RStudio, and confirmed that the issue still persists.
  • If I am reporting an RStudio crash, I have included a diagnostics report.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

Activity

  1. romainfrancois commented on May 13, 2022

    @romainfrancois
    Contributor

    In addition, I see this source marker in the > case.

    image

  2. romainfrancois commented on May 13, 2022

    @romainfrancois
    Contributor

    I get this with RStudio 2022.06.0-daily+400 "Spotted Wakerobin" Daily.

    image

    Do you by any chance have quarto installed from https://quarto.org/docs/get-started/ ? Maybe the takes precedence over the one included by recent daily builds of rstudio ? I'm not sure about this, but I've seen @ronblum recommend to remove the one installed from the cli.

  3. self-assigned this
    on May 13, 2022
  4. jgutman commented on May 13, 2022

    @jgutman
    Contributor

    I just made some changes to support the yaml chunk options format (based on mine-cetinkaya-rundel's previously reported issue, but I wasn't aware that these multiline options starting with > or | were valid, so I didn't add support for this format. We can add support for these at some point.

  5. ronblum commented on May 13, 2022

    @ronblum
    Contributor

    Regarding the CLI: Installing the CLI from quarto.org is a good thing. My main concern is that it doesn't have to be installed, so I want to make sure that we take that into account, because they might be different versions.

  6. romainfrancois commented on May 13, 2022

    @romainfrancois
    Contributor

    Thanks @ronblum, that clarifies it for me :-)

  7. changed the title [-]Insert cross reference widget doesn't pick up `fig-cap` from the next line[/-] [+]Insert cross reference widget doesn't pick up `fig-cap` from the next line (support multiline yaml chunk options)[/+] on May 24, 2022
  8. changed the title [-]Insert cross reference widget doesn't pick up `fig-cap` from the next line (support multiline yaml chunk options)[/-] [+]Insert cross reference widget doesn't pick up `fig-cap` from the next line[/+] on May 24, 2022
  9. changed the title [-]Insert cross reference widget doesn't pick up `fig-cap` from the next line[/-] [+]Insert cross reference widget doesn't pick up `fig-cap` from the next line (Support multiline yaml chunk options)[/+] on May 24, 2022
  10. removed their assignment
    on Jul 7, 2022
  11. modified the milestones: Backlog-2, Later on Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions