Skip to content

Commit

Permalink
Merge pull request #275 from Mathpix/dev/olga/5611-Add-the-ability-to…
Browse files Browse the repository at this point in the history
…-display-unnumbered-footnotes-v1

PR into master from dev/olga/5611-Add-the-ability-to-display-unnumbered-footnotes-v1
  • Loading branch information
iammosespaulr authored Sep 22, 2023
2 parents 8a5f125 + ed731b8 commit 75e0d7b
Show file tree
Hide file tree
Showing 76 changed files with 962 additions and 296 deletions.
50 changes: 37 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ OC(=O)c1cc(Cl)cs1

- [theorems and proofs](doc/theorems.md)

```text
```tex
\newtheorem{theorem}{Theorem}
\newtheorem{lemma}[theorem]{Lemma}
Expand All @@ -84,7 +84,7 @@ proceed from there and at some point you will arrive to a contradiction.

- [Latex footnotes](doc/latex-footnotes.md)

```text
```tex
Footnote marker without text. Auto increment counter to 1 \footnotemark{} should be 1.
Footnote marker with text. Auto increment counter to 2 \footnotemark{} be 2. \footnotetext{text should be 2}
Expand All @@ -106,6 +106,24 @@ Auto increment counter to 8 \footnote{text should be 8}

- [Latex underline](doc/latex-underline.md)

```tex
Underline text: \underline{Underlined text!}
Underline text: \uline{Underlined text!}
Double underline text: \underline{\underline{Double underlined text!}}
Double underline text: \uuline{Double underlined text!}
Wavy underlined text: \uwave{This text is underlined with a wavy line!}
Dashed underline text: \dashuline{Dashed Underline}
Dotted underline text: \dotuline{Dotted Underline}
Strikethrough text: \sout{Text with a horizontal line through its center!}
Struck with Hatching text: \xout{Text with hatching pattern!}
```

![](doc/images/latex-underline/latex-underline_07.png)

# What is mathpix-markdown-it?

**mathpix-markdown-it** is an open source implementation of the mathpix-markdown spec written in Typescript.
Expand Down Expand Up @@ -692,6 +710,7 @@ The `MathpixMarkdown` React element accepts the following props:
| `smiles` | [ISmilesOptions](https://github.com/Mathpix/mathpix-markdown-it#ismilesoptions);*`{}`* | Sets options to output chemistry equation |
| `parserErrors` | [ParserErrors](https://github.com/Mathpix/mathpix-markdown-it#parsererrors);*`{}`* | Sets options to output parser errors for equations and tabular |
| `codeHighlight` | [CodeHighlight](https://github.com/Mathpix/mathpix-markdown-it#codehighlight);*`{}`* | Sets options to highlight code block |
| `footnotes` | [Footnotes](https://github.com/Mathpix/mathpix-markdown-it#footnotes);*`{}`* | Sets options to footnotes |


## MathpixMarkdownModel methods
Expand Down Expand Up @@ -741,6 +760,7 @@ The `MathpixMarkdown` React element accepts the following props:
| `enableCodeBlockRuleForLatexCommands`| boolean;*`false`* | By default, if latex commands are indented (4 spaces / 1 tab) they do not become `Code Blocks`. |
| `parserErrors` | [ParserErrors](https://github.com/Mathpix/mathpix-markdown-it#parsererrors);*`{}`* | Sets options to output parser errors for equations and tabular |
| `codeHighlight` | [CodeHighlight](https://github.com/Mathpix/mathpix-markdown-it#codehighlight);*`{}`* | Sets options to highlight code block |
| `footnotes` | [Footnotes](https://github.com/Mathpix/mathpix-markdown-it#footnotes);*`{}`* | Sets options to footnotes |

### optionsMathpixMarkdown

Expand Down Expand Up @@ -771,6 +791,7 @@ The `MathpixMarkdown` React element accepts the following props:
| `enableCodeBlockRuleForLatexCommands`| boolean;*`false`* | By default, if latex commands are indented (4 spaces / 1 tab) they do not become `Code Blocks`. |
| `parserErrors` | [ParserErrors](https://github.com/Mathpix/mathpix-markdown-it#parsererrors);*`{}`* | Sets options to output parser errors for equations and tabular |
| `codeHighlight` | [CodeHighlight](https://github.com/Mathpix/mathpix-markdown-it#codehighlight);*`{}`* | Sets options to highlight code block |
| `footnotes` | [Footnotes](https://github.com/Mathpix/mathpix-markdown-it#footnotes);*`{}`* | Sets options to footnotes |

### TOutputMath

Expand Down Expand Up @@ -831,16 +852,6 @@ The `MathpixMarkdown` React element accepts the following props:
| `includeStyles` | boolean *`false`* | Includes mathpix-markdown styles |
| `includeFonts` | boolean *`false`* | Includes mathpix-markdown fonts |


### TAccessibility

| | type *`default`* | description
|-----------------------------|-----------------------------|--------------------------------------------------------------------------------------------------------------------------------------------|
| `assistiveMml` | boolean *`false`* | Should Assistive MathML be enabled to math (mjx-container). |
| `sre` | object *`null`* | spe object from library [speech-rule-engine](https://www.npmjs.com/package/speech-rule-engine) for semantic interpretation. |
| | | If this value is not set then the aria-label for accessibility will not be added to the math at render time. |


### ParserErrors enum

| | |
Expand All @@ -856,8 +867,21 @@ The `MathpixMarkdown` React element accepts the following props:
| `auto` | boolean *`false`* | Highlighting with language detection |
| `code` | boolean *`true`* | Add code highlighting for a code block which created by indenting. To auto-detect the language, set auto=true |

`sre` Has different loaders for node and browser.
### Footnotes

| | type *`default`* | |
|----------------|-----------------------------|-------------------------------------------|
| `fontSize` | string *`unset`* | Ability to change font size for footnotes |

### TAccessibility

| | type *`default`* | description
|-----------------------------|-----------------------------|--------------------------------------------------------------------------------------------------------------------------------------------|
| `assistiveMml` | boolean *`false`* | Should Assistive MathML be enabled to math (mjx-container). |
| `sre` | object *`null`* | spe object from library [speech-rule-engine](https://www.npmjs.com/package/speech-rule-engine) for semantic interpretation. |
| | | If this value is not set then the aria-label for accessibility will not be added to the math at render time. |

`sre` Has different loaders for node and browser.
1. For **Browser libraries**, synchronous loading is used.
```js
import { loadSre } from "mathpix-markdown-it/lib/sre/sre-browser";
Expand Down
Binary file modified doc/images/latex-footnotes/latex-footnotes_02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/images/latex-footnotes/latex-footnotes_03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/latex-footnotes/latex-footnotes_04.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions doc/latex-footnotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,18 @@ footnote\footnotetext{Specifically, I'd write comments in this one.}.
This example produces the following output:

![](images/latex-footnotes/latex-footnotes_03.png)


## Example: using `\blfootnotetext`

The `\blfootnotemark` command allows to add footnotes without a marker

```tex
The footnote \footnote{Footnote with marker}
\blfootnotetext{Footnote without marker}
```

This example produces the following output:

![](images/latex-footnotes/latex-footnotes_04.png)
2 changes: 1 addition & 1 deletion es5/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion es5/index.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions lib/components/mathpix-markdown/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/components/mathpix-markdown/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 75e0d7b

Please sign in to comment.