Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to sync scroll rmd file and the compiled html file? #1502

Open
jiangtianli91 opened this issue Mar 18, 2024 · 1 comment
Open

Comments

@jiangtianli91
Copy link

For regular markdown file, vscode can sync it with the compiled html so that one can scroll them synchronously. I couldn't find a way to achieve that for rmarkdown in vscode. Is there a way to do so?

I have checked the setting for R and markdown in vscode, but cannot find a way to achieve it.

@jiangtianli91 jiangtianli91 changed the title Is there a way to sync rmd file and the compiled html file? Is there a way to sync scroll rmd file and the compiled html file? Mar 18, 2024
@Fred-Wu
Copy link

Fred-Wu commented Jun 18, 2024

If you don't need codes to run, but just to view the text and math in HTML while you are writing, then in the settings.json, you could associate Rmd with markdown

    "files.associations": {
      "*.Rmd": "markdown",
      "*.rmd": "markdown",
    },

Then keyboard settings like below, will generate a plain version of HTML that could scroll with Rmd synchronously.

  {
    "key": "shift+alt+m",
    "command": "markdown.showPreviewToSide",
    "when": "editorTextFocus && editorLangId == 'rmd'"
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants