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

PDF/Tinytex and Typst #9

Closed
jgeller112 opened this issue Jan 19, 2025 · 7 comments · Fixed by #10
Closed

PDF/Tinytex and Typst #9

jgeller112 opened this issue Jan 19, 2025 · 7 comments · Fixed by #10

Comments

@jgeller112
Copy link
Owner

Hi @b-rodrigues,

I am trying to get a pipeline where pdf and typst documents can be rendered and am running into some issues. For PDF I usually use tinytex package which requires TinyTex. I cant seem to get that to load as a system-wide dependency (is it called something else in nix store?). I cant get apaquarto-typst to work either to create a pdf. Any suggestions?

@jgeller112
Copy link
Owner Author

Would something like this work?

  shellHook = ''
    echo "Installing TinyTeX..."
    curl -fsSL https://yihui.org/tinytex/install-unx.sh | sh
    export PATH=$HOME/.TinyTeX/bin/x86_64-linux:$PATH
    echo "TinyTeX installed!"
  '';
}

@b-rodrigues
Copy link
Contributor

b-rodrigues commented Jan 20, 2025

For PDF rendering your best bet is to install tex packages from Nix directly. tinytex works by installing packages once it’s called, which is not easy to get to work with Nix. See: https://docs.ropensci.org/rix/articles/d2-installing-system-tools-and-texlive-packages-in-a-nix-environment.html#installing-texlive-packages

basically just add the required tex packages to tex_pkgs

@jgeller112
Copy link
Owner Author

jgeller112 commented Jan 20, 2025

I'll figure out what Tex packages are included in tinytex and just install those via the method outlined in the doc.

There is still the typst issue but maybe I'll forget that for now.

@jgeller112
Copy link
Owner Author

Not having luck with any Tex packages, lol.

@b-rodrigues
Copy link
Contributor

b-rodrigues commented Jan 20, 2025

try with

  tex_pkgs = c("amsmath", "ninecolors", "apa7", "scalerel", "threeparttable", "threeparttablex", "endfloat", "environ", "multirow", "tcolorbox", "pdfcol", "tikzfill", "fontawesome5", "framed", "newtx", "fontaxes", "xstring", "wrapfig", "tabularray", "siunitx"), 

it should work, however the default font from the template is times new roman which causes issues. I’m trying to see what can be done.

what’s the typst issue?

@jgeller112
Copy link
Owner Author

jgeller112 commented Jan 20, 2025

font issue: wjschne/apaquarto#98

@jgeller112
Copy link
Owner Author

When using Typst:

[typst]: Compiling L2_VWP_webcam_ET.typ to L2_VWP_webcam_ET.pdf...warning: `style` is deprecated
    ┌─ _manuscript/L2_VWP_webcam_ET.typ:180:11
    │  
180 │   #let TeX = style(styles => {
    │ ╭────────────^
181 │ │   set text(font: ("New Computer Modern", "Times", "Times New Roman"))
182 │ │   let e = measure("E", styles)
183 │ │   let T = "T"
    · │
186 │ │   box(T + h(-0.15em) + E + h(-0.125em) + X)
187 │ │ })
    │ ╰──^
    │  
    = hint: use a `context` expression instead
warning: `style` is deprecated
    ┌─ _manuscript/L2_VWP_webcam_ET.typ:188:13
    │  
188 │   #let LaTeX = style(styles => {
    │ ╭──────────────^
189 │ │   set text(font: ("New Computer Modern", "Times", "Times New Roman"))
190 │ │   let a-size = 0.66em
191 │ │   let l = measure("L", styles)
    · │
195 │ │   box(L + h(-a.width * 0.67) + A + h(-a.width * 0.25) + TeX)
196 │ │ })
    │ ╰──^
    │  
    = hint: use a `context` expression instead
error: file not found (searched at /home/runner/work/L2_VWP_Webcam/L2_VWP_Webcam/_manuscript/\_extensions/wjschne/apaquarto/apa.csl)
     ┌─ _manuscript/L2_VWP_webcam_ET.typ:1914:25
     │
1914 │ #set bibliography(style: "\_extensions/wjschne/apaquarto/apa.csl") 

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

Successfully merging a pull request may close this issue.

2 participants