Skip to content

Commit e5b2132

Browse files
committed
2023-11-06
1 parent 88d1244 commit e5b2132

File tree

8 files changed

+168
-57
lines changed

8 files changed

+168
-57
lines changed

assets/css/imports/minimal-mistakes.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/css/imports/minimal-mistakes.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/css/main.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/css/sdk-documentation-layout.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compute-engine/guides/canonical-form/index.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2419,8 +2419,8 @@ <h1 id="canonical-form" tabindex="-1">Canonical Form</h1>
24192419
expressions.</p>
24202420
<p>The <code>ce.box()</code> and <code>ce.parse()</code> functions return a canonical expression by
24212421
default, which is the desirable behavior in most cases.</p>
2422-
<p><strong>To get a non-canonical version of an expression</strong> set the <code>canonical</code> option
2423-
of <code>ce.parse()</code> or <code>ce.box()</code> to <code>false</code>.</p>
2422+
<p><strong>To get a non-canonical version of an expression</strong> use
2423+
of <code>ce.parse(s, {canonical: false})</code> or <code>ce.box(expr, {canonical: false})</code>.</p>
24242424
<p>The non-canonical version will be closer to the literal LaTeX input, which may
24252425
be desirable to compare a “raw” user input with an expected answer.</p>
24262426
<pre><code class="language-js">ce.<span class="hljs-title function_">parse</span>(<span class="hljs-string">&#x27;\\frac{30}{-50}&#x27;</span>);
@@ -2452,7 +2452,8 @@ <h1 id="canonical-form" tabindex="-1">Canonical Form</h1>
24522452
</code></pre>
24532453
<p>The canonical form of an expression is always the same when used with a given
24542454
Compute Engine instance. However, do not rely on the canonical form as future
2455-
versions of the Compute Engine could provide a different result.</p>
2455+
versions of the Compute Engine could have a different definition of
2456+
canonical form.</p>
24562457
<p><strong>To check if an expression is canonical</strong> use <code>expr.isCanonical</code>.</p>
24572458
<p><strong>To obtain the canonical representation of a non-canonical expression</strong>, use
24582459
the <code>expr.canonical</code> property.</p>

compute-engine/guides/expressions/index.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2506,6 +2506,11 @@ <h2 id="canonical-expressions" tabindex="-1">Canonical Expressions</h2>
25062506
<span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(expr.<span class="hljs-property">json</span>);
25072507
<span class="hljs-comment">// ➔ [&quot;Rational&quot;, -3, 5]</span>
25082508
</code></pre>
2509+
<p>The canonical form of a rational with a denominator of 1 is an integer.</p>
2510+
<pre><code class="language-js"><span class="hljs-keyword">const</span> expr = ce.<span class="hljs-title function_">parse</span>(<span class="hljs-string">&quot;\\frac{17}{1}&quot;</span>);
2511+
<span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(expr.<span class="hljs-property">json</span>);
2512+
<span class="hljs-comment">// ➔ 17</span>
2513+
</code></pre>
25092514
<p>You can check if a non-canonical expression is a reduced (canonical) rational
25102515
number by checking the GCD of the numerator and denominator:</p>
25112516
<pre><code class="language-js"><span class="hljs-keyword">const</span> input = ce.<span class="hljs-title function_">parse</span>(<span class="hljs-string">&quot;\\frac{30}{50}&quot;</span>, {<span class="hljs-attr">canonical</span>: <span class="hljs-literal">false</span>});
@@ -2514,7 +2519,7 @@ <h2 id="canonical-expressions" tabindex="-1">Canonical Expressions</h2>
25142519
).<span class="hljs-title function_">evaluate</span>().<span class="hljs-property">value</span> === <span class="hljs-number">1</span>);
25152520
<span class="hljs-comment">// ➔ false</span>
25162521
</code></pre>
2517-
<p>The canonical form of an addition or mulipication will have its arguments
2522+
<p>The canonical form of an addition or multiplication will have its arguments
25182523
ordered in a canonical way.</p>
25192524
<pre><code class="language-js"><span class="hljs-keyword">const</span> expr = ce.<span class="hljs-title function_">parse</span>(<span class="hljs-string">&quot;2+x+\\pi+\\sqrt2+1&quot;</span>);
25202525
<span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(expr.<span class="hljs-property">json</span>);

mathlive/reference/keybindings/index.html

Lines changed: 118 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2490,6 +2490,7 @@ <h1>Keyboard Shortcuts</h1>
24902490
text-align: center;
24912491
padding-top: 8px;
24922492
align-items: center;
2493+
width: 100%;
24932494
}
24942495

24952496

@@ -2508,6 +2509,7 @@ <h1>Keyboard Shortcuts</h1>
25082509
color: var(--text-color);
25092510
align-items: center;
25102511
overflow-wrap: anywhere;
2512+
width: 100%;
25112513
}
25122514

25132515
/* .keybindings-table tr td:not(:first-child) {
@@ -2574,6 +2576,7 @@ <h1>Keyboard Shortcuts</h1>
25742576
line-height: 1;
25752577
text-align: center;
25762578
font-variant-ligatures: none;
2579+
width: 100%;
25772580
}
25782581

25792582

@@ -2592,6 +2595,7 @@ <h1>Keyboard Shortcuts</h1>
25922595
color: var(--text-color);
25932596
align-items: center;
25942597
overflow-wrap: anywhere;
2598+
width: 100%;
25952599
}
25962600

25972601
.inlineshortcut-table tr td kbd {
@@ -2702,17 +2706,75 @@ <h1>Keyboard Shortcuts</h1>
27022706
transform: translateX(26px);
27032707
}
27042708

2705-
.settings-row {
2709+
.settings-row, .settings-stack {
27062710
border-radius: 8px;
27072711
border: var(--ui-border);
27082712
padding: 1rem;
27092713
display: flex;
27102714
width: 100%;
2715+
user-select: none;
2716+
}
2717+
2718+
.settings-row {
27112719
align-items: center;
27122720
justify-content: space-between;
2713-
user-select: none;
27142721
}
27152722

2723+
.settings-stack {
2724+
flex-flow: column;
2725+
}
2726+
2727+
.settings-stack div div.row {
2728+
display: flex;
2729+
flex-flow: row;
2730+
align-items: baseline;
2731+
}
2732+
2733+
.settings-row label, .settings-stack label {
2734+
font-size: 1.25rem;
2735+
}
2736+
2737+
.settings-stack .label {
2738+
font-size: 1.25rem;
2739+
font-weight: 700;
2740+
margin-bottom: 0.5rem;
2741+
}
2742+
2743+
div.row input + label {
2744+
margin-left: 8px;
2745+
}
2746+
2747+
input[type="radio"] {
2748+
appearance: none;
2749+
background-color: var(--ui-background);
2750+
margin: 0;
2751+
font: inherit;
2752+
color: var(--ui-border);
2753+
width: 1.5em;
2754+
height: 1.5em;
2755+
border: 2.5px solid #555;
2756+
border-radius: 50%;
2757+
translate: 0 -1.25px;
2758+
display: grid;
2759+
place-content: center;
2760+
}
2761+
2762+
input[type="radio"]::before {
2763+
content: "";
2764+
width: 0.65em;
2765+
height: 0.65em;
2766+
border-radius: 50%;
2767+
transform: scale(0);
2768+
transition: 120ms transform ease-in-out;
2769+
box-shadow: inset 1em 1em var(--primary-color);
2770+
}
2771+
2772+
input[type="radio"]:checked::before {
2773+
transform: scale(1);
2774+
}
2775+
2776+
2777+
27162778
.page__content label p {
27172779
margin: 0;
27182780
padding: 0;
@@ -2762,19 +2824,49 @@ <h1>Keyboard Shortcuts</h1>
27622824
const platform = navigator['userAgentData']?.platform ?? navigator.platform;
27632825
const isApple = /^mac/i.test(platform) || /iphone|ipod|ipad/i.test(navigator.userAgent);
27642826

2765-
const appleSwitch = document.getElementById('apple');
2827+
const glyphsRadio = document.getElementById('glyphs-radio');
2828+
const textRadio = document.getElementById('text-radio');
2829+
2830+
// const appleSwitch = document.getElementById('apple');
2831+
// appleSwitch.addEventListener('click', (e) => {
2832+
// if (e.target.checked)
2833+
// document.body.classList.add('apple', 'glyphs');
2834+
// else
2835+
// document.body.classList.remove('apple', 'glyphs');
2836+
// });
27662837

27672838
if (isApple) {
2768-
appleSwitch.checked = true;
2839+
// appleSwitch.checked = true;
2840+
glyphsRadio.checked = true;
2841+
textRadio.checked = false;
2842+
27692843
document.body.classList.add('apple', 'glyphs');
2844+
} else {
2845+
glyphsRadio.checked = false;
2846+
textRadio.checked = true;
27702847
}
27712848

2772-
appleSwitch.addEventListener('click', (e) => {
2773-
if (e.target.checked)
2774-
document.body.classList.add('apple', 'glyphs');
2775-
else
2776-
document.body.classList.remove('apple', 'glyphs');
2849+
glyphsRadio.addEventListener('change', (e) => {
2850+
if (e.target.checked) {
2851+
document.body.classList.add('apple');
2852+
document.body.classList.add('glyphs');
2853+
}
2854+
else {
2855+
document.body.classList.remove('apple');
2856+
document.body.classList.remove('glyphs');
2857+
}
27772858
});
2859+
textRadio.addEventListener('change', (e) => {
2860+
if (e.target.checked) {
2861+
document.body.classList.remove('apple');
2862+
document.body.classList.remove('glyphs');
2863+
}
2864+
else {
2865+
document.body.classList.add('apple');
2866+
document.body.classList.add('glyphs');
2867+
}
2868+
});
2869+
27782870

27792871
function replaceGlyphs(root) {
27802872
// Recurse over all the children of the node
@@ -2811,14 +2903,27 @@ <h2 id="keybindings" tabindex="-1">Keybindings</h2>
28112903
<div class='read-more'><a href="/mathlive/guides/shortcuts/">
28122904
Read more about definining your own <strong>keybindings</strong> and <strong>shortcuts</strong>.
28132905
<svg class="svg-chevron"><use xlink:href="#svg-chevron"></use></svg></a></div>
2814-
<div class="settings-row">
2906+
<!-- <div class="settings-row">
28152907
<label for="apple"><p><strong>Shortcuts for macOS and iOS</strong></p><p>Display shortcuts using the ⌘, ⌥, ⌃, ⇧ keys</p></label>
28162908
<label class="switch">
28172909
<input id="apple" type="checkbox">
28182910
<span class="slider"></span>
28192911
</label>
2912+
</div> -->
2913+
<div class="settings-stack">
2914+
<div class="label">Display shortcuts for:</div>
2915+
<div>
2916+
<div class="row">
2917+
<input type="radio" id="glyphs-radio" name="glyphs" value="glyphs" checked>
2918+
<label for="glyphs-radio">macOS, iOS</label>
2919+
</div>
2920+
<div class="row">
2921+
<input type="radio" id="text-radio" name="glyphs" value="text">
2922+
<label for="text-radio">Windows, ChromeOS, Linux</label>
2923+
</div>
2924+
</div>
28202925
</div>
2821-
<section id="special-keys">
2926+
<section id="special-keys" class="if-glyphs">
28222927
<div id='special-keys-table'>
28232928
<div> <kbd></kbd><span class="label"><kbd>Shift</kbd></div>
28242929
<div> <kbd></kbd><span class="label"><kbd>Control</kbd></span></div>
@@ -4177,14 +4282,14 @@ <h3 id="miscelaneous" tabindex="-1">Miscelaneous</h3>
41774282

41784283

41794284

4180-
<meta itemprop="datePublished" content="October 25, 2023">
4285+
<meta itemprop="datePublished" content="November 06, 2023">
41814286

41824287

41834288

41844289

41854290

41864291

4187-
<p class="page__date"><svg class="icon1quarterem"><use role="none" xlink:href="/assets/icons.svg#calendar-days"/></svg><strong> Updated</strong> <time datetime="2023-10-25">October 25, 2023</time></p>
4292+
<p class="page__date"><svg class="icon1quarterem"><use role="none" xlink:href="/assets/icons.svg#calendar-days"/></svg><strong> Updated</strong> <time datetime="2023-11-06">November 06, 2023</time></p>
41884293

41894294

41904295
<p class="page__meta-link"><svg class="icon1quarterem"><use role="none" xlink:href="/assets/icons.svg#bug"/></svg> <strong>Problem? Feedback?</strong> File a report at&nbsp;<a href="https://github.com/cortex-js/cortexjs.io">github.com/cortex-js/cortexjs.io</a></p>

0 commit comments

Comments
 (0)