Help:Editing

From ProofWiki
Jump to: navigation, search

Contents

$\LaTeX$ Editing

The $\LaTeX$ interpreter used on this site is brought to you by MathJax.

This produces an experience different from that produced by the MediaWiki interpreter which is (at time of writing) the one used by Wikipedia and other places.

It also has a subtly different syntax in places. Specific instances will be detailed where relevant in the following.


Don't feel intimidated

You should feel welcome to contribute, even if you think what you write doesn't match the 'house style'.

In that case, this page is more to explain the meaning behind any minor changes that may be applied to your work after it has been submitted.

Over the course of prolonged contribution, it is considered both polite and very desirable that contributors put effort in mastering and adhering to house style.


$\LaTeX$ delimiters

To display an equation in line with some text, the equation should be enclosed in single dollar signs: $ ... $

Note that \( ... \) also works, but takes more effort to type and so is less recommended.

There may (but we hope not) still be some pages with <math> ... </math> in them. This is a holdover from when MediaWiki was the interpreter used for $\LaTeX$ commands. It still works in MathJax after a fashion but on transcluded pages, such enclosed $\LaTeX$ will not be converted to mathematical symbols.

If you see any, then feel free to change them to $ signs, as they should not be there.


House Style

Internal References

Due to the desired standard of rigor on ProofWiki, there are a lot of concepts on any given (proof) page that have their own, dedicated Proof or Definition page on ProofWiki.

To ensure ease of reference and maximal clarity and consistency, the following rules for internal reference are to be adhered to.

For information on creating links, see this section.


References to Theorems and Axioms

Whenever a theorem is invoked or referred to, be it in a proof or, for example, a clarifying comment, it should be referenced by its full title.

Also, for ease of editing, there is no need to change the case of theorem names; the ProofWiki page title will suffice.

Thus, for example, a valid reference to the result Union Distributes over Intersection is simply:

"By Union Distributes over Intersection, $A \cup \left({B \cap C}\right) = \left({A \cup B}\right) \cap \left({A \cup C}\right)$."

This is achieved by simply putting the title of the page you want to reference between double square brackets, [[ and ]].


The same convention applies to axioms, except that the namespace identifier Axiom: should be removed.

The correct way to reference the page Axiom:Axiom of Choice thus is:

Axiom of Choice

which is produced by:

[[Axiom:Axiom of Choice|Axiom of Choice]]


References to Definitions

Whether or not a particular concept should be linked to its definition page is subject to a less strict philosophy.

In general, whenever a part of a definition is critically used in an argument, or is important for understanding the flow of the argument, a link should be included.

A good rule of thumb is to include a reference at least at the first occurrence of a concept on a page, or whenever the concept is used in a new way, or a new context.

It is considered good practice to have at least one reference in a paragraph where the concept is used; this is - naturally - attached to the first occurrence of the concept.

These references are made in a non-intrusive way. Thus, we write:

Let $R$ be a ring.

and not:

Let $R$ be a Ring (Abstract Algebra).


For example, it is not necessary to include three references to Definition:Ring (Abstract Algebra) in one sentence which happens to have three occurrences of "ring" in it.

If however a proof contains three paragraphs, then it would be good to include at least one reference to Definition:Ring (Abstract Algebra) in each paragraph.


Mathematical Symbols

Inline Equations

Inline equations (that is, those that appear as part of a text sentence) merely need the dollar delimiters. For example:

The semilinear wave equation $\partial_t U = A U + B \left({U}\right)$ is Hamiltonian.

is produced by the input:

The semilinear wave equation $\partial_t U = A U + B \left({U}\right)$ is Hamiltonian.


Displayed Equations

Displayed equations should be indented using a single colon, for example, a displayed equation should look like:

$\displaystyle H \left({U}\right) = \int_0^{2 \pi} \frac {\left({\partial_x u}\right)^2} 2 + \frac {v^2} 2 - F \left({u}\right) \ \mathrm d x$

which you can enter as:

:$\displaystyle H \left({U}\right) = \int_0^{2 \pi} \frac {\left({\partial_x u}\right)^2} 2 + \frac {v^2} 2 - F \left({u}\right) \ \mathrm d x$


Using a format that places the equation on the center of the page:

$$E = m c^2$$

is discouraged, because with our house "short sentence" style, this breaks up the reading flow.


Big Operators

The \displaystyle command should be used at the front of expressions using the 'big operators' such as \sum and \prod, whether the equation is displayed or inline.

This includes (but may not be exclusive to) the commands \frac, \lim, \bigcup, \bigcap, \int, \sum and \prod.

For example:

$\sum_{i \mathop = 1}^n$
$\prod_{i \mathop = 1}^n$
$\frac {-b \pm \sqrt {b^2 - 4ac}} {2 a}$
$\lim_{n \to \infty} \frac 1 n$

all look better as:

$\displaystyle \sum_{i \mathop = 1}^n$
$\displaystyle \prod_{i \mathop = 1}^n$
$\displaystyle \frac {-b \pm \sqrt {b^2 - 4ac}} {2 a}$
$\displaystyle \lim_{n \to \infty} \frac 1 n$

and are produced by, respectively:

\displaystyle \sum_{i \mathop = 1}^n
\displaystyle \prod_{i \mathop = 1}^n
\displaystyle \frac {-b \pm \sqrt {b^2 - 4ac}} {2 a}
\displaystyle \lim_{n \to \infty} \frac 1 n

Note however that instead of \displaystyle \frac, the form \dfrac, which has the same effect, is preferred, unless other big operators are used in the same equation (in which case you need to use \displaystyle anyway).


Furthermore, to improve aesthetic appeal certain characters, such as $=$ and $\in$, when used in subscripts of big operators, must be endowed with the \mathop command to enforce appropriate spacing.

As a contrast, compare:

$\displaystyle \sum_{i=1}^n \quad \sum_{i \mathop = 1}^n$
$\displaystyle \bigcap_{n \in \N} \quad \bigcap_{n \mathop \in \N}$

The \mathop command is to be used in the following manner (the code produces $\displaystyle \sum_{i \mathop = 1}^n$):

\displaystyle \sum_{i \mathop = 1}^n


The d of Calculus

When writing calculus operators, use a non-italic form for the $\mathrm d$, that is, write it as \mathrm d. So you would have:

$\dfrac {\mathrm d y} {\mathrm d x}$

which would be produced by:

\dfrac {\mathrm d y} {\mathrm d x}

rather than:

$\dfrac {d y} {d x}$

which would be produced by:

\dfrac {d y} {d x}


Fonts

We have several fonts available, many of which have particular conventional uses in mathematics.

Examples are:

Calligraphy: \mathcal, which produces $\mathcal{ABCDE} ...$ (uppercase only)
Blackboard: \mathbb or (preferably) \Bbb, which produces $\Bbb{ABCDE} ...$ (uppercase only)
Script: \mathscr, which produces $\mathscr{ABCDE} ...$ (uppercase only)
Sans serif: \mathsf, which produces $\mathsf{ABCDE} ... \mathsf{abcde} ...$
Fraktur: \mathfrak, which produces $\mathfrak{ABCDE} ... \mathfrak{abcde} ...$

The use of Fraktur and Script are discouraged, as they are not so easy on the eye and can be difficult to decipher on certain browsers.


Punctuation niceties

A sentence broken by a displayed equation should be ended with a colon:

$\dfrac {\operatorname{display}} {\operatorname{equation}}$

for a better presentation.


On the other hand, the displayed equation itself should not be ended with a full stop or comma.

That is, one should write:

$\displaystyle \bigcap_{S \mathop \in \Bbb S} \Bbb U \setminus S = \Bbb U \setminus \bigcup_{S \mathop \in \Bbb S} S$

and not:

$\displaystyle \bigcap_{S \mathop \in \Bbb S} \Bbb U \setminus S = \Bbb U \setminus \bigcup_{S \mathop \in \Bbb S} S$.

This is a style tip borrowed from Ian Stewart[1{{eqn}}.


Q.E.D.

To end a proof, the template {{qed}} should be used, which looks like:

$\blacksquare$

or if you wish to break your page up into subproofs, end those subproofs with {{qed|lemma}}, which looks like:

$\Box$

In a dash for consistent notation, it is understood that these templates should immediately succeed the last line of the proof, i.e.:

Hence the result.
{{qed}}

and not:

Hence the result.

{{qed}}

Tempting though it is to write "Q.E.D." at the bottom, this is so uncool as to be positively naff.


Code style

There are a few general source code conventions which make your code easier to read and maintain:

  • Each variable, and each command beginning with a backslash should be preceded by a space, except (for some unexplained result of evolution) when enclosing things in brackets. See some of the above instance for a typical example.
  • When enclosing brackets around an object, always use the \left({ ... }\right) format, for example f \left({x}\right) rather than f(x).
  • There should be no need to use the commands \big, \Big, \Bigg etc. for specifying the sizes of parentheses. Using the \left({...}\right) technique (as above) will almost always automatically size the brackets aesthetically.
  • Punctuation should appear outside the LaTeX environment, for example:
Hence $f \left({x}\right)$. (produced by: $f \left({x}\right)$.)

as opposed to:

Hence $f \left({x}\right).$ (produced by: $f \left({x}\right).$)
  • Single-character parameters to standard $\LaTeX$ constructs need not be put in curly braces. That is, \frac 1 2 is preferred to \frac {1} {2}. They both produce:
$\dfrac 1 2$

It makes the source code significantly easier to read.

Having said that, please do not ignore the rule about spacing. The same effect can also be achieved by \frac12 (see, it still looks like $\dfrac12$) but that is significantly harder to interpret visually.


Aligned material

If an equation includes multiple equalities or inequalities, it is best to place each equality on a new line.

For example:

$\dfrac {\mathrm d} {\mathrm d t} H \left({U}\right) = \mathrm d H \left({U} \right) \cdot \dot U = \Omega \left({X_H \left({U}\right), \dot U} \right) = \Omega\left({X_H \left({U}\right), X_H \left({U}\right)} \right) = 0$

would look better as an aligned equation. This is done using the following commands:

{{begin-eqn}}
{{eqn|ll = |l = |r = |rr = |c = |cc = }}

  ...

{{eqn|ll = |l = |r = |rr = |c = |cc = }}
{{end-eqn}}

Here, the section following |l = is a $\LaTeX$ environment, and should contain anything you want to appear to the left of the equals sign.

The section following |r = is the same, but will appear to the right of the equals sign.

|ll = and |rr = are similar, but produce material in columns further to the left and further to the right respectively. In particular, the ll column is often used for an "implies" sign where the l and r are used for either side of a string of equations.

All these $\LaTeX$ environments are already in \displaystyle mode, so there is no need to include that command in your equation.

When entering such an {{eqn}} environment, it should globally look like this:

{{eqn|l = 1 + 1
     |r = 2
}}

That is, it adheres to the following principles:

  • Every empty column should in general be omitted, except perhaps for |c = sections, which can be left as placeholders for possible future addition of comments
  • Non-empty columns are entered on separate lines, with the | and = all aligned

These conventions serve to optimize readability and brevity.

More options and abilities of the {{eqn}} can be found on its page, Template:Eqn.


The section following |c = is not a $\LaTeX$ environment, and can be used to add any comments about the equation at this point.


So the example we gave above would be typeset as:

{{begin-eqn}}
{{eqn|l = \frac {\mathrm d} {\mathrm d t} H \left({U}\right)
     |r = \mathrm d H \left({U}\right) \cdot \dot U
     |c = by the chain rule 
}}
{{eqn|r = \Omega \left({X_H \left({U}\right), \dot U} \right)
     |c = by the definition of $X_H$
}}
{{eqn|r = \Omega\left({X_H \left({U}\right) , X_H \left({U}\right)}\right)
     |c = by Hamilton's equations
}}
{{eqn|r = 0
     |c = by skew-symmetry of $\Omega$
}}
{{end-eqn}}

The finished result will look like:

\(\displaystyle \) \(\displaystyle \) \(\displaystyle \) \(\displaystyle \frac {\mathrm d} {\mathrm d t} H \left({U}\right)\) \(=\) \(\displaystyle \) \(\displaystyle \mathrm d H \left({U}\right) \cdot \dot U\) \(\displaystyle \) \(\displaystyle \)          by the chain rule          
\(\displaystyle \) \(\displaystyle \) \(\displaystyle \) \(\displaystyle \) \(=\) \(\displaystyle \) \(\displaystyle \Omega \left({X_H \left({U}\right), \dot U} \right)\) \(\displaystyle \) \(\displaystyle \)          by the definition of $X_H$          
\(\displaystyle \) \(\displaystyle \) \(\displaystyle \) \(\displaystyle \) \(=\) \(\displaystyle \) \(\displaystyle \Omega\left({X_H \left({U}\right) , X_H \left({U}\right)}\right)\) \(\displaystyle \) \(\displaystyle \)          by Hamilton's equations          
\(\displaystyle \) \(\displaystyle \) \(\displaystyle \) \(\displaystyle \) \(=\) \(\displaystyle \) \(\displaystyle 0\) \(\displaystyle \) \(\displaystyle \)          by skew-symmetry of $\Omega$          

The operator that is displayed in this template can be changed using |o = to show inequalities, etc.

Note the following:

  • Do not include two consecutive open or close curly braces: ] or }} anywhere in your eqn templates. It will break the interpreter.

Put spaces in: { { or } } and it will be okay.

  • Do not include the vertical line | (a.k.a. "pipe") in $\LaTeX$ expressions as this also breaks the interpreter. Use \vert instead.
  • In particular, \| (used to produce $\|$) has the same problem. Use \Vert instead.

These caveats apply only within the {{eqn}} environment. Elsewhere on the page such constructs should be fine. To accommodate for the inevitable copy-paste efforts, and for consistency's sake, it is however desirable to always use \vert and \Vert.


English Style

Language

This is an English language website, and so all pages are to be presented in English.[2] Where there is a difference between spellings between US and rest-of-world English, the US version is generally used, with a few exceptions (the spelling of metre is under discussion).


Linguistic style

During the presentation of a mathematical argument, a formal style is preferred.

For example:

Suppose that ...

is preferred to:

Let's suppose that ...

and:

Hence the result.

is preferred to:

... and we're done.

As an attempt is being made for ProofWiki to appeal to as wide an audience as possible worldwide, using colloquial language (except for example when illustrating logical concepts by means of everyday examples) is discouraged.


Abbreviations

The difference between "e.g." (exempli gratia - for example) and "i.e." (id est - that is) is sadly falling into obscurity. It is all too common for "i.e." to be used when "for example" is meant, and vice versa.

So as to remove all confusion, such abbreviations are discouraged.


Also, beware the ubiquitous confusion between its and it's. The full version it is should be used instead of it's in any case, so it's should have no reason to appear.


Sentence Length

During the course of an argument to present a mathematical proof, follow these rules:

  • Each sentence should be short.
  • Each sentence should be on a separate line.

Compare the presentations:

$(1):$

$S$, because of $R$ (we know this from Tom's Theorem), because of $Q$ (from above) which applies when $P$ holds (see Fred's Theorem), but we know $P$ holds because it's what we defined in the first place.

$(2):$

Let $P$ hold.
From Fred's Theorem, it follows that $Q$.
From above, $R$.
From Tom's Theorem, $S$.

Whether or not filler words are needed (it follows that, we have, hence etc.) is a stylistic decision. Fewer words are preferred, but clarity and completeness override every other consideration.


Citations

It is good to indicate where the information comes from. This is done in ProofWiki in the last of the page in a section called Sources.

There are several templates which can be used:


Hardcopy Sources

Template:BookReference
This is used to reference a specific book which will have been documented in the ProofWiki:Books page. The idea of this is that if you have sourced the information for a page directly from a book, then it should be possible to provide the details of that book.

Example:

which can be found on the page Characteristic Times Element of Ring is Zero.


Template:Citation
This is used to reference a specific article in a journal. This is still under development, as the individual Journal entries still need to be worked on.

Examples of their use can be found on various ProofWiki:Mathematicians pages, for example:

  • 1908: Mathematical Logic as Based on the Theory of Types (Amer. J. Math. Vol. 30: 222 – 262)

which appears on the page for Bertrand Russell.

The style of this is still evolving.


Online Sources

There are templates for the following online sources. Each one has been crafted so as to produce a reference in the style requested by the online source in question.


Template:MathWorld
This provides a direct link to a page on the http://mathworld.wolfram.com/ website.

Example:

which can be found in the page Area of a Sector.


Template:Planetmath
This provides a direct link to a page on the http://planetmath.org/ website.

Example:

which can be found in the page Urysohn's Lemma.


Template:MacTutor Biography
This provides a direct link to a page on the http://www-history.mcs.st-andrews.ac.uk/history/index.html website.

Example:

which can be found in the page ProofWiki:Mathematicians/Hanna Neumann. Note that the link presentation is taken from the page the template is invoked from.


Template:Khanacademy
This provides a direct link to the Khan Academy.

Example:

  • For a video presentation of the contents of this page, visit the Khan Academy.

which can be found in the page Limit of Sine of X over X/Geometric Proof.


Template:Metamath
This provides a direct link to Metamath.

Example:

which can be found in the page Principle of Transfinite Recursion.


Template:OEIS
This provides a direct link to the On-Line Encyclopedia of Integer Sequences.

Example:

which can be found in the page Square Root of 2 is Irrational.


Template:TORI
This provides a direct link to the TORI source site.

Example:

which can be found in the page Definition:Tetration.


Template:SpringerOnline
This provides a direct link to a page on the Springer Online Encyclopedia of Mathematics.

Example:

which can be found in the page Definition:Ring (Abstract Algebra).


Acceptability of Online Sources

NOTE: The above are the ONLY web resources which are to be used as general citation sources. Others may be added to the above as and when they come to our attention as being particularly useful. So feel free to challenge this assertion if you find something which appears to be a particularly rich and productive resource.

Scholarly papers and lecture notes for accredited university courses which are available online may usually also be cited.

What are not generally acceptable include:

Links to pages in homework help forums
Discussion pages in any web forum
Wikipedia - not because we don't like them, but because as they are self-proclaimed tertiary source, there is no need to do so - we would rather go to the actual source works.



No Longer Supported

The following $\LaTeX$ commands are not supported in MathJax, but may still be present in some pages. When found they need to be replaced.

For $\lor$: \or to be replaced by \lor
For $\land$: \and to be replaced by \land
For $\R$: \reals to be replaced by \R
For $\varnothing$: \O to be replaced by \emptyset or preferably \varnothing
For $\exists$: \exist to be replaced by \exists
For $\operatorname{sgn}$: \sgn to be replaced by \operatorname{sgn}


The \texttt needs to be replaced by \mathsf (probably).

If you find any more examples, add them here.


External Links

It may not be exactly the same version of $\LaTeX$, but I always find this page helpful as a first, quick overview:

This is also a good reference page, pertaining to MediaWiki LaTeX:

but be aware that not all commands are supported.

This is a link of all the currently supported commands available:


Wiki Editing

Text formatting

Bold, italic and more

When writing a definition, the term that is being defined should be set in bold font.

The text you would like to be bold should be enclosed in three single quotes. For example:

  '''Bold text'''  

creates: Bold text.


Italic font is produced with two single quotes, for example:

  ''Italic text''  

creates: Italic text


To produce bold, italicised writing, use five consecutive single quotes:

  '''''Bold and italic text'''''  

creates: Bold and italic text.


Other commands include:

 <u> Underlined text </u> 

creates: Underlined text


 <code> Source code </code> 

creates: Source code


 <tt> Fixed width text </tt> 

creates: Fixed width text

Line breaking

Breaking a line in the editor does not break a line in the displayed text. For example:

''I will continue this''
''on the next line''

displays as:

I will continue this on the next line.

To break a line, space the text with a single blank line:

''I will continue this''

''on the next line''


Sections and subsections

A section heading is produced by enclosing the desired title between two = signs.

For example:

  == Definition ==  

will produce the section entitled "Definition".


A subsection should be enclosed between three equals signs, for example:

  === Subsection ===  

will produce a subsection within the section that it is located.


You can continue making sub-subsections etc. with four or more equals signs.

As a general rule on spacing, each section or subsection should be preceded by two blank lines and followed by a single blank line.

Each sentence should appear on a separate line, with a single blank line above and below.


Indenting and bullet points

To indent a sentence or equation, add a : at the start of the line. For example:

  :Indented material  

will produce:

Indented material

For a larger indent use two or more colons. Each displayed equation should be preceded with a single colon.


To produce a list of bullet points, write each point on a line beginning with a *. For example:

 * Bullet point 1 
 * Bullet point 2  

produces:

  • Bullet point 1
  • Bullet point 2


A numbered list is made with a #:

 # Item 1 
 # Item 2 

produces:

  1. Item 1
  2. Item 2


You can make nested bullet lists and numbered lists, for example:

* Outer list; bulleted
# Sub-list; numbered
# A second item
## A sub-sub-list, numbered
## A second item
* Outer list; second item
* etc.

which produces:

  • Outer list; bulleted
  1. Sub-list; numbered
  2. A second item
    1. A sub-sub-list, numbered
    2. A second item
  • Outer list; second item
  • etc.

Unfortunately you can not put a blank line between any two lines in a numbered list. This, for example:

* Outer list; bulleted
# Sub-list; numbered

# A second item

## A sub-sub-list, numbered

## A second item
* Outer list; second item
* etc.

... produces this:


  • Outer list; bulleted
  1. Sub-list; numbered
  1. A second item
    1. A sub-sub-list, numbered
    1. A second item
  • Outer list; second item
  • etc.

... which limits its flexibility and compromises the ability to space complicated structures to suit the eye. So you may find that using this technique may not be the most suitable choice for any given page.


Link to internal page

To link to another page on ProofWiki, you must enclose the page name in double square brackets.

For example, to link to Pythagoras's Theorem, you would type:

 [[Pythagoras's Theorem]] 

To change the text to say something different and still link to that page you need to use a |.

For example to link here you would type:

 [[Pythagoras's Theorem|here]] 

To link to a particular section on a page, append a # to the page name followed by the subsection.

For example, to link here you would type:

 [[Pythagoras's Theorem#The Classic Proof|here]] 


As a general rule each if you are using a mathematical definition or result, you should link to the relevant page at least for the first occurrence on the page.

Subsequent uses of the same page may of course be linked; there is no need to link the same page five or ten times in the same article, but it does no harm. In particular, when referencing the same page in a slightly different context, it is a good idea to provide another link to that same page.


Redirecting a page

If a theorem or definition is commonly known by more than one name, rather than create two separate pages just one page should be created, and the second redirected to the first.

This should be done with the command:

  #Redirect [[Page Name]]  

For example, to redirect a page to Pythagoras's Theorem enter:

  #Redirect [[Pythagoras's Theorem]]  

Remember to add categories to the redirected page as appropriate.


Link to external page

Linking to an external page is almost the same as linking to an internal page.

You need to enclose the page name in [] 's.

To add text the link, you just have to add what you want to name the link inside the brackets.

For example:

 [http://www.google.com Google] 

would create a link that looked like this: Google


External Links

The MediaWiki help pages are a good general reference for page editing:


Transclusion

For an example of how this technique is used, see Trigonometric Identities.

References

  1. Ian Stewart: Galois Theory, 3rd Edition (2004):
    "I have come to the conclusion that eliminating visual junk from the printed page is more important than punctuatory pedantry ... everything is much cleaner and less ambiguous without punctuation."
  2. Suggestions have been made as to how we may go about the exercise of internationalization, but progress in that direction is slow due to its perceived low priority.