forked from leftaroundabout/Symbolic-math-HaTeX
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTeX-my-math.cabal
93 lines (90 loc) · 4.12 KB
/
TeX-my-math.cabal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
Name: TeX-my-math
Version: 0.201.2.0
Category: math
Synopsis: Render general Haskell math to LaTeX. Or: math typesetting with high signal-to-noise–ratio.
Description: For tl;dr: look at <https://github.com/leftaroundabout/Symbolic-math-HaTeX/blob/master/EXAMPLES.md>.
.
This is an attempt to get convenient math syntax in HaTeX (i.e., in data structures
compatible \/ convertable to those from <http://hackage.haskell.org/package/HaTeX>).
.
The idea is to combine these features:
.
* Full access to the math-typesetting power of LaTeX. It should be possible to express
any formula that might be found in a typical mathematics or physics journal article.
This should also include expression which are not quite well-defined from a programming
point of view, but are clear to the intended audience.
.
* Idiomatic Haskell syntax. Who wants to bother with unreadable expressions involving
either hundreds of double-backslashes or extra syntax overhead in wrapping them
explicitly into HaTeX?
.
Ideally, one would write expressions as if only meaning Haskell to /calculate/ them,
but get the result back as a full pretty-printing LaTeX math string. /And the actual
calculated result as well/, if possible!
.
To this end, we use a minimal symbolic-manipulation EDSL, namely
<http://hackage.haskell.org/package/dumb-cas dumb-cas>, set up in a way so the
leaves of the syntax tree, i.e. the individual symbols, are represented by LaTeX
expressions in memory and by single-letter variables in the Haskell code.
These can then be combined with operators corresponding to LaTeX's maths operators,
to obtain a very compact and almost WYSIWYG-like code appearance, while retaining
the ability to apply any LaTeX-specific tweaks whenever necessary. At the same
time, because the AST is fully precedence-aware, it is safely possible to transform
the expressions via e.g. Template Haskell, to actually compute concrete numerical
results, or apply exact symbolic-manipulation techniques.
License: GPL-3
License-file: COPYING
Author: Justus Sagemüller
Maintainer: (@) jsag $ hvl.no
Homepage: http://github.com/leftaroundabout/Symbolic-math-HaTeX
Build-Type: Simple
Cabal-Version: >=1.10
Library
Build-Depends: base>=4.8 && <4.14
, HaTeX>3.22.2.0
, vector-space
, dumb-cas >= 0.2 && < 0.3
, decimal-literals
, text
, void
, hashable, unordered-containers
, template-haskell, haskell-src-meta
Exposed-modules: Math.LaTeX.Prelude
Math.LaTeX.StringLiterals
Math.LaTeX.Internal.MathExpr
Math.LaTeX.Internal.Display
Other-modules: CAS.Dumb.LaTeX.Symbols
Math.LaTeX.Internal.OperatorGenerator
Default-Language: Haskell2010
test-suite makeSnippets
default-language:
Haskell2010
type:
exitcode-stdio-1.0
hs-source-dirs:
test/PdfSnippets
main-is:
MkSnippets.hs
Other-modules:
LaTeXComparer
build-depends:
base >= 4 && < 5
, template-haskell, haskell-src-meta
, dumb-cas
, HaTeX
, TeX-my-math
, text
, directory, filepath, process
executable TeXmyMath-example
default-language:
Haskell2010
hs-source-dirs:
example
main-is:
Simple.hs
build-depends:
base
, TeX-my-math
, HaTeX
, text
, directory, filepath, process