如何使用 texlive 設定 Azure DevOps 管道?

如何使用 texlive 設定 Azure DevOps 管道?

我有一個包含 LaTeX.tex檔案的儲存庫。在每次提交中,我都希望有一個管道來使用它們建立 PDF。

我已經使用該命令創建了一個管道pdflatex main.tex

但是,texlive沒有安裝在vm中。所以我收到錯誤:

/home/.../f170215a.sh: line 2: pdflatex: command not found

如何解決這個問題? Azure 中是否有安裝 texlive 的基於雲端的 VM 選項?或者我必須為此創建自己的虛擬機器?

管道yaml如下:

trigger:
- master
pool:
  vmImage: 'ubuntu-latest'
steps:
- bash: | 
    echo Starting pdflatex
    pdflatex -interaction=nonstopmode main.tex
    echo Done pdflatex.

答案1

第一部分透過在管道腳本中安裝需求來解決:

sudo apt-get install texlive

yml 管道如下圖所示:

trigger:
- master
pool:
  vmImage: 'ubuntu-latest'
steps:
- bash: | 
    sudo apt-get install texlive     
    echo Starting pdflatex
    pdflatex -interaction=nonstopmode main.tex
    echo Done pdflatex.

現在我只需要檢索 pdf 檔。但這是另一個話題了=)

相關內容