|
| 1 | +--- |
| 2 | +title: "Tutorial: Example tutorial to be written in Markdown" |
| 3 | +--- |
| 4 | + |
| 5 | +[//1]: <> (Comment: This comment is only in the .md file, as opposed to the next line which is raw HTML and creates that is placed into the .html file.) |
| 6 | +<!--- Don't change the HTML version of this file; edit the .md version --> |
| 7 | + |
| 8 | +* Exercise files are found [here](data/index.html) |
| 9 | + |
| 10 | +<a name=Intro></a> |
| 11 | + |
| 12 | +## Intro |
| 13 | + |
| 14 | +The ## indicates a top-level heading. Headings with a single # would be used for dividing a file into completely separate sections. Probably not what you would want. Start with an introduction and explain here what the tutorial is all about. |
| 15 | + |
| 16 | +### Writing Equations |
| 17 | + |
| 18 | +Note that subheadings use more than three # characters and sub-sub-headings can use four. |
| 19 | + |
| 20 | + |
| 21 | +Note that equations can generated with MathJax (TeX formatting). "In-line" equations, such as: Er${}_2$Ge${}_2$O${}_{7.5}$ or $Er_2Ge_2O_{7.5}$ |
| 22 | +or $P 4_1 2_1 2$. Note that by default MathJax uses an *italic* font for letters and not numbers, but that can be overridden, like this $\textrm{Er}_2\textrm{Ge}_2\textrm{O}_{7.5}$ or |
| 23 | +$\rm Er_2Ge_2O_{7.5}$. Here is another in-line equation: |
| 24 | +$d(u,v) = 1 - \frac{ u \cdot v }{ \sqrt{ u^2 v^2 } }$. Note the difference to a display equation, as below. In-line equation delimiters are a single dollar sign ($). |
| 25 | + |
| 26 | +#### Display Equations |
| 27 | + |
| 28 | +Or, write display equations, such as |
| 29 | +$$ d(u,v) = 1 - \frac{ ( u - \bar{u} ) \cdot ( v - \bar{v} ) }{ \sqrt{ ( u - \bar{u} )^2 ( v - \bar{v} )^2}} $$ |
| 30 | +which appear on a line by themselves, use with double-dollar sign delimiters ($$). |
| 31 | + |
| 32 | +### Formatting text |
| 33 | + |
| 34 | +A blank line indicates the start of a paragraph. Multiple blank lines are ignored. Lists can start with a "*" for a bullet or a number and a period (such as "0.") to indicate numbering. Use 4 spaces of indentation to indicated a nested list. |
| 35 | + |
| 36 | +0. numbered list item 1 |
| 37 | +0. numbered list item 2 |
| 38 | + |
| 39 | +* outer bullet list |
| 40 | + * inner bullet list |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | +Format text between a single pair of asterisks for *italic* (like this `*italic*`) and doubled stars **bold** (like this `**bold**`). |
| 45 | + |
| 46 | + |
| 47 | +Text that should be displayed verbatim (without interpretation) can be |
| 48 | +placed between two |
| 49 | +"backtick" quotes (\`). So here `$A = a x^2 +b x + c$` is not interpreted as an equation. |
| 50 | +For a block of text that spans multiple lines, begin the block with three "back tick" quotes (\`\`\`) alone on the line and end the block with the same. |
| 51 | + |
| 52 | +### Links |
| 53 | + |
| 54 | +To provide a link to a location within the tutorial, define an anchor in HTML. Place this just before the location to be referenced. Here is the HTML code to define an anchor "myanchor": |
| 55 | + |
| 56 | +``` |
| 57 | + <a name=myanchor></a> |
| 58 | +``` |
| 59 | + |
| 60 | +To place a link to the anchor use a command to reference to that location, with a MarkDown command like this: |
| 61 | +``` |
| 62 | + here is some text [with a link](#myanchor) provided |
| 63 | +``` |
| 64 | +Likewise for an external reference, replace "#myanchor" with a URL (beginning with http:). |
| 65 | + |
| 66 | +Here is some text [with a link](#Intro) provided to the Intro section and here is an external link: [GitHub ticket](https://github.com/AdvancedPhotonSource/GSAS-II/issues). |
| 67 | + |
| 68 | +### Tables |
| 69 | + |
| 70 | +Tables can be created using pipe characters (|) and dashes (-). |
| 71 | +Note that a colon can be used for right or left alignment or use two, as below for centering. |
| 72 | + |
| 73 | + |
| 74 | +``` |
| 75 | + | `FontSize_incr` | Example | |
| 76 | + | :---: | ------------------------------------- | |
| 77 | + | 0 | [see file `font0.png`](imgs/font0.png) | |
| 78 | + | 3 | [see file `font0.png`](imgs/font3.png) | |
| 79 | +``` |
| 80 | + |
| 81 | +The code above creates the table below. |
| 82 | + |
| 83 | +| `FontSize_incr` | Example | |
| 84 | +| :---: | ------------------------------------- | |
| 85 | +| 0 | [see file `font0.png`](imgs/font0.png) | |
| 86 | +| 3 | [see file `font0.png`](imgs/font3.png) | |
| 87 | + |
| 88 | +See the markdown docs for other mechanisms to create tables. |
| 89 | + |
| 90 | + |
| 91 | + |
| 92 | +### Figures |
| 93 | + |
| 94 | + |
| 95 | + |
| 96 | +There are multiple ways to place figures into a tutorial. The simplest way is to use the standard MarkDown command: |
| 97 | + |
| 98 | +``` |
| 99 | + |
| 100 | +``` |
| 101 | + |
| 102 | +Note the similarity of this with the command for creating links, except that an explanation mark (!) is placed at the beginning. The .css file used with tutorials places figures created with this command at the right margin. |
| 103 | +Typically one should place the figure before the text that references it. Leave a blank line after this command or the figure is placed into a paragraph -- probably not what you want, except perhaps with a very small figure. |
| 104 | + |
| 105 | +Alternately one can use HTML commands to place an image at a particular place with an HTML command like this: |
| 106 | + |
| 107 | +``` |
| 108 | +<BR clear=all> |
| 109 | +<img src="./imgs/menu1.png" alt="extra peaks" width="200px;"> |
| 110 | +``` |
| 111 | + |
| 112 | + |
| 113 | +<BR clear=all> |
| 114 | +The `BR` command forces the image into a new area of the page and may not be wanted with a complex image layout. |
| 115 | +<img src="./imgs/menu1.png" alt="extra peaks" width=200px height=100px align="left" align="top" border=2px title="distorted image"> |
| 116 | +The main advantage of the HTML command is that it allows one to rescale an image by specifying options such as `width` and/or `height`. Other options that may be of use are `align`, (align options are top, bottom, center, left, right), `title` (creates a tool-tip) and `border=2px` (for a 2 pixel black border around the image). |
| 117 | +Also, with an HTML command one can control how text is wrapped around an image. |
| 118 | + |
| 119 | +The figure above was generated with this command embedded into the paragraph: |
| 120 | +``` |
| 121 | +<img src="./imgs/menu1.png" alt="extra peaks" width=200px height=100px align="left" align="top" border=2px title="distorted image"> |
| 122 | +``` |
| 123 | + |
| 124 | +<BR clear=all> |
| 125 | + |
| 126 | +### Recommended |
| 127 | + |
| 128 | +End the document with a table with the date and author(s). Here is the code to do that: |
| 129 | + |
| 130 | +``` |
| 131 | + ---- |
| 132 | + | | |
| 133 | + | ---: | |
| 134 | + | Brian Toby | |
| 135 | + | August 1, 2025 | |
| 136 | +``` |
| 137 | + |
| 138 | +---- |
| 139 | +| | |
| 140 | +| ---: | |
| 141 | +| Brian Toby | |
| 142 | +| August 1, 2025 | |
0 commit comments