Skip to content

Commit 25e5f40

Browse files
authored
Allow to install TinyTeX in install-quarto action (#10)
2 parents c448d92 + 490de79 commit 25e5f40

File tree

2 files changed

+39
-2
lines changed

2 files changed

+39
-2
lines changed

install-quarto/README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ This action will:
1010
* On Windows, it will for now use **Scoop** (https://github.com/ScoopInstaller/Scoop) to install Quarto, as we have still an issue with Quarto MSI on Github Action (https://github.com/quarto-dev/quarto-cli/issues/108). (**Scoop** will be installed on the runner by the action)
1111
* On Linux and MacOS, it will use **gh** CLI to download the last available bundle (no `version` specified as input). If you don't have **gh** on your Github Action runner, you can specify a fix `version` to directly download from a URL using `wget`.
1212

13-
Inputs available
13+
We recommend using this action on Linux or MacOS where it works best, especially if TinyTeX is needed.
14+
15+
### Inputs available
1416

1517
* `version` - _optional_. If provided, the specific quarto version will be installed. Ex: `version: 0.3.71`
1618

@@ -21,7 +23,17 @@ Inputs available
2123
version: 0.3.71
2224
```
2325
24-
Example on different OS:
26+
* `tinytex` - _optional_. Set this to `tinytex: true` to let [Quarto installs TinyTeX](https://quarto.org/docs/output-formats/pdf-engine.html#installing-tex) using `quarto tools install tinytex`. **Only available on `main` branch**
27+
_Notice: Installing TinyTeX on Windows takes long time several minutes and will make your all job longer_
28+
29+
```yaml
30+
steps:
31+
- uses: quarto-dev/quarto-actions/install-quarto@main
32+
with:
33+
tinytex: true
34+
```
35+
36+
### Example on different OS
2537

2638
```yaml
2739
name: quarto-setup

install-quarto/action.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ inputs:
55
version:
66
description: 'The version of Quarto CLI to install, as a release tag (https://github.com/quarto-dev/quarto-cli/releases). Ex: 0.3.73'
77
required: false
8+
tinytex:
9+
description: 'Should TinyTex be installed for PDF rendering using TeX Live ?'
10+
required: false
11+
default: 'false'
812
runs:
913
using: 'composite'
1014
steps:
@@ -72,3 +76,24 @@ runs:
7276
[ ${{ runner.os }} != "Windows" ] && rm $installer
7377
echo "Quarto Installed !"
7478
shell: bash
79+
- name: Install TinyTeX
80+
if: ${{ inputs.tinytex == 'true'}}
81+
run: |
82+
quarto tools install tinytex --log-level warning
83+
case $RUNNER_OS in
84+
"Linux")
85+
echo "$HOME/bin" >> $GITHUB_PATH
86+
;;
87+
"macOS")
88+
echo "$(dirname $(find ~/Library/TinyTeX -name tlmgr))" >> $GITHUB_PATH
89+
;;
90+
"Windows")
91+
echo "$(dirname $(find $APPDATA/TinyTeX -name tlmgr.bat))" >> $GITHUB_PATH
92+
;;
93+
*)
94+
echo "$RUNNER_OS not supported"
95+
exit 1
96+
;;
97+
esac
98+
echo "TinyTeX installed !"
99+
shell: bash

0 commit comments

Comments
 (0)