Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

As someone who tracks manuscript source with git, I'm happy to see the editor option:

editor:
  markdown:
    wrap: sentence

It would be nice if sentence wrap could be applied in figure captions as well like:

![
  **My figure caption**:
  Captions in academic writing are often long.
  One sentence/phrase per line is the best.
  In semantic linefeeds, we trust.
](path-to-figure.svg){#fig-my-figure}

Currently the VSCode editor converts to:

![**My figure caption**: Captions in academic writing are often long. One sentence/phrase per line is the best. In semantic linefeeds, we trust.](path-to-figure.svg){#fig-my-figure}

A somewhat related request is an option to only wrap sections of text that the user edits in the visual editor as opposed to wrapping everything. Without this, it's hard to use the visual editor to make small changes without blowing up the diff.

You must be logged in to vote

Replies: 1 comment · 3 replies

Comment options

The repository for the VSCode extension is https://github.com/quarto-dev/quarto

I don't think this enhancement request was already made, but please check the opened issues first before opening one.

Note that editor.markdown is not for the Visual Editor, it's for the markdown editor.
You won't have line wrapping in the Visual Editor with the setting, you'll have that when looking at the source editor (markdown).

Another note ![](){} is an inline syntax in Pandoc's view (used behind the scene by the Visual Editor to reformat the document).
Allowing line wrap/break would be very tricky inside this syntax especially if you start to add cross-references in it with [-@ref] syntax. See below for a "better" alternative.


Alternatively, you could use the cross-reference div syntax which in my opinion is better suited for long caption. Using this syntax should trigger the visual editor line wrapping I believe.

::: {#fig-my-figure}
![](path-to-figure.svg)

**My figure caption**: Captions in academic writing are often long. One sentence/phrase per line is the best. In semantic linefeeds, we trust.
:::
You must be logged in to vote
3 replies
@dhimmel
Comment options

Ah nice tip about the Figure Div method.

You can treat any markdown content you want as a figure by enclosing it in Pandoc div block with an identifier prefaced with #fig-

It's nice that these captions are still put in <figcaption> and work with figure panels. This is a sufficient solution for my issue and I agree its a clearer syntax for long captions.

Note that editor.markdown is not for the Visual Editor, it's for the markdown editor.

Hmm. It seems to do what I want which is to instruct the VSCode visual editor to save the markdown using one sentence per line. In the visual editor rendered view, the newlines won't appear of course.

The repository for the VSCode extension is https://github.com/quarto-dev/quarto. I don't think this enhancement request was already made, but please check the opened issues first before opening one.

It seems that there are multiple visual editors, one for VS Code, one for RStudio. Are the editor settings and behaviors synced between the multiple visual editors? In other words, does a request like mine need to be filed in a more general location?

@mcanouil
Comment options

It seems that there are multiple visual editors, one for VS Code, one for RStudio. Are the editor settings and behaviors synced between the multiple visual editors? In other words, does a request like mine need to be filed in a more general location?

There is only one which is used by RStudio AND VSCode extension

@cscheid
Comment options

In other words, does a request like mine need to be filed in a more general location?

Feel free to start at quarto-dev/quarto and, if needed, we'll transfer the issue. quarto-dev/quarto is a monorepo that currently hosts most of the code for Quarto's editor support in RStudio, as well as VS code + Positron.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request vscode
3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.