Differences between revisions 1 and 2 Back to page
Revision 1 as of 2:20PM, Apr 06, 2011
Size: 3148
Editor: Gweon
Comment:
Revision 2 as of 2:22PM, Apr 06, 2011
Size: 3142
Editor: Gweon
Comment:
Deletions are marked like this. Additions are marked like this.
Line 81: Line 81:
----

LaTeX in Griffin

A customized parser is installed in Griffin to make it easy to use LaTeX expressions.

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 here, and customized and updated locally.

The default format of any wiki page is inline_latex. This is equivalent to having, at top of the document, the following declaration.

#format inline_latex

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 caveat about the GUI editor below.

The following declaration must be at top of the document in order to change the parser to the default plain vanilla one.

#format wiki

Customizing the LaTeX environment

The default preamble of the LaTeX in Griffin is the following.

\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.

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.

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

New macros have been added to Griffin to make it quick to include URL links, DOI links, and attachments, etc.

Linking URLs

ln, lnfn

Linking DOIs

doi, doifn

Linking Attachments

la, lia

Odds and Ends

Do you want to write & when you are in the LaTeX format? Then, use

&

Do you want to write $? Well, then you have to remember the number 36!

$