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

Still a problem with tikz #33

Closed
durandg12 opened this issue Nov 22, 2024 · 9 comments
Closed

Still a problem with tikz #33

durandg12 opened this issue Nov 22, 2024 · 9 comments
Assignees
Labels
question Further information is requested

Comments

@durandg12
Copy link

durandg12 commented Nov 22, 2024

Hello, I tried the workaround discussed in #20 and #24: for my two tikz diagrams I added the lines
%%| filename: ../figure-tikz/fig-tikz-01 and %%| filename: ../figure-tikz/fig-tikz-02.

But I still have a problem in html render. The execution fails in 2 to 4 secondes with the following error message:

Error running filter /Applications/quarto/share/filters/main.lua:
inkscape: createProcess: posix_spawnp: does not exist (No such file or directory)
stack traceback:
	...utorg/computo/_extensions/pandoc-ext/diagram/diagram.lua:421: in upvalue 'pdf2svg'
	...utorg/computo/_extensions/pandoc-ext/diagram/diagram.lua:573: in function <...utorg/computo/_extensions/pandoc-ext/diagram/diagram.lua:521>
	[C]: in ?
	[C]: in method 'walk'
	...utorg/computo/_extensions/pandoc-ext/diagram/diagram.lua:610: in function <...utorg/computo/_extensions/pandoc-ext/diagram/diagram.lua:608>
	[C]: in ?
	[C]: in method 'walk'
	/Applications/quarto/share/filters/main.lua:557: in local 'checked_walk'
	/Applications/quarto/share/filters/main.lua:609: in function 'run_emulated_filter'
	/Applications/quarto/share/filters/main.lua:1334: in local 'callback'
	[string "..."]:1888: in field 'withScriptFile'
	/Applications/quarto/share/filters/main.lua:1350: in upvalue 'run_emulated_filter_chain'
	/Applications/quarto/share/filters/main.lua:1388: in function </Applications/quarto/share/filters/main.lua:1385>
stack traceback:
	...utorg/computo/_extensions/pandoc-ext/diagram/diagram.lua:610: in function <...utorg/computo/_extensions/pandoc-ext/diagram/diagram.lua:608>
	[C]: in ?
	[C]: in method 'walk'
	/Applications/quarto/share/filters/main.lua:557: in local 'checked_walk'
	/Applications/quarto/share/filters/main.lua:609: in function 'run_emulated_filter'
	/Applications/quarto/share/filters/main.lua:1334: in local 'callback'
	[string "..."]:1888: in field 'withScriptFile'
	/Applications/quarto/share/filters/main.lua:1350: in upvalue 'run_emulated_filter_chain'
	/Applications/quarto/share/filters/main.lua:1388: in function </Applications/quarto/share/filters/main.lua:1385>
stack traceback:
	/Applications/quarto/share/filters/main.lua:557: in local 'checked_walk'
	/Applications/quarto/share/filters/main.lua:609: in function 'run_emulated_filter'
	/Applications/quarto/share/filters/main.lua:1334: in local 'callback'
	[string "..."]:1888: in field 'withScriptFile'
	/Applications/quarto/share/filters/main.lua:1350: in upvalue 'run_emulated_filter_chain'
	/Applications/quarto/share/filters/main.lua:1388: in function </Applications/quarto/share/filters/main.lua:1385>

Furthermore the folder figure-tikz is never created.

I installed and updated pdf2svg and lua with Homebrew (I'm running on macOS 13.6.3, Apple M2 chip, R 4.4.2, last RStudio version 2024.09.1+394).

@durandg12
Copy link
Author

Solved by installing inkscape

@durandg12
Copy link
Author

That said, the github action build still fails after pushing, so there is still something that needs a fix.

@durandg12 durandg12 reopened this Nov 22, 2024
@durandg12
Copy link
Author

The error I see in the logs of the github action is the same I had on my computer laptop before installing/updating inkscape

@fradav
Copy link
Contributor

fradav commented Dec 4, 2024

Which workflow are you using ? The one currently deployed on the templated (and used by the action on our extension) is working with tikz/inkscape. (We redesigned the whole workflow)

@fradav fradav self-assigned this Dec 4, 2024
@fradav fradav added the question Further information is requested label Dec 4, 2024
@durandg12
Copy link
Author

What do you mean by workflow ? Do you want to know the versions of the softs I have installed ? If so, which ones ?

@pneuvial
Copy link
Contributor

pneuvial commented Dec 4, 2024

@durandg12
Copy link
Author

I use this one

name: build

on:
  schedule:
    - cron: '0 0 * * 0' 
  workflow_dispatch:
  push:
    branches: main

jobs:
  build-deploy:
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
      - name: Check out repository
        uses: actions/checkout@v4

      - name: Set up quarto
        uses: quarto-dev/quarto-actions/setup@v2
        with:
          version: pre-release
          tinytex: true

      - name: register tinytex globally for diagram.lua
        run: |
          mkdir -p ~/.local/bin
          ~/.TinyTeX/bin/x86_64-linux/tlmgr update --self
          ~/.TinyTeX/bin/x86_64-linux/tlmgr option sys_bin ~/.local/bin
          ~/.TinyTeX/bin/x86_64-linux/tlmgr path add
          ~/.TinyTeX/bin/x86_64-linux/tlmgr install libertinus-fonts
  
      - name: Install Computo extension for Quarto
        run: |
            quarto add --no-prompt computorg/computo-quarto-extension

      - name: Install R
        uses: r-lib/actions/setup-r@v2
        with:
          r-version: '4.4.0'

      - name: Install R Dependencies with renv
        uses: r-lib/actions/setup-renv@v2
        with:
          cache-version: 1

      - name: Render and Publish
        uses: quarto-dev/quarto-actions/publish@v2
        with:
          target: gh-pages
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

I never changed it after forking the template. So I guess I should change it for the one linked by Pierre and try again?

@pneuvial
Copy link
Contributor

pneuvial commented Dec 4, 2024

Yes that would help, thanks!

@durandg12
Copy link
Author

Yes that would help, thanks!

Solved the issue, thanks!

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

3 participants