none
[openafs-wiki.git] / TWiki / TextFormattingFAQ.mdwn
1 <font>**Text Formatting FAQ**</font>
2
3 - The most frequently asked questions about text formatting are answered here.
4   - [[TextFormattingRules]] has the complete system in a handy quick reference format.
5
6 <div>
7   <ul>
8     <li><a href="#How do I make a separator?"> How do I make a separator?</a></li>
9     <li><a href="#How do I create a title or a hea"> How do I create a title or a heading?</a><ul>
10         <li><a href="#This is an HTML heading">This is an HTML heading</a></li>
11       </ul>
12     </li>
13     <li><a href="#Text enclosed in angle brackets"> Text enclosed in angle brackets like &lt;filename&gt; is not displayed. How can I show it as it is?</a></li>
14     <li><a href="#Some words (like _WinAPI) have a"> Some words (like WinAPI) have an unwanted question mark at the end. How can I prevent that?</a></li>
15     <li><a href="#How can I write fixed font text?"> How can I write fixed font text?</a></li>
16     <li><a href="#Text I enter gets wrapped around"> Text I enter gets wrapped around. How can I keep the formatting as it is?</a></li>
17     <li><a href="#How do I create tables?"> How do I create tables?</a></li>
18     <li><a href="#Can I include images and picture"> Can I include images and pictures?</a></li>
19     <li><a href="#Can I write colored text?"> Can I write colored text?</a></li>
20   </ul>
21 </div>
22
23 > ----
24 >
25 > ### <a name="How do I make a separator?"></a> How do I make a separator?
26 >
27 > You can make a horizontal separator by writing 4 or more dashes at the beginning of a line.
28 >
29 > ----
30 >
31 > ### <a name="How do I create a title or a hea"></a> How do I create a title or a heading?
32 >
33 > The most simple way is to enclose it in '\*' Asterisk characters or '\_' Underscore characters.
34 >
35 > **This is an example header enclosed in Asterisk characters**
36 >
37 > _This is an example header enclosed in Underscore characters_
38 >
39 > You could use also HTML tags for headings, e.g. `<H4>This is an HTML heading</H4>` will show up as:
40 >
41 > #### <a name="This is an HTML heading"></a> This is an HTML heading
42 >
43 > ----
44 >
45 > <a name="TextEnclosed"></a>
46 >
47 > ### <a name="Text enclosed in angle brackets"></a><a name="Text enclosed in angle brackets "></a> Text enclosed in angle brackets like &lt;filename&gt; is not displayed. How can I show it as it is?
48 >
49 > TWiki interprets text as HTML. The '&lt;' and '&gt;' characters are used to define HTML commands. Any valid text within angle brackets gets interpreted by the browser as an HTML command. Invalid text is ignored, that's why it doesn't show up.
50 >
51 > There are two work arounds if you want to display angle brackets:
52 >
53 > - Do an escape sequence in HTML:
54 >   - Write `&lt;` instead of `<`
55 >   - Write `&gt;` instead of `>`
56 >   - Example: Write `(a &gt; 0)` instead of `(a > 0)`
57 > - Replace angle brackets with curly brackets.
58 >   - Example: Write `{is-writable}` instead of `<is-writable>`
59 >
60 > ----
61 >
62 > ### <a name="Some words (like _WinAPI) have a"></a> Some words (like [[WinAPI]]) have an unwanted question mark at the end. How can I prevent that?
63 >
64 > A question mark after a word is a link to a not yet existing topic. For example, [[WinAPI]] is a valid [[WikiName]], but the actual topic _WinAPI_ does not exist.
65 >
66 > If you do not intend to create a topic for a valid [[WikiWord]], you can prevent it being linked by putting an HTML tag in front of it. I usually use &lt;nop&gt;. This is a non existing HTML tag, so a browser just ignores it.
67 >
68 > - Example text: <br />`WinAPI as it is, <nop>WinAPI with preceding NOP.`
69 > - Example output: <br />[[WinAPI]] as it is, WinAPI with preceding NOP.
70 >
71 > ----
72 >
73 > ### <a name="How can I write fixed font text?"></a> How can I write fixed font text?
74 >
75 > Enclose text in "=" equal signs.
76 >
77 > - Example text: <br />`Proportional text, =fixed font text= , proportional again.`
78 > - Example output: <br /> Proportional text, `fixed font text` , proportional again.
79 >
80 > Alternatively you could also use preformatted text, see next question for details.
81 >
82 > ----
83 >
84 > ### <a name="Text I enter gets wrapped around"></a> Text I enter gets wrapped around. How can I keep the formatting as it is?
85 >
86 > TWiki interprets text as HTML. It is possible to use preformatted text to work around this. Use the preformatted HTML tags to keep the new line of text as it is. Do so by enclosing the text with &lt;PRE&gt; and &lt;/PRE&gt; tags, e.g.
87 >
88 >     This text will keep its format as it is:
89 >     <PRE>
90 >       Unit      Price Qty  Cost
91 >       -------  ------  ---  ------
92 >       aaa              12.00   3      36.00
93 >     </PRE>
94 >
95 > It is recommended to use preformatting for tables and source code.
96 >
97 > ----
98 >
99 > ### <a name="How do I create tables?"></a> How do I create tables?
100 >
101 > There are three possibilities:
102 >
103 > 1. Use Wiki rule with "|" vertical bars.
104 > 2. Use HTML tables with &lt;TABLE&gt;, &lt;TR&gt;, &lt;TD&gt; tags.
105 > 3. Use preformatted text with &lt;PRE&gt; tags.
106 >
107 > **\_1. Use Wiki rule with "|" vertical bars\_**
108 >
109 > - Example text: <br />`| cell A1 | cell B1 | cell C1 |`<br />`| cell A2 | cell B2 | cell C2 |`
110 > - Example output: <table border="1" cellpadding="0" cellspacing="0">
111 >   <tr>
112 >     <td> cell A1 </td>
113 >     <td> cell B1 </td>
114 >     <td> cell C1 </td>
115 >   </tr>
116 >   <tr>
117 >     <td> cell A2 </td>
118 >     <td> cell B2 </td>
119 >     <td> cell C2 </td>
120 >   </tr>
121 > </table>
122 >
123 > **\_2. Use HTML tables with &lt;TABLE&gt;, &lt;TR&gt;, &lt;TD&gt; tags\_**
124 >
125 > This is a manual process using HTML commands. Here is an example. If you enter this:
126 >
127 >     <TABLE BORDER=1>
128 >       <TR>
129 >        <TH> Head A  </TH> <TH> Head B  </TH>
130 >       </TR><TR>
131 >        <TD> Cell A2 </TD> <TD> Cell B2 </TD>
132 >       </TR><TR>
133 >        <TD> Cell A3 </TD> <TD> Cell B3 </TD>
134 >       </TR>
135 >     </TABLE>
136 >
137 > It is displayed as a table like this:
138 >
139 > <table border="1">
140 >   <tr>
141 >     <th> Head A </th>
142 >     <th> Head B </th>
143 >   </tr>
144 >   <tr>
145 >     <td> Cell A2 </td>
146 >     <td> Cell B2 </td>
147 >   </tr>
148 >   <tr>
149 >     <td> Cell A3 </td>
150 >     <td> Cell B3 </td>
151 >   </tr>
152 > </table>
153 >
154 > You can copy the example from &lt;TABLE&gt; to &lt;/TABLE&gt; and change it to your needs.
155 >
156 > More information about HTML tables can be found at <http://www.htmlhelp.com/reference/wilbur/table/table.html>
157 >
158 > **\_3. Use preformatted text with &lt;PRE&gt; tags\_**
159 >
160 > Text I enter gets wrapped around. How can I keep the formatting as it is? See [["Text enclosed..."|Main/WebHome#TextEnclosed]]
161 >
162 > ----
163 >
164 > ### <a name="Can I include images and picture"></a> Can I include images and pictures?
165 >
166 > Yes, this is possible. The easiest way of including images is to attach a GIF or JPG file to a topic and then to include it with text `%ATTACHURL%/myImage.gif` . [[FileAttachment]] has more.
167 >
168 > There are actually two ways of including inline images.
169 >
170 > **\_1. Using URL ending in .gif, .jpg, .jpeg\_**
171 >
172 > This is a simple and automatic way of including inline images. Simply write the URL of the image file, this will create the inline image for you. **Note:** The images must be accessible as a URL.
173 >
174 > - Example text: <br />` TWiki http://www.dementia.org/twiki//view/wikiHome.gif logo.`
175 > - Example output: <br /> TWiki ![wikiHome.gif](http://www.dementia.org/twiki//view/wikiHome.gif) logo.
176 >
177 > **\_2. Using &lt;IMG&gt; tag\_**
178 >
179 > This is a manual process where you have more control over the rendering of the image. Use the &lt;IMG&gt; tag of HTML to include JPEG and GIF files. **Note:** The display of the topic is faster if you include the WIDTH and HEIGHT parameters that have the actual image size. <http://www.htmlhelp.com/reference/wilbur/special/img.html> has more on inline images.
180 >
181 > - Example text: <br />`TWiki <IMG SRC="http://www.dementia.org/twiki//view/wikiHome.gif" WIDTH=46 HEIGHT=50> logo.`
182 > - Example output: <br /> TWiki <img src="http://www.dementia.org/twiki//view/wikiHome.gif" width="46" height="50" /> logo.
183 >
184 > ----
185 >
186 > ### <a name="Can I write colored text?"></a> Can I write colored text?
187 >
188 > Place text you would like to specify a color inside &lt;FONT COLOR="colorCode"&gt; and &lt;/FONT&gt; tags.
189 >
190 > "colorCode" is the hexadecimal RGB color code. The color is composed by specifying the red, green and blue components of the color in hexadecimal notation. For example, to specify white, the red, green and blue components are 255, 255, 255, so you would use "#FFFFFF". You can use [[StandardColors]] or common color codes:
191 >
192 > <table>
193 >   <tr bgcolor="#E0E0E0">
194 >     <td><font color="#000000"> <strong>Black:</strong> </font></td>
195 >     <td>"#000000" </td>
196 >     <td><font color="#008000"> <strong>Green:</strong> </font></td>
197 >     <td>"#008000" </td>
198 >     <td><font color="#C0C0C0"> <strong>Silver:</strong> </font></td>
199 >     <td>"#C0C0C0" </td>
200 >     <td><font color="#00FF00"> <strong>Lime:</strong> </font></td>
201 >     <td>"#00FF00" </td>
202 >   </tr>
203 >   <tr bgcolor="#C0C0C0">
204 >     <td><font color="#808080"> <strong>Gray:</strong> </font></td>
205 >     <td>"#808080" </td>
206 >     <td><font color="#808000"> <strong>Olive:</strong> </font></td>
207 >     <td>"#808000" </td>
208 >     <td><font color="#FFFFFF"> <strong>White:</strong> </font></td>
209 >     <td>"#FFFFFF" </td>
210 >     <td><font color="#FFFF00"> <strong>Yellow:</strong> </font></td>
211 >     <td>"#FFFF00" </td>
212 >   </tr>
213 >   <tr bgcolor="#E0E0E0">
214 >     <td><font color="#800000"> <strong>Maroon:</strong> </font></td>
215 >     <td>"#800000" </td>
216 >     <td><font color="#000080"> <strong>Navy:</strong> </font></td>
217 >     <td>"#000080" </td>
218 >     <td><font color="#FF0000"> <strong>Red:</strong> </font></td>
219 >     <td>"#FF0000" </td>
220 >     <td><font color="#0000FF"> <strong>Blue:</strong> </font></td>
221 >     <td>"#0000FF" </td>
222 >   </tr>
223 >   <tr bgcolor="#C0C0C0">
224 >     <td><font color="#800080"> <strong>Purple:</strong> </font></td>
225 >     <td>"#800080" </td>
226 >     <td><font color="#008080"> <strong>Teal:</strong> </font></td>
227 >     <td>"#008080" </td>
228 >     <td><font color="#FF00FF"> <strong>Fuchsia:</strong> </font></td>
229 >     <td>"#FF00FF"</td>
230 >     <td><font color="#00FFFF"> <strong>Aqua:</strong> </font></td>
231 >     <td>"#00FFFF" </td>
232 >   </tr>
233 > </table>
234 >
235 > - Example text: <br />` <FONT COLOR="#FF0000"> Red color </FONT> draws attention. `
236 > - Example output: <br /><font> Red color </font> draws attention.
237 >
238 > ----
239
240 -- [[PeterThoeny]] - 18 Aug 2000