Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Fix \set documentation #3646

Merged
merged 3 commits into from Aug 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 6 additions & 4 deletions docs/support_table.md
Expand Up @@ -16,6 +16,8 @@ table td {

## Symbols

$\gdef\VERT{|}$

|Symbol/Function | Rendered | Source or Comment|
|:---------------|:------------|:-----------------|
|\!|$n!$|`n!`|
Expand Down Expand Up @@ -192,8 +194,8 @@ table td {
|\boxtimes|$\boxtimes$||
|\Bra|$\Bra{\psi}$|`\Bra{\psi}`|
|\bra|$\bra{\psi}$|`\bra{\psi}`|
|\braket|$\braket{\phi\vert\psi}$|`\braket{\phi\vert\psi}`|
|\Braket|$\Braket{ ϕ \| \frac{∂^2}{∂ t^2} \| ψ }$| `\Braket{ ϕ \| \frac{∂^2}{∂ t^2} \| ψ }`|
|\braket|$\braket{\phi\VERT\psi}$|<code>\braket{\phi&#124;\psi}</code>|
|\Braket|$\Braket{ ϕ \VERT \frac{∂^2}{∂ t^2} \VERT ψ }$| <code>\Braket{ ϕ &#124; \frac{∂^2}{∂ t^2} &#124; ψ }</code>|
|\brace|${n\brace k}$|`{n\brace k}`|
|\bracevert|<span style="color:firebrick;">Not supported</span>||
|\brack|${n\brack k}$|`{n\brack k}`|
Expand Down Expand Up @@ -954,8 +956,8 @@ use `\ce` instead|
|\searrow|$\searrow$||
|\sec|$\sec$||
|\sect|$\text{\sect}$|`\text{\sect}`|
|\set|$\set{x\|x<5}$|`\set{x\|x<5}` |
|\Set|$\Set{ x \| x<\frac 1 2 }$ | `\Set{ x \| x<\frac 1 2 }` |
|\set|$\set{x\VERT x<5}$|<code>\set{x&#124;x<5}</code> |
|\Set|$\Set{ x \VERT x<\frac 1 2 }$ | <code>\Set{ x &#124; x<\frac 1 2}</code> |
|\setlength|<span style="color:firebrick;">Not supported</span>|[Issue #687](https://github.com/KaTeX/KaTeX/issues/687)|
|\setminus|$\setminus$||
|\sf|$\sf AaBb123$|`\sf AaBb123`|
Expand Down
8 changes: 5 additions & 3 deletions docs/supported.md
Expand Up @@ -312,6 +312,8 @@ KaTeX also supports `\llap`, `\rlap`, and `\clap`, but they will take only text,

## Logic and Set Theory

$\gdef\VERT{|}$

|||||
|:--------------------|:--------------------------|:----------------------------|:-----
|$\forall$ `\forall` |$\complement$ `\complement`|$\therefore$ `\therefore` |$\emptyset$ `\emptyset`
Expand All @@ -321,7 +323,7 @@ KaTeX also supports `\llap`, `\rlap`, and `\clap`, but they will take only text,
|$\in$ `\in` |$\land$ `\land` |$\gets$ `\gets` |$\impliedby$ `\impliedby`
|$\isin$ `\isin` |$\lor$ `\lor` |$\leftrightarrow$ `\leftrightarrow`|$\iff$ `\iff`
|$\notin$ `\notin` |$\ni$ `\ni` |$\notni$ `\notni` |$\neg$ `\neg` or `\lnot`
| | $\Set{ x \| x<\frac 1 2 }$<br>`\Set{ x \| x<\frac 1 2 }` | $\set{x\|x<5}$<br>`\set{x\|x<5}`
| | $\Set{ x \VERT x<\frac 1 2 }$<br><code>\Set{ x &#124; x<\frac 1 2 }</code> | $\set{x\VERT x<5}$<br><code>\set{x&#124;x<5}</code> ||

Direct Input: $∀ ∴ ∁ ∵ ∃ ∣ ∈ ∉ ∋ ⊂ ⊃ ∧ ∨ ↦ → ← ↔ ¬$ ℂ ℍ ℕ ℙ ℚ ℝ

Expand Down Expand Up @@ -563,8 +565,8 @@ Extensible arrows all can take an optional argument in the same manner<br>as `\x

||||
|:----------|:----------|:----------|
|$\bra{\phi}$ `\bra{\phi}` |$\ket{\psi}$ `\ket{\psi}` |$\braket{\phi\vert\psi}$ `\braket{\phi\vert\psi}` |
|$\Bra{\phi}$ `\Bra{\phi}` |$\Ket{\psi}$ `\Ket{\psi}` |$\Braket{ ϕ \| \frac{∂^2}{∂ t^2} \| ψ }$ `\Braket{ ϕ \| \frac{∂^2}{∂ t^2} \| ψ }`|
|$\bra{\phi}$ `\bra{\phi}` |$\ket{\psi}$ `\ket{\psi}` |$\braket{\phi\VERT\psi}$ <code>\braket{\phi&#124;\psi}</code> |
|$\Bra{\phi}$ `\Bra{\phi}` |$\Ket{\psi}$ `\Ket{\psi}` |$\Braket{ ϕ \VERT \frac{∂^2}{∂ t^2} \VERT ψ }$ <code>\Braket{ ϕ &#124; \frac{∂^2}{∂ t^2} &#124; ψ }</code>|

## Style, Color, Size, and Font

Expand Down
6 changes: 4 additions & 2 deletions website/lib/remarkable-katex.js
@@ -1,6 +1,6 @@
// https://github.com/bradhowes/remarkable-katex/blob/master/index.js
// Modified here to require("../..") instead of require("katex")
// and add options {trust: true, strict: false}.
// and add options {trust: true, strict: false, macros}.

/* MIT License

Expand All @@ -25,6 +25,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

const macros = {}; // allow sharing macros within a page

/**
* Plugin for Remarkable Markdown processor which transforms $..$ and $$..$$ sequences into math HTML using the
* Katex package.
Expand All @@ -41,7 +43,7 @@ module.exports = (md, options) => {
*/
const renderKatex = (source, displayMode) => katex.renderToString(source,
{displayMode: displayMode, throwOnError: false,
trust: true, strict: false});
trust: true, strict: false, macros});

/**
* Parse '$$' as a block. Based off of similar method in remarkable.
Expand Down