Given yarn build being your regular build script,
netlify.toml:
[build]
# Our default build command
command = "./install-latex.sh 'yarn build'"Any script run by yarn build will have the regular LaTeX executables available in PATH (pdflatex, etc.)