| Differences between revisions 3 and 59 (spanning 56 versions) | Back to page |
|
Size: 3949
Comment:
|
Size: 5854
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 1: | Line 1: |
| #format inline_latex #pragma latex_preamble latexPreamble <<TableOfContents>> |
## page was renamed from MoinMoin in Griffin == Slide show is cool == I find it cool, anyway. For this reason, the "SS" link is provided at top of every page. If you click it, a slide show version of the page will be displayed. Use arrow keys to navigate. Or space bar, which is equivalent to the down arrow. Use the escape key to get out of the slide show mode. Or, if you move your mouse to the top of the window, a menu will appear. In order to make a page slide show friendly, you will need to divide contents in small chunks using ''level 1'' headings as in {{{ = <title> = }}} Note also that anything before the first level 1 heaving will not show up in the slide show mode. |
| Line 7: | Line 15: |
| As of June 7, 2011, !MathJax has been installed in Griffin and it seems to work fine. Accordingly, LaTeX is not a default format any more. (See the striked out line below.) This means that the inline_latex format needs to be declared explicitly, if latex needs to be used. | As of June 7, 2011, !MathJax has been installed in Griffin and it seems to work fine. !MathJax is an HTML processor that recognizes LaTeX markups. |
| Line 9: | Line 17: |
| As the latex parser has some issues related to many small cache images that it creates and the subsequent surge protection problem, it should be replaced by !MathJax for most uses. | To use !MathJax, inline expressions can be enclosed by a pair of \$'s (the expression \( ... \) is not allowed, as it seems to conflict with !MoinMoin). Displayed math formulas can come in a pair of $$'s, or \[ ... \]. However, this method restricts only a single line input (the output can be multiple lines) due to the !MoinMoin inserting HTML tags before !MathJax can go interpret formulas. The solution for more complex expressions is to call the mathjax parser explicitly. Here are some examples. |
| Line 11: | Line 19: |
| To use !MathJax, inline expressions can be enclosed by a pair of $'s. Also, a ''single'' line of LaTeX expressions for displayed formula and align will be interpreted correctly. A simple parser making it easier to type in multi-line expressions might be written in the future. | * Here is an in-line math: $y = 20$. |
| Line 13: | Line 21: |
| == LaTeX in Griffin == A customized parser is installed in Griffin to make it easy to use LaTeX expressions. |
* Lorentz equation! |
| Line 16: | Line 23: |
| The LaTeX parser is used whenever there is a LaTeX instruction in the body of the document. The LaTeX parser is used automatically in Griffin. The parser was downloaded from <<ln(http://johannes.sipsolutions.net/Projects/new-moinmoin-latex,here)>>, and customized and updated locally. | $$\begin{align} \dot{x} & = \sigma(y-x) \\ \dot{y} & = \rho x - y - xz \\ \dot{z} & = -\beta z + xy \end{align}$$ |
| Line 18: | Line 25: |
| --(The default format of any wiki page is inline_latex.)-- This is equivalent to having, at top of the document, the following declaration. | * Lorentz equation, again! |
| Line 20: | Line 27: |
| {{{ #format inline_latex |
\[\begin{align} \dot{x} & = \sigma(y-x) \\ \dot{y} & = \rho x - y - xz \\ \dot{z} & = -\beta z + xy \end{align}\] Notice that, in the second and the third methods, no line breakage is allowed within the math environment. To avoid this ugliness and the lack of readability, the parser must be called more formally, as shown in the following example. (~-By the way, note that !MathJax is just a HTML post-processor, and !MoinMoin is told to simply pass the raw text marked as mathjax format (using any of these methods described here) to !MathJax, and so, an interesting side effect is that, ''any'' HTML markup can be included in the mathjax parser environment. The example below includes such a markup.-~) * Lorentz equation — "correctly" done! {{{#!mathjax <div style='text-align: center;'><h3 style='color: IndianRed; font-variant: small-caps;'>Lorentz Equation</h3> \[ \begin{align} \dot{x} & = \sigma(y-x) \\ \dot{y} & = \rho x - y - xz \\ \dot{z} & = -\beta z + xy \end{align} \] </div> |
| Line 24: | Line 45: |
| This is the default format in Griffin. If you do not use any latex formatting at all in a page, this is fine, of course. That page will act just like a normal wiki page. See one [[#Caveats|caveat]] about the GUI editor below. | == LaTeX == |
| Line 26: | Line 47: |
| The following declaration must be at top of the document in order to change the parser to the default plain vanilla one. | Check out <<ln(http://en.wikibooks.org/wiki/LaTeX, this wonderful book on the web)>> if you are not familiar with LaTeX, or even if. |
| Line 28: | Line 50: |
| {{{ #format wiki }}} === Customizing the LaTeX environment === The default preamble of the LaTeX in Griffin is the following. |
== LaTeX parser in Griffin (deprecated) == |
| Line 34: | Line 52: |
| {{{#!highlight latex \documentclass[12pt]{article} \pagestyle{empty} \usepackage[utf8]{inputenc} \usepackage{amsmath} }}} This preamble is not changeable, but other stuff can be added to this preamble in several ways. |
It is also possible to use a latex parser, instead of a !MathJax parser. However, this is not recommended. The latex parser is kept for some special page like [[MoinMoin in Griffin (Old)|this one]], where you can read more about the deprecated latex parser, if you insist. |
| Line 42: | Line 54: |
| ==== Using a preamble page ==== This is probably the most reasonable way. For this method to work, first a page needs to be created within a Wiki that contains texts to be used as LaTeX preamble. For instance, suppose the following text is saved in the page named latexPreambleGHG. {{{ \usepackage{dsfont} % This is just a test. }}} |
== Custom macros in Griffin == |
| Line 48: | Line 56: |
| Now, suppose you have the following in another page. {{{ #format inline_latex # This line is not necessary in Griffin. #pragma latex_preamble latexPreambleGHG ... other texts ... $\mathds{C}$ }}} That code {{{$\mathds{C}$}}} should give you this output: $\mathds{C}$. ==== Other methods ==== The preamble can be included in the latex macro itself. === Caveats === * If there are two many latex elements in a page, then you might trigger a "surge protection" mechanism. If this mechanism becomes a hindrance, let me know. Possibly, the surge protection setting is something that has not found the optimal setting yet. * The GUI editor does not work in MoinMoin for formats other than the plain "wiki" format. Only if you give a certain page this format, by including a line "#format wiki" at the top, you will be able to see the "Edit (GUI)" button. A GUI editor is not necessary normally, in my opinion, but often a less used feature can be discovered in GUI menus. == Macros in Griffin == |
|
| Line 70: | Line 58: |
| === Linking URLs === ln, lnfn |
== Linking URLs == |
| Line 73: | Line 60: |
| === Linking DOIs === doi, doifn |
A URL can be linked like this. {{{ <<ln(http://www.jstor.org/stable/1734697,"A must read by PWA.")>> |
| Line 76: | Line 64: |
| === Linking Attachments === la, lia |
This lovely article is both deep and popular <<lnfn(http://www.jstor.org/stable/1734697,"A must read by PWA.")>>. |
| Line 79: | Line 66: |
| == Odds and Ends == Do you want to write & when you are in the LaTeX format? Then, use |
This lovely article is both deep and popular <<lnfn(http://www.jstor.org/stable/1734697,"Science 4 August 1972: Vol. 177 no. 4047, pp. 393-396. 'More is Different'.")>>. }}} This results in the following. <<ln(http://www.jstor.org/stable/1734697,"A must read by PWA.")>> This lovely article is both deep and popular <<lnfn(http://www.jstor.org/stable/1734697,"A must read by PWA.")>>. This lovely article is both deep and popular <<lnfn(http://www.jstor.org/stable/1734697,"Science 4 August 1972: Vol. 177 no. 4047, pp. 393-396. 'More is Different'.")>>. == Linking DOIs == A DOI can be linked like this. {{{ <<doi(10.1126/science.177.4047.393,"A must read by PWA.")>> This lovely article is both deep and popular <<doifn(10.1126/science.177.4047.393,"A must read by PWA.")>>. This lovely article is both deep and popular <<doifn(10.1126/science.177.4047.393,"Science 4 August 1972: Vol. 177 no. 4047, pp. 393-396. 'More is Different'.")>>. }}} This results in the following. <<doi(10.1126/science.177.4047.393,"A must read by PWA.")>> This lovely article is both deep and popular <<doifn(10.1126/science.177.4047.393,"A must read by PWA.")>>. This lovely article is both deep and popular <<doifn(10.1126/science.177.4047.393,"Science 4 August 1972: Vol. 177 no. 4047, pp. 393-396. 'More is Different'.")>>. ~-As an aside, this article is NOT accessible through OCA if I use the Science link (the DOI link), but it IS accessible through OCA if I use JSTOR.org link. This is a useful thing to know as far as papers published in Science are concerned.-~ == Linking attachments == la, lia (to do -- need to document) == Citing references (Bibtex etc.) == cite (to do -- need to document) == Raw html markups == h == Signing the document == If you like to leave a signature, after you edit a file, or, more frequently, after you make a comment to an existing page, you can write @``SIG@. This will expand to your user name and a time stamp. == Odds and ends == Do you want to write '&' but the parser refuses to do so? Then, try |
| Line 85: | Line 117: |
| Do you want to write $? Well, then you have to remember the number 36! | Do you want to write '\$'? Well, then all you have to remember is the number 36! Or, you can also escape \$ (this behavior is provided by !MathJax, an HTML (post-)processor). |
Slide show is cool
I find it cool, anyway. For this reason, the "SS" link is provided at top of every page. If you click it, a slide show version of the page will be displayed. Use arrow keys to navigate. Or space bar, which is equivalent to the down arrow. Use the escape key to get out of the slide show mode. Or, if you move your mouse to the top of the window, a menu will appear.
In order to make a page slide show friendly, you will need to divide contents in small chunks using level 1 headings as in
= <title> =
Note also that anything before the first level 1 heaving will not show up in the slide show mode.
MathJax in Griffin
As of June 7, 2011, MathJax has been installed in Griffin and it seems to work fine. MathJax is an HTML processor that recognizes LaTeX markups.
To use MathJax, inline expressions can be enclosed by a pair of \$'s (the expression \( ... \) is not allowed, as it seems to conflict with MoinMoin). Displayed math formulas can come in a pair of $$'s, or \[ ... \]. However, this method restricts only a single line input (the output can be multiple lines) due to the MoinMoin inserting HTML tags before MathJax can go interpret formulas. The solution for more complex expressions is to call the mathjax parser explicitly. Here are some examples.
Here is an in-line math: $y = 20$.
- Lorentz equation!
$$\begin{align} \dot{x} & = \sigma(y-x) \\ \dot{y} & = \rho x - y - xz \\ \dot{z} & = -\beta z + xy \end{align}$$
- Lorentz equation, again!
\[\begin{align} \dot{x} & = \sigma(y-x) \\ \dot{y} & = \rho x - y - xz \\ \dot{z} & = -\beta z + xy \end{align}\]
Notice that, in the second and the third methods, no line breakage is allowed within the math environment. To avoid this ugliness and the lack of readability, the parser must be called more formally, as shown in the following example. (By the way, note that MathJax is just a HTML post-processor, and MoinMoin is told to simply pass the raw text marked as mathjax format (using any of these methods described here) to MathJax, and so, an interesting side effect is that, any HTML markup can be included in the mathjax parser environment. The example below includes such a markup.)
Lorentz equation — "correctly" done!
Lorentz Equation
\[ \begin{align} \dot{x} & = \sigma(y-x) \\ \dot{y} & = \rho x - y - xz \\ \dot{z} & = -\beta z + xy \end{align} \]
LaTeX
Check out this wonderful book on the web if you are not familiar with LaTeX, or even if.
LaTeX parser in Griffin (deprecated)
It is also possible to use a latex parser, instead of a MathJax parser. However, this is not recommended. The latex parser is kept for some special page like this one, where you can read more about the deprecated latex parser, if you insist.
Custom macros in Griffin
New macros have been added to Griffin to make it quick to include URL links, DOI links, and attachments, etc.
Linking URLs
A URL can be linked like this.
<<ln(http://www.jstor.org/stable/1734697,"A must read by PWA.")>> This lovely article is both deep and popular <<lnfn(http://www.jstor.org/stable/1734697,"A must read by PWA.")>>. This lovely article is both deep and popular <<lnfn(http://www.jstor.org/stable/1734697,"Science 4 August 1972: Vol. 177 no. 4047, pp. 393-396. 'More is Different'.")>>.
This results in the following.
This lovely article is both deep and popular [1].
This lovely article is both deep and popular [2].
Linking DOIs
A DOI can be linked like this.
<<doi(10.1126/science.177.4047.393,"A must read by PWA.")>> This lovely article is both deep and popular <<doifn(10.1126/science.177.4047.393,"A must read by PWA.")>>. This lovely article is both deep and popular <<doifn(10.1126/science.177.4047.393,"Science 4 August 1972: Vol. 177 no. 4047, pp. 393-396. 'More is Different'.")>>.
This results in the following.
This lovely article is both deep and popular [3].
This lovely article is both deep and popular [4].
As an aside, this article is NOT accessible through OCA if I use the Science link (the DOI link), but it IS accessible through OCA if I use JSTOR.org link. This is a useful thing to know as far as papers published in Science are concerned.
Linking attachments
la, lia (to do -- need to document)
Citing references (Bibtex etc.)
cite (to do -- need to document)
Raw html markups
h
Signing the document
If you like to leave a signature, after you edit a file, or, more frequently, after you make a comment to an existing page, you can write @SIG@. This will expand to your user name and a time stamp.
Odds and ends
Do you want to write '&' but the parser refuses to do so? Then, try
&
Do you want to write '\$'? Well, then all you have to remember is the number 36! Or, you can also escape \$ (this behavior is provided by MathJax, an HTML (post-)processor).
$
Research in the Gweon Group