Jump to content

Mod:Cheatsheet

From ChemWiki

Text Formatting

Description: Input: Result: Where it can be used: Notes:
Bold '''Bold''' Bold Anywhere
Italics ''Italics'' Italics Anywhere
Bold and Italics '''''Bold and Italics''''' Bold and Italics Anywhere
Superscript Text<sup>Superscript</sup> TextSuperscript Anywhere
Subscript Text<sub>Subscript</sub> TextSubscript Anywhere
Preformatted Text <pre>Preformatted Text</pre>
Preformatted Text
Anywhere No formatting can be used within a "pre" box, and it is useful for pasting information that would otherwise be interpreted as formatting.
{| width=20%

| <pre>Preformatted Text</pre>
|}

Preformatted Text
Start of a line A good trick to use to stop pre boxes from running over the edge of a page is to create a new unformatted table with defined maximum width.
Ignore Formatting <nowiki><pre>''Ignore Formatting''</pre></nowiki> <pre>''Ignore Formatting''</pre> Anywhere
Font Colour {{fontcolor1|white|red|White on Red}} White on Red Anywhere
Internal Links [[Main_Page|Chem wiki]] Chem wiki Anywhere Link name given after "|"
External Links [http://www.imperial.ac.uk/ Imperial Main Page] Imperial Main Page Anywhere Link name given after a space " "
Headers ==Level 2==

===Level 3===
====Level 4====
=====Level 5=====

Level 2

Level 3

Level 4

Level 5
Start of line Do not use Level 1, as this is reserved for titles.

All section headers are placed into the contents box and ordered once there are enough sections.

Bulleted List * Bullet point

** Bullet within a bullet

  • Bullet point
    • Bullet within a bullet
Start of line
Numbered List # Point 1

## Point 1.1 # Point 2

  1. Point 1
    1. Point 1.1
  2. Point 2
Start of line
Indent No indent

:First indent
::Second indent
:::Third indent

No indent

First indent
Second indent
Third indent
Start of line

Forced Line Break <br>

Sometimes a line break is needed to separate paragraphs or text in tables. Placing <br> between two
words creates a new line at that point.

If there's an image aligned to the right and you need to clear it, it's often best to use <br style="clear:right"> instead of dozens of <br>'s.


Now the image isn't getting in the way of unrelated text.

Table Formatting

Placing {| at the start of a line creates a table, provided it is closed with |} on a new line at the end of a table. The type of table and general settings are placed after {|. Typically, class="wikitable" is used. Wiki tables have default settings - titles (!) are centred and bold, cell sizes adjust automatically and have default colours.

To create a basic, 3x3 table, copy and paste this code:

{| class="wikitable"
! Column 1, Row 1
! Column 2, Row 1
! Column 3, Row 1
|-
| Column 1, Row 2
| Column 2, Row 2
| Column 3, Row 2
|-
| Column 1, Row 3
| Column 2, Row 3
| Column 3, Row 3
|} 

The result will be:

Column 1, Row 1 Column 2, Row 1 Column 3, Row 1
Column 1, Row 2 Column 2, Row 2 Column 3, Row 2
Column 1, Row 3 Column 2, Row 3 Column 3, Row 3

Each "!" and "|" represents a new column, the equivalent of moving right in a table, and each "|-" represents a new line, the equivalent of moving down and to the very left. The end tag "|}" defines the end of the table and should be used only once per table. To create a new row, copy from the last separator ( |- ) to the last text before the table's end tag ( |} ) and paste on a new line after before the end tag. For the above example this would be:

|-
| Column 1, Row 3
| Column 2, Row 3
| Column 3, Row 3

To create a new column, add a new "!" for the title row and "|" for every other row.

Table Styles

Colour can be added to a table if you feel like breaking away from grey and white. Copy the following code into each cell you want to style:

 style="background: #0D4F8B; color: white;" |

Paste it just after the "!" or "|" for each cell so

{| class="wikitable"
! Column 1, Row 1
! Column 2, Row 1
! Column 3, Row 1
|-
| Column 1, Row 2
| Column 2, Row 2
| Column 3, Row 2
|-
| Column 1, Row 3
| Column 2, Row 3
| Column 3, Row 3
|}

becomes

{| class="wikitable"
! style="background: #0D4F8B; color: white;" | Column 1, Row 1
! style="background: #0D4F8B; color: white;" | Column 2, Row 1
! style="background: #0D4F8B; color: white;" | Column 3, Row 1
|-
| Column 1, Row 2
| Column 2, Row 2
| Column 3, Row 2
|-
| Column 1, Row 3
| Column 2, Row 3
| Column 3, Row 3
|}
Column 1, Row 1 Column 2, Row 1 Column 3, Row 1
Column 1, Row 2 Column 2, Row 2 Column 3, Row 2
Column 1, Row 3 Column 2, Row 3 Column 3, Row 3

The #0D4F8B is a web colour, in this case producing a blue colour. www.color-hex.com is a good website for converting known colours into hexadecimal web colours.

As is shown in the Text Formatting section, all basic text formats can be used in tables when required, but two other useful controls are alignment and spans:

Alignment: Input: Result: :::.
Left style="text-align: left;" | Left Left
Centre style="text-align: center;" | Centre Centre
Right style="text-align: right;" | Right Right
Span 2 columns colspan="2" | Span 2 columns Span 2 columns
Span 2 rows rowspan="2" | Span 2 rows Span 2 rows

New "styles" are added after a semi colon, and must end in a semi colon before the end quotation mark. For example:

| style="text-align: left; color: red; background: white;" |

Otherwise, functions are added side by side before the "|" and separated with a space. For example:

| rowspan="2" style="color: red;" |

Room should be made to accommodate col- and rowspans. It should also be noted that rowspans expand the table downwards and colspans expand to the right.

Images

Images are uploaded via the Upload File link in the toolbox. Multiple images can be uploaded via this link. All uploaded files are placed in the same location on the server, and so it is important to give each file a unique name, otherwise it may be replaced. This is easily done by writing your username before each file name.

Note that .tiff files are not compatible in the wiki - save images as .jpg or preferably .png files

An image file's name, once uploaded, looks like this:

File:name.filetype

Images are embedded onto the page using a pair of double square brackets, "[[" and "]]". The result looks like this:

[[File:name.filetype|modifier 1|modifier 2]]

Modifiers are separated by vertical lines "|". These modifiers include image position, size, name, caption and frame.

Type: Modifier: Result: Notes:
Size: x200px Scales image to a height of 200 pixels
200px Scales image to a width of 200 pixels
Frame: frame Places a frame around the image
none Removes a frame from an image
Position: left Places the image left of the page/cell
center Places the image to the centre of the page/cell
right Places the image to the right of the page/cell
Text: Anything Places text in a caption under the image. Can include links and references Must be placed on the very right of the modifiers

Jmol Applets

One of the biggest advantages of writing up in a wiki is the ability to embed HTML objects such as Jmol applets. This chapter provides the basics to inserting and manipulating Jmol applets.

Have a look at the source code for the above Jmol object. Every object must be surrounded by the html tags <jmol><jmolApplet> and </jmolApplet></jmol>. This will initialise a Jmol object. The table below shows a few HTML tags you can place inside this object:

Opening Tag: Closing Tag: Purpose: Essential:
<uploadedFileContents> </uploadedFileContents> Put your filename in here. Can be single geometry file (eg .xyz, .mol) or a collection of geometries (eg .log). Yes
<color> </color> The background colour. Single word, such as "white" or "black". No
<size> </size> The size of the object, in pixels, eg "400". No
<script> </script> Allows JSmol script to be interpreted and applied. See below for the essentials, or here for the full list of JSmol script. No


Script in Jmol

Within the script tags (<script></script>), commands can be inserted. The commands are interpreted by the Jmol Applet and are essential, for example, for displaying vibrations. Each command must be separated by a semicolon, eg.

frame 12; vibration 2;

A few examples are given below.

Script: Example: Purpose: Notes:
frame MODEL frame 10 Selects model 10 from a collection of models and displays it. To see which model you need, run the Jmol without any script. Right click, select "Model" and find it within the collection. The model number will now be displayed when you right click again.
vibration PERIOD vibration 1 Displays the vibration of the current model with a period specified in seconds.
rotate AXIS DEGREES rotate x 90 Rotate about the specified axis. To find out which axis you need to rotate about, right click on the Jmol and select "Style" and check "Axes".
rotate spin AXIS RATE rotate spin y 45 Spins about AXIS, RATE degrees per second. Use sparingly.
select atomno=ATOM_1_NUMBER, atomno=ATOM_2_NUMBER select atomno=8, atomno=15 Selects atoms ATOM_1_NUMBER and ATOM_2_NUMBER. Once atoms are selected, bonds can be modified, or the atoms can be coloured.
select atomno=[ATOM_1_NUMBER ATOM_2_NUMBER] select atomno=[8 15]
connect BONDTYPE connect single
connect partial
connect none
Displays the bondtype between selected atoms. Useful to highlight bonds, or delete incorrectly displayed bonds using "connect none".
measure ATOM_1_NUMBER ATOM_2_NUMBER measure 8 25 Measures the distance between atoms ATOM_1_NUMBER and ATOM_2_NUMBER
measure ATOM_1_NUMBER ATOM_2_NUMBER ATOM_3_NUMBER measure 8 25 10 Measures the angle between atoms ATOM_1_NUMBER, ATOM_2_NUMBER and ATOM_3_NUMBER
draw pointgroup Adds symmetry planes and axes for symmetric or nearly symmetric molecules.
label display Displays all selected atoms. By default this is all atoms, but use in conjunction with "select" to control which atoms are labelled.
color label COLOUR color label red Changes the colour of the selected label This can be used directly after "label display" ie "label display; color label red"

You can test script before saving the page by right clicking on a Jmol object and selecting "Console". Try out some of the script on the Jmol above by typing in the script in the console and hitting enter.

MOs with Jmol

MOs can be displayed using Jmol. This section covers a procedure to achieve this.

HOMO 1

When you submit your job, add the keywords:

pop=full gfprint

Note: If this doesn't work, open the input file (.gjf or .com) and manually add this to the keyword line (where "opt", "freq" etc go).

This will save the MOs to the .log file. Upload the file to the wiki and create the Jmol using this file. Once the Jmol is loaded, right click on it and find the converged structure:

Selecting the correct frame

The converged structure will be at the bottom of the list of energies (Note that for a TS calculation such as the above, it is not necessarily the lowest energy). The number on the left, after "1." corresponds to the frame (here it is 16). Use script to load this frame. To get Jmol to render an effect like above, use the following script:

mo MO_NUMBER; mo nodots nomesh fill translucent; mo titleformat ""

where MO_NUMBER is the integer representing the MO you wish to display. You can us a combination of dots/nodots, mesh/nomesh, fill/nofill, translucent/opaque to get the desired effect. The threshold density to display the surface (isovalue) can be controlled with:

mo cutoff ISOVALUE

where ISOVALUE is the threshold - typically 0.02 in GaussView.

Notice that all the MOs are available when right clicking on the Jmol and choosing "Surfaces/Molecular Orbitals". You can use this to find MO_NUMBER.

Note: If your molecular orbitals aren't displaying, check that you have selected the correct frame with "frame FRAME_NUMBER".

Advanced Jmol Example

If you are experienced with programming you may want to try some of the advanced features of Jmol. The example below includes setting variables, the IF statement, buttons and a dropdown menu. See the Jmol Extensions Page for information about controls, and the Jmol Interactive Scripting Page for information about the IF statement.


Imaginary and lowest positive vibration of the TS of Anthracene and Maleic Anhydride

Comments are given in the code for the above Jmol in the source code.