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

Quarto Preview for PDF #128

Open
weberam2 opened this issue May 28, 2024 · 3 comments
Open

Quarto Preview for PDF #128

weberam2 opened this issue May 28, 2024 · 3 comments

Comments

@weberam2
Copy link

Sorry if this is obvious.

I am using the quarto kickstarter.

I can get QuartoPreview to work with html: (my _quarto.yml)

project:
  type: manuscript
  render: 
    - "*.qmd"
    - "!pyvenv_csvo/"

execute:
  freeze: auto

format:
  html:
    embed-resources: true
    toc: true
    comments:
      hypothesis: true
      
  # docx: default
  # jats: default
  
  # nature-pdf:
  #   journal: "sn-nature"
  #   keep-tex: true

filters:
  - parse-latex

But it doesn't work when I try to render to pdf:

project:
  type: manuscript
  render: 
    - "*.qmd"
    - "!pyvenv_csvo/"

execute:
  freeze: auto

format:
  # html:
  #   embed-resources: true
  #   toc: true
  #   comments:
  #     hypothesis: true
      
  # docx: default
  # jats: default
  
  nature-pdf:
    journal: "sn-nature"
    keep-tex: true

filters:
  - parse-latex

I get this error:

image

I will say, this does render when I use Rstudio... so it's not a ...conversion problem.

Cheers,

Alex W.

@jmbuhr
Copy link
Collaborator

jmbuhr commented May 28, 2024

This plugin is just using the quarto-cli in a terminal buffer. Does it work if you run your example from the command line? Or can you provide a fully reproducible example? I can not reproduce this using the default quarto create project > manuscript

@weberam2
Copy link
Author

Oh I see!

So I can make a keybinding that would do:

!quarto render and !evince _manuscript/index.pdf or something like that

Thank you!

@jmbuhr
Copy link
Collaborator

jmbuhr commented May 28, 2024

Rather quarto preview (as this watches for changes), but you don't have to do that, that's what this plugin does.
(See

if root_dir then
mode = 'project'
cmd = 'quarto preview' .. ' ' .. args
else
mode = 'file'
if vim.loop.os_uname().sysname == 'Windows_NT' then
cmd = 'quarto preview \\"' .. buffer_path .. '\\"' .. ' ' .. args
else
cmd = "quarto preview '" .. buffer_path .. "'" .. ' ' .. args
end
end
)

So if this doesn't work we should investigate why. Can you share the example in question?

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

No branches or pull requests

2 participants