PDF: allow custom writer as format if engine is explicitly specified (#7901)
Closes #7898. Note that it may be necessary to explicitly specify a template on the command line.
This commit is contained in:
parent
63deba49d4
commit
7dc59aa26a
1 changed files with 7 additions and 1 deletions
|
@ -254,6 +254,10 @@ pdfWriterAndProg mWriter mEngine =
|
|||
go Nothing Nothing = Right ("latex", "pdflatex")
|
||||
go (Just writer) Nothing = (writer,) <$> engineForWriter writer
|
||||
go Nothing (Just engine) = (,engine) <$> writerForEngine (takeBaseName engine)
|
||||
go (Just writer) (Just engine) | isCustomWriter writer =
|
||||
-- custom writers can produce any format, so assume the user knows
|
||||
-- what they are doing.
|
||||
Right (writer, engine)
|
||||
go (Just writer) (Just engine) =
|
||||
case find (== (baseWriterName writer, takeBaseName engine)) engines of
|
||||
Just _ -> Right (writer, engine)
|
||||
|
@ -271,6 +275,8 @@ pdfWriterAndProg mWriter mEngine =
|
|||
[] -> Left $
|
||||
"cannot produce pdf output from " <> w
|
||||
|
||||
isCustomWriter w = ".lua" `T.isSuffixOf` w
|
||||
|
||||
isTextFormat :: T.Text -> Bool
|
||||
isTextFormat s =
|
||||
s `notElem` ["odt","docx","epub2","epub3","epub","pptx","pdf"]
|
||||
|
|
Loading…
Reference in a new issue