From 3a8ea1c022ae942cd6abc21f0940f7b014a809e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Tue, 5 Apr 2016 21:13:22 +0200 Subject: [PATCH 1/9] added asciimath submodule --- .gitmodules | 3 +++ asciimath | 1 + 2 files changed, 4 insertions(+) create mode 100644 .gitmodules create mode 160000 asciimath diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..bed46b0 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "asciimath"] + path = asciimath + url = https://github.com/Kerl13/AsciiMath.git diff --git a/asciimath b/asciimath new file mode 160000 index 0000000..00efad2 --- /dev/null +++ b/asciimath @@ -0,0 +1 @@ +Subproject commit 00efad24740eebf51e80c2e5f1f8b8b642d5bb4a From 5fe9cdf06ae86d024a985ba618149bcf6df35cee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Tue, 5 Apr 2016 22:31:38 +0200 Subject: [PATCH 2/9] update makefile to workwith asciimath, add example --- Makefile | 12 +++++++----- asciimath | 2 +- notes.md | 13 ++++++------- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index f5c2354..4c73b03 100644 --- a/Makefile +++ b/Makefile @@ -1,17 +1,15 @@ SOURCES = $(wildcard *.md) OUT = $(SOURCES:.md=.pdf) -HS_FILTERS_NAMES = nice-frac usual-fun +HS_FILTERS_NAMES = PY_FILTERS_NAMES = pandoc-svg.py -EXT_FILTERS = pandoc-crossref +EXT_FILTERS = asciimath/pandoc-asciimath HS_FILTERS = $(addprefix filters/, $(HS_FILTERS_NAMES)) PY_FILTERS = $(addprefix filters/, $(PY_FILTERS_NAMES)) FILTERS = $(PY_FILTERS) $(HS_FILTERS) $(EXT_FILTERS) -.SUFFIXES: .hs - -all: $(HS_FILTERS) $(OUT) +all: $(HS_FILTERS) asciimath/pandoc-asciimath $(OUT) $(OUT): pandoc -S --toc -t latex $(basename $@).md $(addprefix --filter=, $(FILTERS)) -o $@ @@ -19,11 +17,15 @@ $(OUT): $(HS_FILTERS): ghc --make $@.hs -o $@ +asciimath/pandoc-asciimath: + (cd asciimath; make filter) + clean: rm -f $(OUT) rm -f $(addprefix filters/, $(HS_FILTERS)) find . -name "*.pandoc.pdf" -delete deepclean: clean + (cd asciimath; make clean) rm -f $(HS_FILTERS) rm -f filters/*.hi filters/*.o diff --git a/asciimath b/asciimath index 00efad2..36146d2 160000 --- a/asciimath +++ b/asciimath @@ -1 +1 @@ -Subproject commit 00efad24740eebf51e80c2e5f1f8b8b642d5bb4a +Subproject commit 36146d2f796dccb07795b2b87a7c98a23e3d0f49 diff --git a/notes.md b/notes.md index f366418..65ebfe3 100644 --- a/notes.md +++ b/notes.md @@ -1,13 +1,8 @@ --- # Metadata -title: %title% -author: Lucas Verney +title: Example +author: Martin Pépin date: \today -# LaTeX headers -header-includes: - - \usepackage{dsfont} - - \usepackage{mathtools} - - \renewcommand{\arraystretch}{1.5} # Pandoc-crossref options cref: True chapters: True @@ -15,3 +10,7 @@ chapters: True \pagebreak +# Asciimath + +Soit $n in NN$, alors on a +$$ sum_(k=1)^n k^3 = ((n(n+1))/2)^2 $$ From a7fff76274750e4750878af3c67ca7e0a5b9f372 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Tue, 5 Apr 2016 22:34:59 +0200 Subject: [PATCH 3/9] Update README.md --- README.md | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 0fbd102..6c176a5 100644 --- a/README.md +++ b/README.md @@ -12,13 +12,8 @@ include them in the document easily. * Include [pandoc-crossref](https://github.com/lierdakil/pandoc-crossref) for easy numbering and referencing. -* Convert simple fractions like "(n / k)" to LaTeX's "\\frac{n}{k}" when n and -k are integers in a math environment. - -* automatically convert function names (cos, sin, exp, log) to their -LaTeX equivalent (\\cos and so on) when in a mathematical environment, -then taking out the useless leading `\`. - +* Include [asciimath](https://github.com/Kerl13/AsciiMath) for easy math typing + ## TODO * anything else like this that could help writing more readable LaTeX From 11da13a58c32fe9f7f3e64b76d5656af50977f97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Wed, 6 Apr 2016 12:49:40 +0200 Subject: [PATCH 4/9] update submodule --- asciimath | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asciimath b/asciimath index 36146d2..2571699 160000 --- a/asciimath +++ b/asciimath @@ -1 +1 @@ -Subproject commit 36146d2f796dccb07795b2b87a7c98a23e3d0f49 +Subproject commit 25716992d721200dd1bedc08af3fec4715114935 From 8035f98127e42ca9b41f0ed11fa48276d1cc2856 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Wed, 6 Apr 2016 18:50:16 +0200 Subject: [PATCH 5/9] update submodule --- asciimath | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asciimath b/asciimath index 2571699..7de9230 160000 --- a/asciimath +++ b/asciimath @@ -1 +1 @@ -Subproject commit 25716992d721200dd1bedc08af3fec4715114935 +Subproject commit 7de923080820749a89baa9af0e1f5dab5c1f72fd From d0257fea0e245fea373baf47621c4bc6ae60fb53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Mon, 11 Apr 2016 14:22:52 +0200 Subject: [PATCH 6/9] update submodule; enhance Makefile --- Makefile | 8 +++++--- asciimath | 2 +- notes.md | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 4c73b03..0112f6e 100644 --- a/Makefile +++ b/Makefile @@ -11,14 +11,16 @@ FILTERS = $(PY_FILTERS) $(HS_FILTERS) $(EXT_FILTERS) all: $(HS_FILTERS) asciimath/pandoc-asciimath $(OUT) -$(OUT): - pandoc -S --toc -t latex $(basename $@).md $(addprefix --filter=, $(FILTERS)) -o $@ +.SUFFIXES: .md .pdf + +%.pdf: %.md + pandoc -S --toc -t latex $< $(addprefix --filter=, $(FILTERS)) -o $@ $(HS_FILTERS): ghc --make $@.hs -o $@ asciimath/pandoc-asciimath: - (cd asciimath; make filter) + (cd asciimath; make) clean: rm -f $(OUT) diff --git a/asciimath b/asciimath index 7de9230..a6345b7 160000 --- a/asciimath +++ b/asciimath @@ -1 +1 @@ -Subproject commit 7de923080820749a89baa9af0e1f5dab5c1f72fd +Subproject commit a6345b7305ef46096647b9f60eb16a772c113e28 diff --git a/notes.md b/notes.md index 65ebfe3..0953d9d 100644 --- a/notes.md +++ b/notes.md @@ -10,7 +10,7 @@ chapters: True \pagebreak -# Asciimath +# AsciiMath example Soit $n in NN$, alors on a $$ sum_(k=1)^n k^3 = ((n(n+1))/2)^2 $$ From a4ab2590d75c3b3b1ceae79742a862c44b5d0503 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Mon, 11 Apr 2016 15:01:26 +0200 Subject: [PATCH 7/9] move asciimath folder in filters/ --- .gitmodules | 2 +- Makefile | 2 +- asciimath => filters/asciimath | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename asciimath => filters/asciimath (100%) diff --git a/.gitmodules b/.gitmodules index bed46b0..bfec907 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "asciimath"] - path = asciimath + path = filters/asciimath url = https://github.com/Kerl13/AsciiMath.git diff --git a/Makefile b/Makefile index 0112f6e..cb52c1c 100644 --- a/Makefile +++ b/Makefile @@ -28,6 +28,6 @@ clean: find . -name "*.pandoc.pdf" -delete deepclean: clean - (cd asciimath; make clean) + (cd filters/asciimath; make clean) rm -f $(HS_FILTERS) rm -f filters/*.hi filters/*.o diff --git a/asciimath b/filters/asciimath similarity index 100% rename from asciimath rename to filters/asciimath From 0ddd5d7b5828e3ee59ce36f30ef034b86e22d415 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Tue, 12 Apr 2016 12:51:16 +0200 Subject: [PATCH 8/9] Fix a bug in the Makefile --- Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index cb52c1c..be5f167 100644 --- a/Makefile +++ b/Makefile @@ -1,15 +1,16 @@ SOURCES = $(wildcard *.md) OUT = $(SOURCES:.md=.pdf) +ASCIIMATH=filters/asciimath/pandoc-asciimath HS_FILTERS_NAMES = PY_FILTERS_NAMES = pandoc-svg.py -EXT_FILTERS = asciimath/pandoc-asciimath +EXT_FILTERS = $(ASCIIMATH) HS_FILTERS = $(addprefix filters/, $(HS_FILTERS_NAMES)) PY_FILTERS = $(addprefix filters/, $(PY_FILTERS_NAMES)) FILTERS = $(PY_FILTERS) $(HS_FILTERS) $(EXT_FILTERS) -all: $(HS_FILTERS) asciimath/pandoc-asciimath $(OUT) +all: $(HS_FILTERS) $(ASCIIMATH) $(OUT) .SUFFIXES: .md .pdf @@ -19,8 +20,8 @@ all: $(HS_FILTERS) asciimath/pandoc-asciimath $(OUT) $(HS_FILTERS): ghc --make $@.hs -o $@ -asciimath/pandoc-asciimath: - (cd asciimath; make) +$(ASCIIMATH): + (cd filters/asciimath; make) clean: rm -f $(OUT) From 1095bfca244cc9a66633489900f569997b137a00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Tue, 12 Apr 2016 22:46:46 +0200 Subject: [PATCH 9/9] update submodule --- filters/asciimath | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filters/asciimath b/filters/asciimath index a6345b7..d68cf88 160000 --- a/filters/asciimath +++ b/filters/asciimath @@ -1 +1 @@ -Subproject commit a6345b7305ef46096647b9f60eb16a772c113e28 +Subproject commit d68cf88317451fc4ae04244802a0992afe91b6b7