@@ -743,7 +743,7 @@ main = do
743743 then "html"
744744 else "markdown"
745745 in defaultReaderName fallback sources
746− else readerName
746+ else readerName
747747
748748 let writerName' = if null writerName
749749 then defaultWriterName outputFile
@@ -753,8 +753,10 @@ main = do
753753 Just r -> return r
754754 Nothing -> error ("Unknown reader: " ++ readerName')
755755
756+ let standalone' = standalone || isNonTextOutput writerName'
757+
756758 templ <- case templatePath of
757− _ | not standalone -> return ""
759+ _ | not standalone' -> return ""
758760 Nothing -> do
759761 deftemp <- getDefaultTemplate datadir writerName'
760762 case deftemp of
@@ -774,8 +776,6 @@ main = do
774776 (\_ -> throwIO e)
775777 else throwIO e)
776778
777− let standalone' = standalone || isNonTextOutput writerName'
778−
779779 variables' <- case mathMethod of
780780 LaTeXMathML Nothing -> do
781781 s <- readDataFile datadir $ "data" </> "LaTeXMathML.js"