Skip to content

Commit

Permalink
Merge pull request #253 from Mathpix/dev/olga/4417-support-underline-…
Browse files Browse the repository at this point in the history
…in-text-mode-v3

PR into master from dev/olga/4417-support-underline-in-text-mode-v3
  • Loading branch information
iammosespaulr authored Sep 11, 2023
2 parents 0fc0ee6 + 0b4f8ef commit 8a5f125
Show file tree
Hide file tree
Showing 25 changed files with 881 additions and 9 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ Auto increment counter to 8 \footnote{text should be 8}

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

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

# What is mathpix-markdown-it?

**mathpix-markdown-it** is an open source implementation of the mathpix-markdown spec written in Typescript.
Expand Down
Binary file added doc/images/latex-underline/latex-underline_01.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-underline/latex-underline_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 added doc/images/latex-underline/latex-underline_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-underline/latex-underline_04.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-underline/latex-underline_05.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-underline/latex-underline_06.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
83 changes: 83 additions & 0 deletions doc/latex-underline.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
## Underline, bold and italize text

We can print bold, italicized, and underlined text using the commands `\textbf`, `\textit`, and `\underline`, respectively.

For example:
```
\textbf{Bold text}
\textit{Italic text}
\underline{Underlined text}
```

This example produces the following output:

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


## Double underline

Double underlining text can be done easily using the command `\underline` twice or using the command `\uuline`:

```
\underline{\underline{Double underlined text!}}
\uuline{Double underlined text!}
```

produces the output:

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


## Wavy underlined text

We can easily create wavy underlined text using the command `\uwave{}`. Here is an illustrative example:

```
\uwave{This text is underlined with a wavy line!}
```

which produces the following result:

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


## Strikethrough text

The command `\sout{}` which can be used to strikethrough text. Check this example:

```
\sout{Text with a horizontal line through its center!}
```

compiling this code yields:

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


## Slash through letter

The command `\xout{}` can be used to create a hatching effect through text. Here is a basic usage of this command:

```
\xout{Text with hatching pattern!}
```

This code yields the following:

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


## Dashed and dotted underline

The commands `\dashuline{}` and `\dotuline{}` as their names state can be used to create dashed and dotted lines under text respectively. Check the following code:

```
\dashuline{Dashed Underline}
\dotuline{Dotted Underline}
```

which produces the following output:

![](images/latex-underline/latex-underline_06.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.

3 changes: 3 additions & 0 deletions lib/markdown/md-inline-rule/underline.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { RuleInline } from 'markdown-it';
export declare const textUnderline: RuleInline;
export declare const textOut: RuleInline;
200 changes: 200 additions & 0 deletions lib/markdown/md-inline-rule/underline.js

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

1 change: 1 addition & 0 deletions lib/markdown/md-inline-rule/underline.js.map

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

5 changes: 5 additions & 0 deletions lib/markdown/md-renderer-rules/underline.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export declare const renderUnderlineText: (tokens: any, idx: any, options: any, env: any, slf: any) => string;
export declare const renderUnderlineOpen: (tokens: any, idx: any, options: any, env: any, slf: any) => string;
export declare const renderUnderlineClose: (tokens: any, idx: any, options: any, env: any, slf: any) => string;
export declare const renderOutOpen: (tokens: any, idx: any, options: any, env: any, slf: any) => string;
export declare const renderOutText: (tokens: any, idx: any, options: any, env: any, slf: any) => any;
Loading

0 comments on commit 8a5f125

Please sign in to comment.