Key
: Actual working code
: Text content
I have been writing up a report using Texmaker in Ubuntu 11.10.
I was shown how to compile .tex and .aux from the command line which seems the most efficient method for me personally.
Firstly you need the compilers.
xeletex - for .tex file compilation
bibtex - for .aux file compilation
I know many will consider it lazy but I installed them using the synaptic package manager to get texlive-xetex (shown below in synaptic) which should get all the packages you need including texlive-base.

note: I may be wrong about that however as I am fairly new to this so you may need to tweak this a little.
Then I structured the basics of my document:
\documentclass[10pt,a4paper]{report}
\usepackage[utf8x]{inputenc}
\usepackage{ucs}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\author{Oliver Vaughan}
\title{Information Retrieval and Data Mining}
\begin{document}
\section{Introduction}
This field encompasses categorising and retrieving information. This involves firstly being given a
<lots of very very interesting text entered here>
\newpage
\section{Precision and Recall}
Precision is the ratio of relevant documents retrieved to the total number of documents retrieve.........................................
Firstly I wanted to include a simple equation so under the section above I entered
\begin{displaymath}
Precision = \frac{Relevant Retrieved }{Retrieved}
\end{displaymath}
\begin{displaymath}
Recall = \frac{Relevant Retrieved }{Relevant}
\end{displaymath}
This provides the following upon compilation of the document
note: when I used the \begin{equation} tag the equations were numbered so I changed to \begin{displaymath}
I then wished to enter a simple graph (created in InkScape).
In order to do this I saved the graph as a .eps ( Encapsulated_PostScript ) file in the same folder as my latex and bibtex files.
In the pre-amble of the latex document I set:
\usepackage{graphicx}
Then in the section where I wanted the graph you simply enter: \includegraphics{precision-recall-curve.eps}
Where precision-recall-curve.eps = the name of your file.
When applied in the following manner:
the documents required.
Graphing this response is referred to as a precision/response curve. A typical curve is displayed here in figure 1.1
\includegraphics{precision-recall-curve.eps}
\label{precision-recall-curve}
Usually the higher the recall required the lower the precision due to the increased possibility of non relevant documents being included in the data.
It will yield the following result:
I also wished to add a bibliography to my document. The method I was shown involves using a separate .bib file (in this case with the same name as the project but you could just have a large file with loads of references in it).
Mine looks like this:
@Book{grossman04,
ALTauthor = {David A. Grossman and Ophir Freider},
ALTeditor = {•},
title = {Information Retrieval},
publisher = {Springer},
year = {2004},
OPTkey = {•},
OPTvolume = {•},
OPTnumber = {•},
OPTseries = {•},
OPTaddress = {•},
OPTedition = {•},
OPTmonth = {•},
OPTnote = {•},
OPTannote = {•}
}
note: It is a convention that you use the authors name and then the last two digits of the year for the reference.
Add the reference in the text:
using either:
\cite{name of reference} this inserts straight into the text
or
~\cite{name of reference} this inserts a space before the reference
e.g:
\newpage
\section{Precision-recall-curve graph}
To quote the example given in Information Retrieval~\cite{grossman04} if a system is queried and it returns ten documents form that query recall can be calculated at several points in the query.
and then including it at the end of the document as shown below.
\bibliography{Introduction_to_Data_Mining_and_IR}
\bibliographystyle{apalike}
\end{document}
This is the style the reference will be inserted using : \bibliographystyle{choose a style here}
You can find loads of styles here: http://www.cs.stir.ac.uk/~kjt/software/latex/showbst.html
You then have to run the command line compiler on the .tex file
cd to the folder containing the .tex and .bib files (I create a separate folder for each project)
I ran the following:
$ xelatex Introduction_to_Data_Mining_and_IR.tex
Which gave the following result:
Then I ran:
$ bibtex Introduction_to_Data_Mining_and_IR.aux
With the following result:
Once the .aux files are complied you need to run the xelatex complier again twice using:
$ xelatex Introduction_to_Data_Mining_and_IR.tex
The first complies the file and finds the references but may not add them correctly the second time round it will definitely add them, it is not always necessary but I do it every time anyway.
You should then up with a pdf of the same name as your project in your source folder.
I hope this may be useful, any better ways of doing it gladly received.




No comments:
Post a Comment