Commit d224bbb3 authored by Joachim Breitner's avatar Joachim Breitner Committed by Joachim Breitner

nofib-analyize: Include % in LaTeX output

I see no reason why this should be different from the text output,
especially as it is important to distinguish absolute from relative
values in the runtime column. It is also easier to remove the % (using
search-and-replace) than to add it.
parent a557442e
......@@ -586,10 +586,7 @@ ascii_summary_table latex (rbase:rs) (_:names) specs mb_restrict
progs = map BoxString (Map.keys rbase)
rows0 = map TableRow (zipWith (:) progs (transpose columns))
rows1 = restrictRows mb_restrict rows0
rows | latex = mungeForLaTeX rows1
| otherwise = rows1
rows = restrictRows mb_restrict rows0
av_rows = map TableRow (zipWith (:) av_heads (transpose av_cols))
w = sUMMARY_FIELD_WIDTH
......@@ -614,18 +611,6 @@ restrictRows (Just these) rows = filter keep_it rows
keep_it TableLine = True
keep_it _ = False
mungeForLaTeX :: [TableRow] -> [TableRow]
mungeForLaTeX = map transrow
where
transrow (TableRow boxes) = TableRow (map transbox boxes)
transrow row = row
transbox (BoxString s) = BoxString (foldr transchar "" s)
transbox box = box
transchar '_' s = '\\':'_':s
transchar c s = c:s
table_layout :: Int -> Int -> Layout
table_layout n w boxes = foldr (.) id $ intersperse (str (space 1)) $ zipWith ($) fns boxes
where fns = (str . rjustify 15 . show ) :
......@@ -949,10 +934,14 @@ latexTableLayout boxes =
foldr (.) id . intersperse (str " & ") . map abox $ boxes
where
abox (RunFailed NotDone) = id
abox s = str (foldr transchar "" (show s))
abox s = str (mungeForLaTeX (show s))
transchar '%' s = s -- leave out the percentage signs
transchar c s = c : s
mungeForLaTeX :: String -> String
mungeForLaTeX = foldr transchar ""
where
transchar '_' s = '\\':'_':s
transchar '%' s = '\\':'%':s
transchar c s = c:s
-- -----------------------------------------------------------------------------
-- General Utils
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment