From 078d4dfc3815db205e90dd527e66473a6f25d9fb Mon Sep 17 00:00:00 2001 From: Dimitry Ivanov Date: Mon, 3 Dec 2018 17:58:24 +0300 Subject: [PATCH] Add README to ext-latex module --- markwon-ext-latex/README.md | 46 +++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 markwon-ext-latex/README.md diff --git a/markwon-ext-latex/README.md b/markwon-ext-latex/README.md new file mode 100644 index 00000000..5937fd6b --- /dev/null +++ b/markwon-ext-latex/README.md @@ -0,0 +1,46 @@ +# LaTeX + +This is a small extension that will help you display LaTeX formulas in your markdown. +Syntax is pretty simple: pre-fix and post-fix your latex with `$$` (double dollar sign). +`$$` should be the first characters in a line. + +```markdown +$$ +\\text{A long division \\longdiv{12345}{13} +$$ +``` + +```markdown +$$\\text{A long division \\longdiv{12345}{13}$$ +``` + +```java +Markwon.builder(context) + .use(CorePlugin.create()) + .use(ImagesPlugin.create(context)) + .use(JLatexMathPlugin.create(new Config(textSize)) + .build(); +``` + +This extension uses [jlatexmath-android](https://github.com/noties/jlatexmath-android) artifact to create LaTeX drawable. Then it +registers special `latex` image scheme handler and uses `AsyncDrawableLoader` to display +final result + +## Config + +```java +public static class Config { + + protected final float textSize; + + protected Drawable background; + + @JLatexMathDrawable.Align + protected int align = JLatexMathDrawable.ALIGN_CENTER; + + protected boolean fitCanvas = true; + + protected int padding; +} +``` +