From ff626a5ee203765b38d98160c43037f3fbc73894 Mon Sep 17 00:00:00 2001 From: Justin McCarthy Date: Mon, 28 May 2018 16:46:35 -0500 Subject: [PATCH] pandoc must also include pdflatex --- internal/cli/app.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/internal/cli/app.go b/internal/cli/app.go index 42b0384..e4bf7e8 100644 --- a/internal/cli/app.go +++ b/internal/cli/app.go @@ -144,6 +144,18 @@ func pandocBinaryMustExist(c *cli.Context) error { if major < 2 || minor < 1 { return errors.New("pandoc 2.1 or greater required") } + + // pdflatex must also be present + cmd = exec.Command("pdflatex", "-v") + outputRaw, err = cmd.Output() + if err != nil { + return errors.Wrap(err, "error calling pdflatex") + } + + if !strings.Contains(string(outputRaw), "TeX") { + return errors.New("pdflatex is required") + } + return nil }