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

Can't render #4

Open
mroberts1 opened this issue May 24, 2024 · 5 comments
Open

Can't render #4

mroberts1 opened this issue May 24, 2024 · 5 comments
Labels
question Further information is requested

Comments

@mroberts1
Copy link

mroberts1 commented May 24, 2024

It just keeps erroring this:

[typst]: Compiling PrettyPDF.typ to PrettyPDF.pdf...error: file not found (searched at /Users/dokoissho/GitHub/RStudio/fsu-smt-su24/\_extensions/quarto-ext/PrettyPDF/logo.png)
    ┌─ PrettyPDF.typ:217:24
    │
217 │         let img = image(typst-logo.path, width: 1.5cm)
    │                         ^^^^^^^^^^^^^^^

The install process is confusing - is the PrettyPDF directory (or the nrennie directory?) supposed to be in the main directory of the Quarto project? In the _extensions directory in the project directory? In the quarto-ext directory inside _extensions?

And where is the PrettyPDF.qmd template supposed to be?

UPDATE: I can render the PrettyPDF.qmd template, from a subdirectory I created called PrettyPDF in the main project directory. It contains the template and an _extensions folder containing the nrennie folder. However, I am unable to render any .qmd files in the main project directory, even when copied into PrettyPDF.

@nrennie
Copy link
Owner

nrennie commented May 31, 2024

Sorry to hear you're having issues with it.

There isn't quite enough information here to help diagnose the problem:

  • which format are you using, (LaTeX) pdf or typst? I assume typst only from the error message.
  • are you using the template, or trying to edit an existing document?
  • where did the quarto-ext folder come from? This extension doesn't create that folder.
  • how are you installing the extension? If you install using the instructions in the README, the installation process puts the files in the right place.

The _extensions folder should be in the root directory where your .qmd file is. Inside the _extensions folder, there should be a folder called nrennie. Inside there, there will be the PrettyPDF folder containing the relevant files. I'd suggest starting with installing the template and making sure you can get that running - it downloads the files and puts them in the correct place so you shouldn't need to think about where the files go.

What do you mean by even when copied into PrettyPDF - the Quarto files that you're rendering shouldn't be in the same folder as the extension itself. The Quarto files should be in the same directory as the _extensions folder i.e. where the template.qmd file is as an example.

@nrennie nrennie added the question Further information is requested label May 31, 2024
@mroberts1
Copy link
Author

  • which format are you using, (LaTeX) pdf or typst? I assume typst only from the error message.

typst

  • are you using the template, or trying to edit an existing document?

An existing .qmd document in the root directory

  • where did the quarto-ext folder come from? This extension doesn't create that folder.

It is a directory that contains two other extensions. Normally it lives in the root directory but it somehow got relocated to the _extensions directory when I installled PrettyPDF. I moved it back.

  • how are you installing the extension? If you install using the instructions in the README, the installation process puts the files in the right place.

'quarto install extension nrennie/PrettyPDF' in the terminal

The _extensions folder should be in the root directory where your .qmd file is. Inside the _extensions folder, there should be a folder called nrennie. Inside there, there will be the PrettyPDF folder containing the relevant files. I'd suggest starting with installing the template and making sure you can get that running - it downloads the files and puts them in the correct place so you shouldn't need to think about where the files go.

All this is correct, but I don't see a PrettyPDF template file (pdf?). Do I have to download it separately? If so, which directory should it go in?

What do you mean by even when copied into PrettyPDF - the Quarto files that you're rendering shouldn't be in the same folder as the extension itself. The Quarto files should be in the same directory as the _extensions folder i.e. where the template.qmd file is as an example.

That's correct, but I'm still getting the same error message (see attached) - the extension can't find logo.png, even though it's in the right directory and the path is correct.

Screen Shot 2024-06-09 at 08 53 53

FYI my _quarto.yml file contains this:

format:
    PrettyPDF-typst:
     papersize: us-letter
     mainfont: "Source Sans"
     fontsize: 14pt
     margin:
       x: 1.25in
       y: 1.25in

@nrennie
Copy link
Owner

nrennie commented Jun 11, 2024

I still can't reproduce your error unfortunately. Can you please confirm that your directory structure looks like the example here: https://github.com/nrennie/quarto-examples/tree/main/PrettyPDF%20Example

Can you render the document.qmd file in the example linked above?

@mroberts1
Copy link
Author

I still can't figure out what the problem is. I have the extensions folder correctly installed in the root directory, and am trying to generate a PrettyPDF-typst file from the front matter of an index.qmd file.

You can take a look at the repo here: mroberts1/entangled-lives.

The error I'm getting now is about a duplicate title entry - the problem is that the subtitle is being read as a duplicate title. I checked typst-show.typ but the subtitle field appears to be correct, so I don't know why my subtitle field isn't being parsed correctly.

@nrennie
Copy link
Owner

nrennie commented Jun 23, 2024

I've had a look at the GitHub repo you shared, I can't render it at all since the img folder isn't on GitHub. (Generally you might want to think about conditional content (https://quarto.org/docs/authoring/conditional.html) since there's code to add videos which doesn't work in PDF)

The subtitle doesn't render for me in normal Typst output:

---
title: "My title"
subtitle: "My subtitle"
format: typst
---
Test

as a minimum reproducible example, you'll see that the subtitle doesn't appear but there is no error.

Reprex of your problem:

---
title: "My title"
subtitle: "My subtitle"
format: PrettyPDF-typst
---
Test

fails with duplicate title warning. I've removed any references to subtitle in the extension to get rid of the error (the subtitle still won't show as it doesn't in Typst, but it shouldn't error any more). Can you try re-installing the extension, and re-rendering? The updated version of PrettyPDF should now give the same behaviour for typst and PrettyPDF-typst. Please note that subtitles are not yet a native feature in Typst: quarto-dev/quarto-cli#9638, and have only just been added in Pandoc.

I'll put subtitle support on the to-do list once it's a bit more stable in Typst - see #4

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

No branches or pull requests

2 participants