Skip to content

Commit

Permalink
Make latex output complete (parseable)
Browse files Browse the repository at this point in the history
  • Loading branch information
eyihluyc committed Dec 4, 2024
1 parent 9338f09 commit 06ef448
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions eo-phi-normalizer/app/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ main = withUtf8 do
Nothing -> do
ruleSet :: RuleSet <- decodeThrow $(embedFileRelative "test/eo/phi/rules/new.yaml")
return (False, ruleSet.title, convertRuleNamed <$> ruleSet.rules)
unless (single || json || (chain && latex)) $ logStrLn ruleSetTitle
unless (single || json || latex) $ logStrLn ruleSetTitle
bindingsWithDeps <- case deepMergePrograms (program' : deps) of
Left err -> throw (CouldNotMergeDependencies err)
Right (Program bindingsWithDeps) -> return bindingsWithDeps
Expand Down Expand Up @@ -647,8 +647,19 @@ main = withUtf8 do
logStrLn [fmtTrim|{linesCombined}|]
logStrLn "\\end{phiquation*}"
logStrLn "\n\\end{document}"
| latex ->
| latex -> do
logStrLn
[fmtTrim|
% {ruleSetTitle}

\\documentclass{{article}}
\\usepackage{{eolang}}
\\begin{{document}}
|]
logStrLn "\\begin{phiquation*}"
logStrLn . toLatexString $ logEntryLog (head (head uniqueResults))
logStrLn "\\end{phiquation*}"
logStrLn "\n\\end{document}"
| otherwise -> do
logStrLn "Input:"
logStrLn (printTree program')
Expand Down

0 comments on commit 06ef448

Please sign in to comment.