Open nomeata opened 6 years ago
Writing another paper with the same desired layout, and looking at the code what can be done.
I don’t quite understand in display
in polyCode
why with autoSpacing = False
the indentation (the stuff that inserts calls to \hsindent
) doesn’t seem to work. The leftIndent
function seems to run no matter what…
Ah, this seems to help:
diff --git a/src/MathPoly.lhs b/src/MathPoly.lhs
index 54e66cb..8e6ce2d 100644
--- a/src/MathPoly.lhs
+++ b/src/MathPoly.lhs
@@ -345,8 +345,9 @@ As a final step, the current line is placed on the stack.
> Blank -> loop True stack ls -- ignore blank lines
> {-| Poly x || trace (show x) False -> undefined |-}
> Poly [] -> loop True stack ls -- next line
-> Poly (((_n,_c),[],_ind):rs)
-> | first -> loop True stack (Poly rs:ls) -- ignore leading blank columns
+> Poly (((_n,_c),ts,_ind):rs)
+> | first, all (not . isNotSpace . token) ts
+> -> loop True stack (Poly rs:ls) -- ignore leading blank columns
> Poly p@(((n,c),ts,_ind):rs)
> | first -> -- check indentation
> let -- step 1: shrink stack
With autoSpacing = False
the space tokens are still there, and it would be reasonable for the leftIndent
code to treat columns with leading spaces as indentation columns.
I really like
lhs2Tex
for its vertical alignment, but somtimes other features get into the way. I would therefore love to have apolytext
mode that doesformat
)polytable
, butI use this file right now
It gives me almost all of my wishes, with the exception of the last point (the space-counting hack is an attempt to mitigate that, but does not work nicely.
Some thing could be simplified further, I think.
I would appreciate if such a style could be included in lhs2tex. Or, as a first step, it would be great if I could say
autoSpacing = False
but (something like)autoIndent = True
.