Creating a New Article
use
that does this it has a little lightning strike in it! Once you have pressed the button a new document should appear on screen.
File->New from Template...
and choose to create an article.I am going to give a quick description of bibtex here, but there is already a good guide on bibtex available on the university pages here. Using bibtex is fast and easy way to keep track of referencing within a document. It uses a plain text file containing a database of all your references, each of which must be given a unique keyword. A bibtex database entry looks something like this:
@article{myFirstBibItem, title={The Paper Title}, author={Joe Black and Mary White}, journal={The Journal of Something}, pages={1--2}, year={2000} }
The syntax is quite straight forward, the @keyword is used to indicate the type of entry, be it an article, a book or an entry in a conference proceedings. Next you give the entry a unique keyword so that you can cite the entry in the text. Then follows a list of items found in your reference, each separated by a comma. If you are having problems check that all items in the list have a comma following them as this is quite easy to forget. In fact you don't even need to know this as most websites (such as google scholar) give the option to export a citation in this format (see later on).
Now we shall start assuming you have a working tex document. Go to the menu and open a new file. Now go to the menu and select the save as option, making sure the directory is the same as where you have saved your tex document, then enter the name myBib.bib for the filename and BibTeX for the file type. Click save.
Now we can cite the reference in our text. Add the following line in your text
My first citation is \cite{black1973pricing}.where the keyword is the same as the one in your bib file entry. Finally add the lines
\bibliographystyle{plain} \bibliography{myBib}at the end of your document. Run pdfLatex, bibtex (the button with a B on it in winedt) and then pdfLatex again two or three times. It should look something like this:
One package included in latex that can make your referencing very nice is the natbib package. To use this package instead of the standard one include the line
\usepackage{natbib}.at the top of your document and change your style to
\bibliographystyle{dcu}and recompile your document.
Gnuplot is simple to install and use on Ubuntu systems as the latest version is included in the Ubuntu repositories. One part that is not included by default is auto complete at the gnuplot command line. In order to install gnuplot and enable auto complete, simply open a terminal, and type the following command
sudo apt-get install gnuplot rlwrap
UPDATE On Ubuntu 12.04 and later you need to specify what version of gnuplot to install (qt or x11), so change the command above to
sudo apt-get install gnuplot-qt rlwrap
Then open your bash configuration file (if using the default bash shell)
gedit ~/.bashrc &
and add the following lines to the file somewhere near the bottom
# enable autocomplete in gnuplot
alias gnuplot="rlwrap -a -c -b\"\\\"\\\"\\\'\\\'\" gnuplot"
save the file and exit.
First we need some data for plotting, for instance the file
http://www.maths.manchester.ac.uk/~pjohnson/Gnuplot/testResults.dat
may be downloaded from my website.
Now open a new terminal and type gnuplot
into the command line. You should see the following:
Now enter the following:
p 'te
and press the tab key. The filename should auto complete. If it does not appear press the tab key again as there might be multiple files beginning `te', and you might need to enter more letters to allow it to complete. If it is still not working, enter !ls
and check that the file is present in your current working directory. Complete the gnuplot command to plot the file with lines and press return
p 'testResults.dat' w l
If it all works you should see:
Gnuplot is a powerful command line driven plotting program that is available for Windows, Mac and linux (and others). It is freely available to install and use. The application has two main features: it allows us to interactively plot mathematical functions and data at the command line; and also to create scripts that can analyse data or just create hundreds of figure plots simultaneously.
The big advantage for scientists is the ability to quickly review results from numerical calculations. Rather than waiting minutes to load up a spreadsheet program and create a plot results can be viewed almost instantly.
Please see other posts [1] for how to install and use on different operating systems. In this tutorial we shall use a terminal on the linux based Ubuntu DE to demonstrate the commands. The commands themselves are the same regardless of which operating system we work on. For a full list of commands and a more indepth look at the program you can find the official docs here
Open a new terminal and type gnuplot
into the command line. You should see the following:
Now enter the following command, press return
plot sin(x) with lines
and you should see
Inputting other functions is relatively simple, the syntax is similar to that found on other popular mathematical programs such as matlab. You can also store parameters, create functions and change them interactively, for instance enter the following code
a = 1.4
b = 0.13
f(x) = a * exp(-b*x*x)
plot f(x) with lines
which appears on screen as
Now we can add labels, change the distance between tics, the range/domain, and add rename the key with the following
set xlabel "x"
set ylabel "y"
set xtics 4
set ytics 0.25
set xrange [-8:8]
set yrange [0:1.5]
plot f(x) title "My Function" with lines
Try experimenting with different functions and changing the properties of the plot. Next try plotting 2D and 3D data from files in the post " Plotting 2D and 3D data with Gnuplot ".