Using TeX Notation 2: Skillnad mellan sidversioner

Från MoodleDocs
Hoppa till:navigering, sök
kimi chen (diskussion | bidrag)
kimi chen (diskussion | bidrag)
Rad 440: Rad 440:
|-
|-
| $$ \red x \ = \ \frac{\sqrt{144}}{2} \ \times \ (y \ + \ 12) $$
| $$ \red x \ = \ \frac{\sqrt{144}}{2} \ \times \ (y \ + \ 12) $$
Test on Moodle 2.2, the working syntax is:
: $$ \color{red} x \ = \ \frac{\sqrt{144}}{2} \ \times \ (y \ + \ 12) $$
| [[Image: cfmimetex30a.gif|right]]  
| [[Image: cfmimetex30a.gif|right]]  
|-
|-
Rad 454: Rad 452:
| [[Image: cfmimetex30d.gif|right]]
| [[Image: cfmimetex30d.gif|right]]
|}
|}
Moodle 2.2 note: You may find this doesn't work for you. You can try to add "\usepackage{color}" to your tex notation setting "LaTeX preamble" (under Site adminstration/Plugins/Filters/TeX notation)and then use this new syntax: $$ \color{red} x \ = \ \frac{\sqrt{144}}{2} \ \times \ (y \ + \ 12) $$


You may note this last one, it is considerably more complex than the previous for colours. TeX Notation in Windows does not allow multicoloured equations, if you name a number of colours in the equation, only the last named will be used.
You may note this last one, it is considerably more complex than the previous for colours. TeX Notation in Windows does not allow multicoloured equations, if you name a number of colours in the equation, only the last named will be used.

Versionen från 25 mars 2012 kl. 00.56

As we have already covered the basics of TeX Notation in Moodle, this page is devoted to the characters you can use.

WARNING: In this Wiki environment, the TeX filter is not controlling the essential rendering of the control sequences. The effects are the same, but they are rendered by another Tex filter or I have uploaded images from my own Moodle of the code's rendering. It helps the syntax is almost the same though, but unless you download and install TeX Live, a 2gb download, please use the code examples given.

Maths symbols available in Moodle

A number of the characters and symbols below have already been covered in previous pages, but this is a more exhaustive list. There are a number more, but their relevance to K-12 maths is questionable.

Keyboard characters are available as themselves but many characters have a significance in TeX. All command sequences start and end with the $$ i.e. $$ \entire command sequence $$. All control sequences start with the backslash, \, i.e. \times, or \frac{1}{2}, and have no end character. There are a number of different types of charsets available, not just Maths but also scientific sets but these need be installed to your Moodle if you want additional charsets. Unfortunately, TeX Notation is designed for use in Maths, not science, so it may struggle using non-Maths charsets.

Symbols

These are not all the symbols that may be available in TeX Notation for Moodle, just the ones that I have found to work in Moodle.

\amalg \cup \oplus \times
\ast Misslyckades med att tolka (Konverteringsfel. Servern ("https://en.wikipedia.org/api/rest_") rapporterade: "Cannot get mml. Server problem."): {\displaystyle \ast } \dagger \oslash \triangleleft
\bigcirc Misslyckades med att tolka (Konverteringsfel. Servern ("https://en.wikipedia.org/api/rest_") rapporterade: "Cannot get mml. Server problem."): {\displaystyle \bigcirc } \ddagger \otimes \triangleright Misslyckades med att tolka (Konverteringsfel. Servern ("https://en.wikipedia.org/api/rest_") rapporterade: "Cannot get mml. Server problem."): {\displaystyle \triangleright }
\bigtriangledown \diamond \pm \odot
\bigtriangleup Misslyckades med att tolka (Konverteringsfel. Servern ("https://en.wikipedia.org/api/rest_") rapporterade: "Cannot get mml. Server problem."): {\displaystyle \bigtriangleup } \div \ominus \wr
\circ \wedge \vee \sqcup
\leq \geq Misslyckades med att tolka (Konverteringsfel. Servern ("https://en.wikipedia.org/api/rest_") rapporterade: "Cannot get mml. Server problem."): {\displaystyle \geq } \equiv Misslyckades med att tolka (Konverteringsfel. Servern ("https://en.wikipedia.org/api/rest_") rapporterade: "Cannot get mml. Server problem."): {\displaystyle \equiv } \prec
\succ \sim \perp \preceq
\succeq \simeq \mid \ll
\gg \asymp \parallel \subset
\supset \subseteq \supseteq \approx
\neq Misslyckades med att tolka (Konverteringsfel. Servern ("https://en.wikipedia.org/api/rest_") rapporterade: "Cannot get mml. Server problem."): {\displaystyle \neq } \ni Misslyckades med att tolka (Konverteringsfel. Servern ("https://en.wikipedia.org/api/rest_") rapporterade: "Cannot get mml. Server problem."): {\displaystyle \ni } \notin \in
\vdash \dashv \bullet \cdot Misslyckades med att tolka (Konverteringsfel. Servern ("https://en.wikipedia.org/api/rest_") rapporterade: "Cannot get mml. Server problem."): {\displaystyle \cdot }

Arrows

\leftarrow \longleftarrow \Leftarrow \Longleftarrow
\rightarrow \longrightarrow \Rightarrow \Longrightarrow
\uparrow \Uparrow \downarrow \Downarrow
\leftrightarrow \longleftrightarrow \updownarrow \Updownarrow
\Leftrightarrow \Longleftrightarrow \leftrightharpoon Misslyckades med att tolka (Konverteringsfel. Servern ("https://en.wikipedia.org/api/rest_") rapporterade: "Cannot get mml. Server problem."): {\displaystyle \rightleftharpoons } \Im
\nearrow \nwarrow \swarrow \searrow Misslyckades med att tolka (Konverteringsfel. Servern ("https://en.wikipedia.org/api/rest_") rapporterade: "Cannot get mml. Server problem."): {\displaystyle \searrow }

Delimiters and Maths Constructs

NOTE: Most delimiters and constructs need additional parameters for them to appear appropriately.

\{x \} \rangle \langle Misslyckades med att tolka (Konverteringsfel. Servern ("https://en.wikipedia.org/api/rest_") rapporterade: "Cannot get mml. Server problem."): {\displaystyle \langle }
\angle \= \sqrt{ab} \sqrt[n]{ab}
\frac{ab}{cd} \backslash Misslyckades med att tolka (Konverteringsfel. Servern ("https://en.wikipedia.org/api/rest_") rapporterade: "Cannot get mml. Server problem."): {\displaystyle \backslash } \widehat{ab} \$
\overline{ab} Misslyckades med att tolka (Konverteringsfel. Servern ("https://en.wikipedia.org/api/rest_") rapporterade: "Cannot get mml. Server problem."): {\displaystyle {\overline {ab}}} \underline{ab} \therefore \ddots
\% \# \vdots \emptyset

WARNINGS: The & character in LaTeX usually requires a backslash, \. In TeX Notation for Moodle, apparently, it does not. Other packages, AsciiMath, may use it differently again so be careful using it. The copyright character may use the MimeTeX charset, and produces a copyright notice for John Forkosh Associates who provided a lot of the essential packages for the TeX Notation for Moodle, so I understand. I have been, almost reliably, informed that a particular instruction will produce a different notice though .:)

There are also a number of characters that can be used in TeX Notation for Moodle but do not render in this page:

Larger \left(x and \right) brackets
\widetilde{ab}
\textdegree or (50)^\circ

Greek Letters

\alpha \beta Misslyckades med att tolka (SVG (MathML kan aktiveras via insticksmodul till webbläsaren): Ogiltigt svar ("Math extension cannot connect to Restbase.") från server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \gamma} \gamma
\delta \epsilon Misslyckades med att tolka (SVG (MathML kan aktiveras via insticksmodul till webbläsaren): Ogiltigt svar ("Math extension cannot connect to Restbase.") från server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \zeta} \zeta
Misslyckades med att tolka (SVG (MathML kan aktiveras via insticksmodul till webbläsaren): Ogiltigt svar ("Math extension cannot connect to Restbase.") från server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \eta} \eta Misslyckades med att tolka (SVG (MathML kan aktiveras via insticksmodul till webbläsaren): Ogiltigt svar ("Math extension cannot connect to Restbase.") från server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \theta} \theta Misslyckades med att tolka (SVG (MathML kan aktiveras via insticksmodul till webbläsaren): Ogiltigt svar ("Math extension cannot connect to Restbase.") från server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \iota} \iota
Misslyckades med att tolka (SVG (MathML kan aktiveras via insticksmodul till webbläsaren): Ogiltigt svar ("Math extension cannot connect to Restbase.") från server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \kappa} \kappa Misslyckades med att tolka (SVG (MathML kan aktiveras via insticksmodul till webbläsaren): Ogiltigt svar ("Math extension cannot connect to Restbase.") från server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \lambda} \lambda Misslyckades med att tolka (SVG (MathML kan aktiveras via insticksmodul till webbläsaren): Ogiltigt svar ("Math extension cannot connect to Restbase.") från server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \mu} \mu
Misslyckades med att tolka (SVG (MathML kan aktiveras via insticksmodul till webbläsaren): Ogiltigt svar ("Math extension cannot connect to Restbase.") från server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \xi} \xi Misslyckades med att tolka (SVG (MathML kan aktiveras via insticksmodul till webbläsaren): Ogiltigt svar ("Math extension cannot connect to Restbase.") från server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \pi} \pi Misslyckades med att tolka (SVG (MathML kan aktiveras via insticksmodul till webbläsaren): Ogiltigt svar ("Math extension cannot connect to Restbase.") från server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \rho} \rho
Misslyckades med att tolka (SVG (MathML kan aktiveras via insticksmodul till webbläsaren): Ogiltigt svar ("Math extension cannot connect to Restbase.") från server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \sigma} \sigma Misslyckades med att tolka (SVG (MathML kan aktiveras via insticksmodul till webbläsaren): Ogiltigt svar ("Math extension cannot connect to Restbase.") från server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \tau} \tau Misslyckades med att tolka (SVG (MathML kan aktiveras via insticksmodul till webbläsaren): Ogiltigt svar ("Math extension cannot connect to Restbase.") från server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \upsilon} \upsilon
Misslyckades med att tolka (SVG (MathML kan aktiveras via insticksmodul till webbläsaren): Ogiltigt svar ("Math extension cannot connect to Restbase.") från server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \phi} \phi Misslyckades med att tolka (SVG (MathML kan aktiveras via insticksmodul till webbläsaren): Ogiltigt svar ("Math extension cannot connect to Restbase.") från server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \chi} \chi Misslyckades med att tolka (SVG (MathML kan aktiveras via insticksmodul till webbläsaren): Ogiltigt svar ("Math extension cannot connect to Restbase.") från server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \psi} \psi
Misslyckades med att tolka (SVG (MathML kan aktiveras via insticksmodul till webbläsaren): Ogiltigt svar ("Math extension cannot connect to Restbase.") från server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \omega} \omega Misslyckades med att tolka (SVG (MathML kan aktiveras via insticksmodul till webbläsaren): Ogiltigt svar ("Math extension cannot connect to Restbase.") från server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \Omega} \Omega Misslyckades med att tolka (SVG (MathML kan aktiveras via insticksmodul till webbläsaren): Ogiltigt svar ("Math extension cannot connect to Restbase.") från server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \Theta} \Theta
Misslyckades med att tolka (SVG (MathML kan aktiveras via insticksmodul till webbläsaren): Ogiltigt svar ("Math extension cannot connect to Restbase.") från server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \Delta} \Delta Misslyckades med att tolka (SVG (MathML kan aktiveras via insticksmodul till webbläsaren): Ogiltigt svar ("Math extension cannot connect to Restbase.") från server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \Pi} \Pi Misslyckades med att tolka (SVG (MathML kan aktiveras via insticksmodul till webbläsaren): Ogiltigt svar ("Math extension cannot connect to Restbase.") från server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \Phi} \Phi
Misslyckades med att tolka (SVG (MathML kan aktiveras via insticksmodul till webbläsaren): Ogiltigt svar ("Math extension cannot connect to Restbase.") från server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \Gamma } \Gamma Misslyckades med att tolka (SVG (MathML kan aktiveras via insticksmodul till webbläsaren): Ogiltigt svar ("Math extension cannot connect to Restbase.") från server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \Lambda } \Lambda Misslyckades med att tolka (SVG (MathML kan aktiveras via insticksmodul till webbläsaren): Ogiltigt svar ("Math extension cannot connect to Restbase.") från server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \Sigma } \Sigma
Misslyckades med att tolka (SVG (MathML kan aktiveras via insticksmodul till webbläsaren): Ogiltigt svar ("Math extension cannot connect to Restbase.") från server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \Psi } \Psi Misslyckades med att tolka (SVG (MathML kan aktiveras via insticksmodul till webbläsaren): Ogiltigt svar ("Math extension cannot connect to Restbase.") från server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \Xi } \Xi Misslyckades med att tolka (SVG (MathML kan aktiveras via insticksmodul till webbläsaren): Ogiltigt svar ("Math extension cannot connect to Restbase.") från server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \Upsilon} \Upsilon
Misslyckades med att tolka (SVG (MathML kan aktiveras via insticksmodul till webbläsaren): Ogiltigt svar ("Math extension cannot connect to Restbase.") från server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \vartheta } \vartheta Misslyckades med att tolka (SVG (MathML kan aktiveras via insticksmodul till webbläsaren): Ogiltigt svar ("Math extension cannot connect to Restbase.") från server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \varrho } \varrho Misslyckades med att tolka (SVG (MathML kan aktiveras via insticksmodul till webbläsaren): Ogiltigt svar ("Math extension cannot connect to Restbase.") från server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \varphi } \varphi
Misslyckades med att tolka (SVG (MathML kan aktiveras via insticksmodul till webbläsaren): Ogiltigt svar ("Math extension cannot connect to Restbase.") från server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \varsigma } \varsigma

Notable Exceptions

Greek letter omicron. Simply put, omicron is an "o" or an "O".

At the time of writing, these Greek capital letters cannot be rendered by TeX Notation in Moodle:

 Alpha, Beta, Zeta, Eta, Tau, Chi, Mu, Iota, Kappa and Epsilon

Given the relationship of Tau to finding the area of a circle, it can easily replace Pi, Misslyckades med att tolka (SVG (MathML kan aktiveras via insticksmodul till webbläsaren): Ogiltigt svar ("Math extension cannot connect to Restbase.") från server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \pi} , it may soon be though.

Fonts

To use a particular font you need to access the font using the same syntax as demonstrated above.

A math calligraphic font:

Misslyckades med att tolka (SVG (MathML kan aktiveras via insticksmodul till webbläsaren): Ogiltigt svar ("Math extension cannot connect to Restbase.") från server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \mathcal{ABCDEFGHIJKLMNOPQRSTUVXYZ}}

or

$$ \mathcal{ABCDEFGHIJKLMNOPQRSTUVXYZ}$$

A Castellar type font:

Misslyckades med att tolka (SVG (MathML kan aktiveras via insticksmodul till webbläsaren): Ogiltigt svar ("Math extension cannot connect to Restbase.") från server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \mathbb{ABCDEFGHIJKLMNOPQRSTUVXYZ}}

or

$$ \mathbb{ABCDEFGHIJKLMNOPQRSTUVXYZ}$$

An Old English type font:

Misslyckades med att tolka (SVG (MathML kan aktiveras via insticksmodul till webbläsaren): Ogiltigt svar ("Math extension cannot connect to Restbase.") från server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \mathfrak{ABCDEFGHIJKLMNOPQRSTUVXYZ}}

or

$$ \mathfrak{ABCDEFGHIJKLMNOPQRSTUVXYZ}$$

This is different in Tex Notation in Moodle than it is for other, full, TeX packages.

An italic font:

ABCDEFGHIJKLMNOPQRSTUVXYZ

or

$$ \mathi{ABCDEFGHIJKLMNOPQRSTUVXYZ} $$

A bold-face font:

Misslyckades med att tolka (SVG (MathML kan aktiveras via insticksmodul till webbläsaren): Ogiltigt svar ("Math extension cannot connect to Restbase.") från server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \mathbf{ABCDEFGHIJKLMNOPQRSTUVXYZ}}

or

$$ \mathbf{ABCDEFGHIJKLMNOPQRSTUVXYZ} $$

Size of displays

The default size is rendered slightly larger than normal font size. TeX Notation in Moodle uses eight different sizes ranging from "tiny" to "huge". However,these values seem to mean different things and are, I suspect, dependent upon the User's screen resolution. The sizes can be noted in four different ways:

\fontsize{0} to \fontsize{7} $$\fontsize{2} x \ = \ \frac{\sqrt{144}}{2} \ \times \ (y \ + \ 12)$$
Fil:cfmimetex11a.gif
\fs{0} to \fs{7} $$\fs{4} x \ = \ \frac{\sqrt{144}}{2} \ \times \ (y \ + \ 12)$$
Fil:cfmimetex11b.gif
\fs0 to \fs7 $$\fs6 x \ = \ \frac{\sqrt{144}}{2} \ \times \ (y \ + \ 12)$$
As well, you can use \tiny \small

\normalsize \large \Large \LARGE \huge \Huge

$$\normalsize x \ = \ \frac{\sqrt{144}}{2} \ \times \ (y \ + \ 12)$$

It appears that TeX Notation in Moodle now allows \fs6, \fs7, \huge and \Huge to be properly rendered.

Colour

Unlike many scripting languages, we only need to name the colour we want to use. You may have to experiment a little with colours, but it will make for a brighter page. Once named, the entire statement will appear in the colour, and if you mix colours, the last named colour will dominate. Some examples:

$$ \red x \ = \ \frac{\sqrt{144}}{2} \ \times \ (y \ + \ 12) $$
$$ \blue x \ = \ \frac{\sqrt{144}}{2} \ \times \ (y \ + \ 12) $$
$$ \green x \ = \ \frac{\sqrt{144}}{2} \ \times \ (y \ + \ 12) $$
$$ \red x \ = \ \frac{\sqrt{144}}{2}$$ $$ \times $$

$$\green (y \ + \ 12) $$ $$ \ = $$ $$ \ \blue 6^3 $$

Moodle 2.2 note: You may find this doesn't work for you. You can try to add "\usepackage{color}" to your tex notation setting "LaTeX preamble" (under Site adminstration/Plugins/Filters/TeX notation)and then use this new syntax: $$ \color{red} x \ = \ \frac{\sqrt{144}}{2} \ \times \ (y \ + \ 12) $$

You may note this last one, it is considerably more complex than the previous for colours. TeX Notation in Windows does not allow multicoloured equations, if you name a number of colours in the equation, only the last named will be used.

See Also