Wikisophia:Sandbox
From Wikisophia
Sandbox for experimentation and ex tempore.
<math>\mathfrak qwerty</math>
[edit] Elvish
[edit] Dot
[edit] Plot
[edit] Interlocking Tori
[edit] Kuen's Surface
[edit] Julia Set
[edit] Klein Bottle
[edit] Trigonometric Surface
[edit] Fëanorian Tengwar
[edit] Music
[edit] Debugging the example from the wikitex page
There is something badly wrong with this example, taken from the wikitex page. I've started fixing it (see the first bar in the treble clef for example) but the problem seems to be major note collision badly handled.
- That's intentional, actually: we're dealing with five-part counterpoint, and the odd stem-placement gives the illusion of voice separation. Danenberg 10:45, 10 July 2007 (CDT)
[Listen]
[edit] Tenor part from third Agnus Dei of Josquin's Missa Ave Maris Stella.
[edit] An experiment in Eastern music
[edit] etc
Rudolph the Red-Nosed Reindeer
Second Minuet to the C minor French Suite (BWV 813a)
Let's try something a bit longer in the music department.
A short excerpt:
What about transposing?
Test
Alright, lemme see.
"With your feet in the air and your head on the ground..."
« j'ai du bon tabac » (french song in 3/4 should be in 2/4 but want to try partial mesure)
gr33tz from DocSnyder to GS and CL
Pop music?
Why do the chords mess-up?
[edit] Chess
FIXME: fails to produce long board
- & White resign... 0-1
- Excellent!! This is already useful to show games and openings! Promotions and uderpromotions works too, cool! But how to setup chess problem now? No FEN notations?! :( This are great news anyway! Thank you Maestro Danenberg!! --Igor 09:08, 19 Apr 2005 (CDT)
- Danenberg 18:44, 19 Apr 2005 (CDT)
[edit] newchess
FIXME: large board fails on font creation
[edit] Chemistry
[edit] Greek
- Ibycus' Fragm. 5, Page
- Alphabet
[edit] IPA
topo <ipa>["tO.po] </ipa>
sputo <ipa>["spu.to] </ipa>
cavolo <ipa>["ca.vo.lo] </ipa>
<ipa> [T, D, \textteshlig, \textdyoghlig, \*r, I, \ae, @, U] </ipa>
It's important to fix this odd behaviour regarding '[' and ']'.
- Agreed; we'll likely switch to a new renderer in the upcoming version,
dvipng, which lacks that tendency to crop the edges. I'd like to have a trial before solstice. Danenberg 08:17, 13 Dec 2004 (CST)dvipngshows a noticable improvement; though the left bracket, I believe, is softer than the right. Danenberg 23:09, 30 Jan 2005 (CST)
<ipa>@"bAUt </ipa>
[edit] feynman diagrams
[edit] Graph
WikiTeX failure:5, <Fault 1: "<class 'modtex.execution.ExecutionError'>:(70, 'Error: graphviz.dot:6: syntax error near line 6 context: graph >>> ER <<< ')">
[edit] Graph: Prostate Cancer
[edit] Math
Here is some inline text with small symbols like
and bigger symbols like
. Apparently, we can even mix symbolic math and text, as in
, the original name of Pyarie. The strange thing is that sometimes, the math causes linebreaks like those shown.
Because of the MediaWiki coupling with Texvc, we often have to use the <amsmath> tag, making
become
. Although that's not necessary here as <amsmath> works.
- I might even bring that up with MediaWiki, John;
a quick fix is to remove the space after the math tag[fixed; see below]. Danenberg 17:57, 28 Feb 2005 (CST)
Who can write the proof here?
Testing my formula:
testing...
.
WikiTeX failure:
5, <Fault 1: '<class 'modtex.execution.ExecutionError'>:(70, "This is pdfeTeXk, Version 3.141592-1.21a-2.2 (Web2C 7.5.4)
file:line:error style messages enabled.
entering extended mode
(./math.tex
LaTeX2e <2003/12/01>
Babel <v3.8d> and hyphenation patterns for american, french, german, ngerman, b
ahasa, basque, bulgarian, catalan, croatian, czech, danish, dutch, esperanto, e
stonian, finnish, greek, icelandic, irish, italian, latin, magyar, norsk, polis
h, portuges, romanian, russian, serbian, slovak, slovene, spanish, swedish, tur
kish, ukrainian, nohyphenation, loaded.
(/usr/local/teTeX/share/texmf-dist/tex/latex/base/article.cls
Document Class: article 2004/02/16 v1.4f Standard LaTeX document class
(/usr/local/teTeX/share/texmf-dist/tex/latex/base/size12.clo))
(/usr/local/teTeX/share/texmf-dist/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(/usr/local/teTeX/share/texmf-dist/tex/latex/amsmath/amstext.sty
(/usr/local/teTeX/share/texmf-dist/tex/latex/amsmath/amsgen.sty))
(/usr/local/teTeX/share/texmf-dist/tex/latex/amsmath/amsbsy.sty)
(/usr/local/teTeX/share/texmf-dist/tex/latex/amsmath/amsopn.sty))
(/usr/local/teTeX/share/texmf-dist/tex/latex/stmaryrd/stmaryrd.sty)
(/usr/local/teTeX/share/texmf-dist/tex/latex/amsfonts/amssymb.sty
(/usr/local/teTeX/share/texmf-dist/tex/latex/amsfonts/amsfonts.sty))
No file math.aux.
(/usr/local/teTeX/share/texmf-dist/tex/latex/stmaryrd/ustmry.fd)
(/usr/local/teTeX/share/texmf-dist/tex/latex/amsfonts/umsa.fd)
(/usr/local/teTeX/share/texmf-dist/tex/latex/amsfonts/umsb.fd)
./math.tex:8: Missing \\endgroup inserted.
<inserted text>
\\endgroup
l.8 \\begin{math}\\begin{eqnarray*}
x & = & y \\\\y & = & z\\end{eqnarray*}\\end{math}
No pages of output.
Transcript written on math.log.
")'>
WikiTeX failure: 5, <Fault 1: '<class 'modtex.execution.ExecutionError'>:(70, "This is pdfeTeXk, Version 3.141592-1.21a-2.2 (Web2C 7.5.4)
file:line:error style messages enabled.
entering extended mode
(./math.tex
LaTeX2e <2003/12/01>
Babel <v3.8d> and hyphenation patterns for american, french, german, ngerman, b
ahasa, basque, bulgarian, catalan, croatian, czech, danish, dutch, esperanto, e
stonian, finnish, greek, icelandic, irish, italian, latin, magyar, norsk, polis
h, portuges, romanian, russian, serbian, slovak, slovene, spanish, swedish, tur
kish, ukrainian, nohyphenation, loaded.
(/usr/local/teTeX/share/texmf-dist/tex/latex/base/article.cls
Document Class: article 2004/02/16 v1.4f Standard LaTeX document class
(/usr/local/teTeX/share/texmf-dist/tex/latex/base/size12.clo))
(/usr/local/teTeX/share/texmf-dist/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(/usr/local/teTeX/share/texmf-dist/tex/latex/amsmath/amstext.sty
(/usr/local/teTeX/share/texmf-dist/tex/latex/amsmath/amsgen.sty))
(/usr/local/teTeX/share/texmf-dist/tex/latex/amsmath/amsbsy.sty)
(/usr/local/teTeX/share/texmf-dist/tex/latex/amsmath/amsopn.sty))
(/usr/local/teTeX/share/texmf-dist/tex/latex/stmaryrd/stmaryrd.sty)
(/usr/local/teTeX/share/texmf-dist/tex/latex/amsfonts/amssymb.sty
(/usr/local/teTeX/share/texmf-dist/tex/latex/amsfonts/amsfonts.sty))
No file math.aux.
(/usr/local/teTeX/share/texmf-dist/tex/latex/stmaryrd/ustmry.fd)
(/usr/local/teTeX/share/texmf-dist/tex/latex/amsfonts/umsa.fd)
(/usr/local/teTeX/share/texmf-dist/tex/latex/amsfonts/umsb.fd)
./math.tex:9: LaTeX Error: Not in outer par mode.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.9 \\begin{table}[htdp]
No pages of output.
Transcript written on math.log.
")'>
[edit] Music
WikiTeX failure:5, <Fault 1: '<class 'modtex.execution.ExecutionError'>:(70, 'Processing `music.ly\'
Parsing...
music.ly:19:34: error: not a duration: 9
d8 b c4 d8 e f4 g4 d a g d
9 d9 d9
music.ly:19:37: error: not a duration: 9
d8 b c4 d8 e f4 g4 d a g d9 d
9 d9
music.ly:19:40: error: not a duration: 9
d8 b c4 d8 e f4 g4 d a g d9 d9 d
9
Interpreting music...
Interpreting music...
Preprocessing graphical objects...
MIDI output to `music.midi\'...
Finding the ideal number of pages...
Fitting music on 1 page...
Drawing systems...
Layout output to `music-1.eps\'...
Layout output to `music.eps\'...
Writing music-systems.texi...
Writing music-systems.tex...
error: failed files: "music.ly"
')'>
[edit] Music 1
[edit] Go
[edit] Music 1
[edit] Music 2
[Listen]
[edit] Music 3
A short round.
[edit] Tablature test
The MIDI link doesn't play anything, however... --Phil 06:19, 24 May 2005 (CDT)
[edit] Sandboxing
Messiaen's mode 21
[Listen]
Use \relative.
[Listen]
Messiaen's mode 22 is really cool
[Listen]
Messiaen's mode 23 is really cool... isn't it?
[Listen]
OK I'm just testing interaction between text and music. Edoardo
Ode to joy
[Listen]
ehehe --Helios89 13:47, 1 Jan 2006 (CST)
[edit] SVG
What's wrong with this SVG?
Why it is compiled with latex and not with convert (ImageMagick) ?
<svg> <g> <path i:knockout="On" fill="#FFFFFF" stroke="#FF0000" d=" M0.487,79.041C10.493,36.044,118.352,2.814,153.582,0.726 c74.74-4.432,130.319,57.104,98.817,128.802c-29.475,67.081-86.583,91.006-96.181,170.465 c-9.872,81.722-10.424,98.725,45.607,150.162c71.812,65.922,142.583,101.204,242.317,89.09 c92.768-11.259,255.825-186.75,125.809-250.673c-83.41-41.009-140.565,29.118-212.942,51.331"/> </g> </svg>
[edit] Klien Bottle
[edit] Macro
Is there any way to define a macro for use in a graph in wikitex?
WikiTeX failure:5, <Fault 1: "<class 'modtex.execution.ExecutionError'>:(70, 'Error: graphviz.dot:6: syntax error near line 6
context: >>> \\ <<< def\\MacroTest{a->e->f;}
')">
[edit] Plot
[edit] Plots with Data
Attempting to plot actual data values is futile. Surrender now before you wast brain sweat trying to figure out how. Here's why.
- Danenberg 17:42, 17 February 2006 (CST): Added data in 1.1beta1; upload a file and reference it so:
<plot data="upload.dat">plot "upload.dat" on 1:2;</plot>
[edit] Armor
[edit] Testing
Será que funciona acentuação? WikiTeX failure:5, <Fault 1: '<class 'modtex.execution.ExecutionError'>:(70, "This is pdfeTeXk, Version 3.141592-1.21a-2.2 (Web2C 7.5.4)
file:line:error style messages enabled.
entering extended mode
(./math.tex
LaTeX2e <2003/12/01>
Babel <v3.8d> and hyphenation patterns for american, french, german, ngerman, b
ahasa, basque, bulgarian, catalan, croatian, czech, danish, dutch, esperanto, e
stonian, finnish, greek, icelandic, irish, italian, latin, magyar, norsk, polis
h, portuges, romanian, russian, serbian, slovak, slovene, spanish, swedish, tur
kish, ukrainian, nohyphenation, loaded.
(/usr/local/teTeX/share/texmf-dist/tex/latex/base/article.cls
Document Class: article 2004/02/16 v1.4f Standard LaTeX document class
(/usr/local/teTeX/share/texmf-dist/tex/latex/base/size12.clo))
(/usr/local/teTeX/share/texmf-dist/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(/usr/local/teTeX/share/texmf-dist/tex/latex/amsmath/amstext.sty
(/usr/local/teTeX/share/texmf-dist/tex/latex/amsmath/amsgen.sty))
(/usr/local/teTeX/share/texmf-dist/tex/latex/amsmath/amsbsy.sty)
(/usr/local/teTeX/share/texmf-dist/tex/latex/amsmath/amsopn.sty))
(/usr/local/teTeX/share/texmf-dist/tex/latex/stmaryrd/stmaryrd.sty)
(/usr/local/teTeX/share/texmf-dist/tex/latex/amsfonts/amssymb.sty
(/usr/local/teTeX/share/texmf-dist/tex/latex/amsfonts/amsfonts.sty))
No file math.aux.
(/usr/local/teTeX/share/texmf-dist/tex/latex/stmaryrd/ustmry.fd)
(/usr/local/teTeX/share/texmf-dist/tex/latex/amsfonts/umsa.fd)
(/usr/local/teTeX/share/texmf-dist/tex/latex/amsfonts/umsb.fd)
./math.tex:9: Missing $ inserted.
<inserted text>
$
l.9
No pages of output.
Transcript written on math.log.
")'>
Image:Http://www.terra.com.br/istoe/istoe sp/esportes/fotos/consumo ciclismo 02.jpg Image:Example.jpg [Image:http://www.terra.com.br/istoe/istoe_sp/esportes/fotos/consumo_ciclismo_02.jpg]
Será que funciona acentuação?
Egg Sample:
Dsdhall 12:46, 27 June 2006 (CDT) Don't hotlink to other sites without permission - thanks
[edit] Test Bottle
[edit] Test Schema Diagram
WikiTeX failure:5, <Fault 1: "<class 'modtex.execution.ExecutionError'>:(70, 'Error: graphviz.dot:6: syntax error near line 6 context: >>> digraph <<< schemaExample ')">
[edit] Test Schema Diagram II
WikiTeX failure:5, <Fault 1: "<class 'modtex.execution.ExecutionError'>:(70, 'Error: graphviz.dot:6: syntax error near line 6 context: >>> digraph <<< schemaExample Warning: node node00, port p unrecognized Warning: node node00, port p unrecognized Warning: node node00, port p unrecognized Warning: node node00, port p unrecognized Warning: node node00, port p unrecognized Warning: node node15, port p unrecognized Warning: node node15, port p unrecognized Warning: node node15, port p unrecognized Warning: node node15, port p unrecognized Warning: node node15, port p unrecognized Warning: node node15, port p unrecognized Warning: node node24, port p unrecognized Warning: node node24, port p unrecognized Warning: node node25, port p unrecognized Warning: node node25, port p unrecognized Warning: node node26, port p unrecognized Warning: node node26, port p unrecognized ')">
[edit] latex test
[edit] More Feynman diagrams
WikiTeX failure:5, <Fault 1: "<class 'modtex.execution.ExecutionError'>:(70, 'This is pdfeTeXk, Version 3.141592-1.21a-2.2 (Web2C 7.5.4)
file:line:error style messages enabled.
entering extended mode
(./feyn.tex
LaTeX2e <2003/12/01>
Babel <v3.8d> and hyphenation patterns for american, french, german, ngerman, b
ahasa, basque, bulgarian, catalan, croatian, czech, danish, dutch, esperanto, e
stonian, finnish, greek, icelandic, irish, italian, latin, magyar, norsk, polis
h, portuges, romanian, russian, serbian, slovak, slovene, spanish, swedish, tur
kish, ukrainian, nohyphenation, loaded.
(/usr/local/teTeX/share/texmf-dist/tex/latex/base/article.cls
Document Class: article 2004/02/16 v1.4f Standard LaTeX document class
(/usr/local/teTeX/share/texmf-dist/tex/latex/base/size12.clo))
(/usr/local/teTeX/share/texmf-local/tex/feynmf/feynmp.sty
(/usr/local/teTeX/share/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/local/teTeX/share/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/local/teTeX/share/texmf-dist/tex/latex/graphics/graphics.cfg)
(/usr/local/teTeX/share/texmf-dist/tex/latex/graphics/dvips.def)))
No file feyn.aux.
feynmp: File feyn-mp.1 not found:
feynmp: Process feyn-mp.mp with MetaPost and then reprocess this file.
feynmp: File feyn-mp.2 not found:
feynmp: Process feyn-mp.mp with MetaPost and then reprocess this file.
feynmp: File feyn-mp.3 not found:
feynmp: Process feyn-mp.mp with MetaPost and then reprocess this file.
feynmp: File feyn-mp.4 not found:
feynmp: Process feyn-mp.mp with MetaPost and then reprocess this file.
feynmf: Label file feyn-mp.t4 not found:
feynmf: Process feyn-mp.mp with MetaPost and then reprocess this file.
feynmp: File feyn-mp.5 not found:
feynmp: Process feyn-mp.mp with MetaPost and then reprocess this file.
feynmf: Label file feyn-mp.t5 not found:
feynmf: Process feyn-mp.mp with MetaPost and then reprocess this file.
./feyn.tex:48: LaTeX Error: Bad math environment delimiter.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.48 \\]
No pages of output.
Transcript written on feyn.log.
')">
[edit] Equations with numbers
but now (\ref{eq:4}) and eq (\ref{eq:1}).
[edit] music test
[edit] repetition
[Listen]
[edit] tuplet
[Listen]
[edit] simple plot test
[edit] dummy song
WikiTeX failure:5, <Fault 1: '<class 'modtex.execution.ExecutionError'>:(70, 'Processing `music.ly\'
Parsing...
music.ly:14:0: error: syntax error, unexpected \'/\'
/relative c\'
music.ly:12:2: error: errors found, ignoring music expression
{
error: failed files: "music.ly"
')'>
[edit] Russian test
Well... no Russian letters in equations, too bad!
[edit] Edit
I have problem with editing pages. It doesn't show changes... Old MediaWiki version problem? --Igor 19:05, 7 July 2007 (CDT)
[edit] Music Text(i can't invoke wikitex in wikiversity articles)
[edit] Music Test 2
WikiTeX failure:5, <Fault 1: '<class 'modtex.execution.ExecutionError'>:(70, 'Processing `music.ly\'
Parsing...
music.ly:16:63: error: syntax error, unexpected \',\'
\t\tgis(b e)e,(gis b)b,(e gis)gis,(b e)e,(gis? b a1
,)
music.ly:12:2: error: errors found, ignoring music expression
{
error: failed files: "music.ly"
')'>
[edit] test
[edit] Test Music
WikiTeX failure:5, <Fault 1: '<class 'modtex.execution.ExecutionError'>:(70, 'Processing `music.ly\'
Parsing...
music.ly:15:18: error: syntax error, unexpected STRING
\t\tc4
deccdecefg2\t}
music.ly:12:2: error: errors found, ignoring music expression
{
error: failed files: "music.ly"
')'>
[edit] A Guitar Test Song
Guitar test song
WikiTeX failure:5, <Fault 1: '<class 'modtex.execution.ExecutionError'>:(70, 'Processing `music.ly\'
Parsing...
music.ly:17:23: error: GUILE signaled an error for the expression beginning here
\\override TextSpanner #
\xe2\x80\x99edge-text = #\xe2\x80\x99("XII " . "")
music.ly:17:23: error: GUILE signaled an error for the expression beginning here
\\override TextSpanner #
\xe2\x80\x99edge-text = #\xe2\x80\x99("XII " . "")
music.ly:17:23: error: syntax error, unexpected STRING
\\override TextSpanner #
\xe2\x80\x99edge-text = #\xe2\x80\x99("XII " . "")
music.ly:12:2: error: errors found, ignoring music expression
{
error: failed files: "music.ly"
Unbound variable: \xe2\x80\x99edge-text
Unbound variable: \xe2\x80\x99
')'>
Bach Air on G String
%% Introduction to latex facilities.
%% Sat 31 Dec 2005
%% Stephen Eglen.
%% Text following a percent sign (%) until the end of line is treated %% as a comment.
\documentclass{article}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% This section is called the preamble, where we can specify which %% latex packages we required. Most (but not of all) of the packages %% below should be fairly standard in most latex documents. The %% exception is xspace and the new \latex command, which you probably %% do not need. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Better math support: \usepackage{amsmath}
%% Bibliography style: \usepackage{mathptmx} % Use the Times font. \usepackage{graphicx} % Needed for including graphics. \usepackage{url} % Facility for activating URLs.
%% Set the paper size to be A4, with a 2cm margin %% all around the page. \usepackage[a4paper,margin=2cm]{geometry}
%% Natbib is a popular style for formatting references. \usepackage{natbib} %% bibpunct sets the punctuation used for formatting citations. \bibpunct{(}{)}{;}{a}{,}{,}
%% textcomp provides extra control sequences for accessing text symbols: \usepackage{textcomp} \newcommand*{\micro}{\textmu} %% Here, we define the \micro command to print a text "mu". %% "\newcommand" returns an error if "\micro" is already defined.
%% This is an example of a new macro that I've created to save me %% having to type \LaTeX each time. The xspace command provides space %% after the word LaTeX where appropriate. \usepackage{xspace} \providecommand*{\latex}{\LaTeX\xspace} %% "\providecommand" does nothing if "\latex" is already defined.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Start of the document.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\author{Stephen J. Eglen\\
Department of Applied Mathematics and Theoretical Physics\\ University of Cambridge\\ Wilberforce Road\\ Cambridge CB3 0WA U.K.}
\date{\today} \title{A short example of how to use \latex for scientific reports} \maketitle
\begin{abstract}
The purpose of this short document is to provide a brief overview of the facilities that \latex offers for formatting scientific reports. Furthermore, the source files for regenerating this report are freely available so that users can easily start writing their own reports using \latex.
\end{abstract}
\section{Introduction}
\latex is a typesetting program; given an input file with formatting instructions (e.g intro.tex), the program will create your document in one of several formats (DVI, Postscript or PDF). It is therefore not a WYSIWYG word processor. \latex is known as a logical markup language, similar for example to HTML, so that you describe a piece of text as a ``section heading rather than saying that it should be formatted in a certain way. It has excellent facilities for typesetting mathematics, and handles large documents (such as theses) well. The aim of this document is not to provide an overview of \latex, since many other guides have already been written (see Section~\ref{sec:summary}). Instead, it has been written primarily to provide simple workable examples that you can cut and paste to help you get started with \latex. The examples have been selected to be those most likely to be useful when writing a scientific report. This document is best read by comparing the source code with the resulting output.
\section{Running \latex}
The files to accompany this paper are at: \url{http://www.damtp.cam.ac.uk/user/eglen/texintro}. Get the following files and put them into a new directory.
\begin{enumerate} \item \url{intro.tex}: the main \latex document. \item \url{example.bib}: a short bibliography. \item \url{sigmoid.ps}: example postscript image. \item \url{sigmoid.pdf}: example PDF image. \end{enumerate}
Change directory to where you stored the files and type the following (ignoring comments placed after \#\#):
\begin{verbatim} latex intro ## Run latex 1st time. bibtex intro ## Extract required references latex intro ## Run latex 2nd to resolve references. latex intro ## Probably need to run latex a 3rd time. xdvi intro ## View the DVI (device independent) file. dvips -o intro.ps intro ## Create a postscript file for printing. \end{verbatim}
You will notice that you run latex several times here; this is so that references can be resolved, and references can be extracted from your bibtex file. After running latex, you will be told if you need to run it again to resolve references. After a while, you will get the idea of how many times you need to run latex to resolve all your references.
If instead you would like to generate PDF files (see Section~\ref{sec:graphics} for a discussion of file formats for included images), you can try the following shorter sequence:
\begin{verbatim} pdflatex intro bibtex intro pdflatex intro pdflatex intro xpdf intro.pdf ## View the resulting PDF \end{verbatim}
Whether you prefer to generate DVI or PDF is up to you. The xdvi viewer has some nice features, such as it can reload your document easily and has a ``magnifying glass that is activated by the mouse. On the other hand, xpdf will display the document more accurately as it will be printed.
\section{Tables}
Tables are relatively straightforward to generate. Note that tables and figures are not always placed exactly where you wish, as they can \textit{float} to other parts of the document. Rather than trying to battle with \latex as to where they are placed, concentrate first on getting the right content and let \latex worry about the positioning. Instead, use labels to your tables to refer to them. See Table~\ref{tab:simple} and Table~\ref{tab:pars} for examples.
\begin{table}
\centering
\begin{tabular}{ccc}
year & min temp (\textdegree C) & max temp (\textdegree C)\\
\hline
1970 & $-5$ & 35\\
1975 & $-7$ & 29\\
1980 & $-3$ & 30\\
1985 & $-2$ & 32\\
\end{tabular}
\caption{Fictional minimal and maximal temperatures recorded in
Cambridge over several years.}
\label{tab:simple}
\end{table} %% Why are the negative numbers above enclosed in math mode? %% Hint: consider the difference between "-" in text and in math.
\begin{table}[htbp]
\centering
\begin{tabular}{lccc}\\ \hline
& \multicolumn{1}{c}{$\phi$ (\micro m)}
& \multicolumn{1}{c}{$\alpha$}
& $\delta_{12}$ (\micro m)\\ \hline
W81S1\\
$h_{11}(u)$ & 67.94 & 7.81\\
$h_{22}(u)$ & 66.27 & 5.40\\
$h_{12}(u)$ & & &18\\
\hline
M623\\
$h_{11}(u)$ &112.79 & 3.05\\
$h_{22}(u)$ & 65.46 & 8.11\\
$h_{12}(u)$ & & &20\\
\hline
\end{tabular}
\caption{Summary of parameter estimates for the univariate
functions $h_{11}(u)$, $h_{22}(u)$ and the bivariate function
$h_{12}(u)$. For the univariate fits, $\alpha$ and $\phi$ are
least-square estimates (assuming $\delta$ was fixed at 15 \micro m).
The final column gives the
maximum likelihood estimate of $\delta_{12}$ assuming that the
interaction between types is simple inhibition.
\label{tab:pars}}
\end{table}
\section{Bibliography management}
Scientific reports normally require a section where your references are listed. Bibtex is an excellent system for maintaining references, especially for large documents. Each reference needs a unique key; you can then refer to the reference in your \latex document by using this key within a cite command.
Take care when formatting your references, especially when it comes to writing authors names and the case of letters in journal titles. In our examples, the files are found in \url{example.bib}. As an example of a citation, see \citep{ihaka1996} or \citep{ihaka1996,venables1999}.
Bibtex is flexible enough to format your references in a wide number of different styles to suit your needs. In this file I have used the ``natbib package, which is suitable for the natural sciences. Depending on the type of cite command you get (and the package that you use for citations), you can get different styles of citation. See Table~\ref{tab:cite} for some examples.
\begin{table}
\centering
\begin{tabular}{ll}
\hline
command & result\\ \hline
\verb+\citep{ihaka1996}+ & \citep{ihaka1996}\\
\verb+\citet{ihaka1996}+ & \citet{ihaka1996}\\
\verb+\citep[see][p. 300]{ihaka1996}+ &
\citep[see][p. 300]{ihaka1996}
\\
\verb+\citeauthor{ihaka1996}+ & \citeauthor{ihaka1996}
\\
\verb+\citeyear{ihaka1996}+ & \citeyear{ihaka1996}
\\
\hline
\end{tabular}
\caption{Examples of different citation commands available in the
natbib package.}
\label{tab:cite}
\end{table}
\section{Graphics}
\label{sec:graphics}
\latex can include images in one of several format, depending on whether you use latex (postscript format required) or pdflatex (either jpeg, png or pdf required). Figures can be included either at their natural size, or you can specify e.g. the figure width. Figure~\ref{fig:example} shows an example image which intentionally looks slightly different depending on whether you compile the document with latex or pdflatex. Note that in this example the suffix of the image file is not included so that this document compiles under both latex and pdflatex.
\begin{figure}
\centering
\includegraphics[width=6cm]{sigmoid}
\caption{Example of a sigmoidal curve generated by the R programming
environment. The title above the curve indicates whether you have
included the postscript or the pdf version of the figure.}
\label{fig:example}
\end{figure}
\section{Mathematics}
\latex can format mathematics with ease, either in line, such as $x \times y$, or on separate lines, such as: \[ x^2 +y^2 = z^2 \]
If you are writing several lines of equations, you can use statements like the following:
\begin{align}
b(t) & = s(t) - \int_{0}^{T} a(t') \cdot i(T-t') dt'
\\
a(t) & = \int_{0}^{T} b(t) \cdot e(T-t') dt' \label{eq:am}
\\
g(t) & = b(t) \ast e(t) \nonumber
\end{align}
By using labels on certain equations, we can refer to equations by number, such as equation~(\ref{eq:am}).
\section{Summary} \label{sec:summary} This short guide should give you a flavour of what can be done with \latex. It is by no means complete, or supposed to be self-explanatory. It is, however, hopefully enough to get you started! Try experimenting by editing the source file and then recompiling this document. As mentioned earlier, there are many guides for latex. Two that I can recommend are \url{http://www.andy-roberts.net/misc/latex/index.html} and `` The (Not So) Short Introduction to LaTeX2e (\url{http://ctan.tug.org/tex-archive/info/lshort/english/lshort.pdf}).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Finally we specify the format required for our references and the
%% name of the bibtex file where our references should be taken from.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\bibliographystyle{plainnat} \bibliography{example}
\end{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% The end. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[edit] Yankee Doodle
[Listen]











































































