Science:MER/Manual/How To
MER Manual |
---|
Table of Contents |
This page contains a list of useful "how-to's" for adding content to the MER wiki.
Formatting Math Text
- To format solutions, you need to know LaTeX. The only change is that where you would normally use double dollar signs to indicate math mode, you will use html tags
<math> f'(x) = \frac{1}{x^2} </math>
If you want to just type up your solutions in normal LaTex, you can run them through the converter on this webpage and then enter them into the wiki. - Because it can be tedious to be constantly typing the math html tags, if the symbols to be formatted are simple (like a single variable in the middle of a sentence), we simply italicize by using
''y = 0''
- Sometimes even when you use the html math tags, the formatting just looks like italicized text. This can be particularly annoying when dealing with derivatives, for example: . You can't really see the "prime." In order to "force" math mode, use
<math> \displaystyle f'(x) = 0 </math>
which gives
LaTeX
If you've never used LaTeX before, fear not! Most of the symbols used to typeset university level mathematics are not that challenging to learn. This wikibook has a fairly comprehensive list of common symbols (you can avoid the first section on environments). However, the best way to learn the LaTeX needed to contribute to the wiki is just to look at the sample code behind certain questions. Note that since equations are never numbered, mediawiki uses \begin{align} for "\begin{align*}" and gives an error on the latter.
A gentle intro to Editing Math Equations using LaTeX | ||||
---|---|---|---|---|
If you already use TeX, then all you need to know is that your normal syntax must be surrounded by tags:
<math> syntax </math>
<math> syntax ~</math> <math> \displaystyle syntax </math> <math> syntax \,\!</math> <math> syntax \,</math>
If you've never used TeX before, here's a crash course: FractionsTo make a fraction use: \frac{foo}{bar} These render as: Superscript and SubscriptTo make superscripts and subscripts, use: x^2 y_0 These render as: Greek LettersTo make greek letters, you just need to know their names. Use a capital for the capital letter, a lower-case for the lower-case letter: \pi \theta \omega \Omega \gamma \Gamma \alpha \beta These render as like: Trig StuffYou can use the following to render trig functions without italics so it looks nicer: \cos(\theta) \sin(\theta) \tan(\theta) These render as: , as opposed to: cos(\theta) sin(\theta) tan(\theta) Which look like: In general, if you want to make words not in italics in math, use \text{foo bar} Which looks like instead of Big BracketsUsually, a normal parenthesis or bracket will do fine: x^2 (2x + y) Renders as: But if you have big stuff like fractions, it doesn't always look as nice: (\frac{\pi}{2}) renders as: Instead, use: x^2 \left(2x + y\right) \left( \frac{\pi}{2} \right) Which looks like: Notice that these kinds of brackets are always the right size. They also work with square brackets: \left[ \frac{\pi}{2} \right] \left[ x^2 (2x + y) \right] Renders as: OtherThese are some other things that may be useful. In general, if you want to know how to make a type of symbol, you can find many usefuly lists by searching for TeX or LaTeX math symbols. \sqrt{foo}
\int_a^b f(x)dx
\pm
\mp
\approx
One thing you may notice is that adding spaces between symbols will not add more space in the rendered output. a_0 a_1 a_0 a_1 These will both render as: If you want to force spacing between symbols, you have to use the "~" symbol: a_0~~~~~~~~~a_1 renders as: Also, it can be useful to note that there as two kinds of math font that the wiki will try to use. One is a smaller font which fits better into a line of normal text, and the other is a larger font which looks nicer when you have an equation on its own line. Whenever you make somthing "big" like a fraction or square root symbol, the wiki will automatically use bigger font. Sometimes you may want to force a line to be bigger because it looks nicer. I have found no nice way to do this other than it just so happens that if you put a "~" at the end of a line that line will be rendered in the bigger font; since the "~" is at the end you won't notice that there is technically an extra blank space there. A\cos(\omega t)</math> A\cos(\omega t)~</math> These will render as:
Lastly, don't be afraid to nest things together to make really complicated looking expressions: v_2 = \sqrt{\frac{2\left(P_1 - P_2\right)}{\rho \left(1 - {\left(\frac{A_2}{A_1}\right)}^2\right)}} will render as: |
Adding Images
See the UBC wiki help pages about how to add pictures and how to upload files. The convention that we will use is to have these images have a long but similar name to the page they will be used for. Say you want to add a picture to your solution of question 1 (a) of the April 2009 exam of MATH101. The question page is at the address:
- Science:Math_Exam_Resources/Courses/MATH101/April_2009/Question_1_(a)
Then the picture material for that question (for hints, questions, solutions etc.) should be all uploaded under the path:
- File:Math_Exam_Resources_Courses_MATH101_April_2009_Question_1_(a)_picture_1.png
where you can change picture_1 to anything you want and the .png has to match the type of the file you are uploading.
Note that when writing the name of the file, you don't write the File: part, the upload will do it on its own, so when in the upload page, when asked for the new filename, just write:
- Math_Exam_Resources_Courses_MATH101_April_2009_Question_1_(a)_picture_1.png
See also
Collapsible Tables
To create (basic) collapsible tables, use the following code:
{| class="collapsible wikitable collapsed" width="100%" style="background: #FFFFFF;" ! style="padding-left:1em; text-align: left;" | TITLE GOES HERE |- |style="padding:1em"| CONTENT GOES HERE |}
Adding WolframAlpha Widgets
This widget allows you to add | Wolfram Alpha widgets to your wiki page.
To insert this widget, use the following code:
{{#widget:WolframAlpha|id=c44e503833b64e9f27197a484f4257c0}}
Parameters
- id - the widget id. Widgets can be found or created at the Wolfram|Alpha widgets page.
Note: all parameters come from the publish page of the Widget Builder.
Sample result
Adding the code to the Visual editor
When you insert a widget code (including YouTube, Slideshare, etc.) to the Visual Editor, copy the code then paste it to the Visual Editor. Then click on the code, and press edit. Then, you can change the parameter and press Apply Changes.
Deleting a Page
Simply add the text {{delete}} to the page in question. If not obvious, please explain your reason for deletion in the commit message. The page will be deleted by the UBC wiki administrator 30 days later.
Instead of deleting, consider moving the page instead. Eg when you want to rename Question 1 to Question 01.
Details on page deletion, Details on page moving.
Adding a New Exam
Coming soon.