Skip to content

Commit

Permalink
doc updates
Browse files Browse the repository at this point in the history
  • Loading branch information
arnog committed May 12, 2021
1 parent 1fdbc6c commit 14be145
Show file tree
Hide file tree
Showing 11 changed files with 1,619 additions and 49 deletions.
Original file line number Diff line number Diff line change
@@ -1,54 +1,53 @@
MathLive supports over 700 standard TeX and LaTeX commands and includes a few
MathLive supports over 800 standard TeX and LaTeX commands and includes a few
non-standard extensions which are documented here.

# Decorations

## `\enclose`, `\cancel`, `\bcancel` and `\xcancel`

These commands render some decorating marks called **notations** on top of
their content. They can be used to highlight part of an expression, or
to indicate an expression has been canceled with a strike mark.
These commands render some decorating marks called **notations** on top of their
content. They can be used to highlight part of an expression, or to indicate an
expression has been canceled with a strike mark.

> **Note** `\enclose` is an extension to LaTeX that follows the `<menclose>` definition
> of [MathML]() and the LaTeX flavor defined by MathJax.
> **Note** `\enclose` is an extension to LaTeX that follows the `<menclose>`
> definition of [MathML]() and the LaTeX flavor defined by MathJax.
> **Note** The `\cancel`, `\bcancel` and `\xcancel` commands are part of the
> ["cancel"](https://www.ctan.org/pkg/cancel) LaTeX package.
### `\enclose`

The `\enclose` command is the most flexible. It accepts three arguments, two
of which are required:
The `\enclose` command is the most flexible. It accepts three arguments, two of
which are required:

```tex
\enclose{notation:text}[style:text]{body:math}
```

- `notation` a list of whitespace delimited values. Acceptable values are:
- `box`
- `roundedbox`
- `circle`
- `top`, `left`, `right` and `bottom`
- `horizontalstrike`, `verticalstrike`
- `updiagonalstrike`, `downdiagonalstrike`
- `updiagonalarrow`
- `phasorangle`
- `radical`
- `longdiv`
- `actuarial`
- `madruwb`
- `style` an optional list of comma separated attributes including:
- `mathbackground="<color>"` background color of the expression
- `mathcolor="<color>"` color of the notation, for example `red` or
`#cd0030` or `rgba(205, 0, 11, .4)`.
- `padding="<dimension>"` `"auto"` or an amount of padding around the
content
- `shadow="<shadow>"`: `"auto"` or `"none"` or a CSS `box-shadow` expression
for example, `"0 0 2px rgba(0, 0, 0, 0.5)"`.
- in addition the style property can include a stroke style expression that
follows the shorthand syntax of the CSS `border` property, for example
`"2px solid red"`.
- `body` a math expression that is "enclosed" by the specified notations
- `notation` a list of whitespace delimited values. Acceptable values are:
- `box`
- `roundedbox`
- `circle`
- `top`, `left`, `right` and `bottom`
- `horizontalstrike`, `verticalstrike`
- `updiagonalstrike`, `downdiagonalstrike`
- `updiagonalarrow`
- `phasorangle`
- `radical`
- `longdiv`
- `actuarial`
- `madruwb`
- `style` an optional list of comma separated attributes including:
- `mathbackground="<color>"` background color of the expression
- `mathcolor="<color>"` color of the notation, for example `red` or `#cd0030`
or `rgba(205, 0, 11, .4)`.
- `padding="<dimension>"` `"auto"` or an amount of padding around the content
- `shadow="<shadow>"`: `"auto"` or `"none"` or a CSS `box-shadow` expression
for example, `"0 0 2px rgba(0, 0, 0, 0.5)"`.
- in addition the style property can include a stroke style expression that
follows the shorthand syntax of the CSS `border` property, for example
`"2px solid red"`.
- `body` a math expression that is "enclosed" by the specified notations

### `\cancel`, `\bcancel` and `\xcancel`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ This guide is for developers who want to contribute code to the project, or who
need to modify or debug it.

If you simply want to use MathLive in your project, see the
[Usage Guide](tutorials/USAGE_GUIDE.md).
[Getting Started](https://cortexjs.io/guides/mathfield-getting-started/) guide.

## Table of Contents

Expand Down
Binary file added documentation/assets/mathlive-core.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 documentation/assets/mathlive-editor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
173 changes: 173 additions & 0 deletions documentation/commands.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
<!doctype html>
<html class="no-js" lang="">

<head>
<meta charset="utf-8">
<title>MathLive Reference - LaTeX Commands</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="apple-touch-icon" href="apple-touch-icon.png">


<style>
.testIdentifier {
text-shadow: 2px 2px 5px #aaa;
}

#testIdentifier {
background: lightyellow;
}

#testIdentifier:hover {
background: lightsteelblue;
}

table.compact-definition-table {
width: auto;
}

table.compact-definition-table .mathlive {
font-size: 300%;
/* color: #444; */
}

table.compact-definition-table td {
border: none;
border-radius: 16px;
width: 178px;
max-width: 178px;
height: 122px;
min-height: 122px;
overflow: hidden;
text-align: center;
padding: 0;
font-size: 24px;
display: inline-flex;
flex-flow: column;
align-items: center;
padding-top: 42px;

}

table.compact-definition-table tbody tr:nth-child(even) td {
background: transparent;
}

table.compact-definition-table tbody tr td:hover {
background: #eee;
overflow: visible;
}

div#reference table.compact-definition-table td>span {
margin-bottom: 8px;
}

div#reference table.compact-definition-table td kbd {
font-size: 14px;
font-family: var(--monospace);
font-weight: bold;
text-shadow: none;
margin: 0;
padding: 0;
color: var(--primary);
opacity: 1;
}

table tt {
font-family: var(--monospace);
color: var(--primary);
}

div#reference kbd {
opacity: 1;

font-family: var(--monospace);
font-weight: bold;
text-shadow: none;
color: var(--primary);

font-size: 16px;
box-shadow: none;
border: none;
background: transparent;
}

div#reference table {
table-layout: auto;
}

@media screen and (max-width: 600px) {
div#reference table.compact-definition-table {
width: 100%;
margin: auto;
}

;

div#reference table.compact-definition-table tbody tr {
width: 100vw;
}

div#reference table.compact-definition-table tbody tr td:first-child,
div#reference table.compact-definition-table tbody tr td {
display: inline-flex;
width: 100vw;
padding-left: 0;
padding-right: 0;
margin-top: 0;
max-width: 100vw;
empty-cells: hide;
font-size: 200%;
}

}


.star-rating {
font-size: 12px;
opacity: .7;
}
</style>


</head>

<body>
<script type='module'>
import {
MathLive,
generateMacrosDocumentation,
generateCommandsDocumentation
} from './js/documentation.js';
function update() {
const frequency = 0;
const format = "mat";

document.getElementById('macros').innerHTML =
generateMacrosDocumentation();

document.getElementById('reference').innerHTML =
generateCommandsDocumentation('', 0);

// MathLive.renderMathInDocument({
// fontsDirectory: "../fonts",
// renderAccessibleContent: '',
// preserveOriginalContent: false,
// asciiMath: null
// });
}
update();
</script>



<header>
<h1 role='banner'>LaTeX Commands</h1>
</header>
<section id='main-content'>
<div id='macros'></div>
<div id='reference'></div>
</section>
</body>

</html>
Loading

0 comments on commit 14be145

Please sign in to comment.