If you have a new account but are having problems posting or verifying your account, please email us on [email protected] for help. Thanks :)
Hello All, This is just a friendly reminder to read the Forum Charter where you wish to post before posting in it. :)
Hi all, The AutoSave Draft feature is now disabled across the site. The decision to disable the feature was made via a poll last year. The delay in putting it in place was due to a bug/update issue. This should serve as a reminder to manually save your drafts if you wish to keep them. Thanks, The Boards Team.
Hello all! This is just a quick reminder to ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere.

# LaTeX Thread (Useful links and tips within)

• 12-09-2009 9:14am
Moderators, Education Moderators, Motoring & Transport Moderators Posts: 7,395 Mod ✭✭✭✭

I think it would be useful to have a guide to LaTeX and how to use it stickied on the Maths forum would be useful. Does such a guide exist?

Mod Note:

Just noticed there is now a LaTeX forum which can be found here

• Closed Accounts Posts: 6,151 ✭✭✭

There's a latex tutorial here: http://www.mts.jhu.edu/~ers/learn-latex/

• Registered Users Posts: 869 ✭✭✭

• Closed Accounts Posts: 760 ✭✭✭

Dr. Wilkins from my Alma Mater, Trinity College, has a rather nice LaTeX tutorial that helped me with my FYP report.

http://www.maths.tcd.ie/~dwilkins/LaTeXPrimer/

• Posts: 4,630 ✭✭✭

Here's a handy website that lists pretty much every symbol you can use, and their associated command.

• Registered Users Posts: 170 ✭✭

And here's a few thousand more...

• Registered Users Posts: 992 ✭✭✭

Guys and lassies, I'm wondering can anyone help me a little with a LaTeX problem? I'm completely new to it (started last week) and am currently using tikzpicture to draw simple diagrams. It seems to work fine as the sole piece in a document but when I include the same text in another document (simply by copying it over rather than 'include' in the LaTeX sense) it doesn't produce a picture. I've a feeling i'm not including the right packages in the preamble (i've included tikz and pgf).

Also, is there an easier way to produce simple mathematical diagrams other than tikzpicture. Bear in mind I'm a novice, thanks for any help.

Oh, I'm using XP.

• Registered Users Posts: 170 ✭✭

Just include tikz, and put all the tikz commands inside

\begin{tikzpicture}

\end{tikzpicture}

?

Works for me...

I don't know if there's an easier way to do pictures, possibly there is, but I like tikz even if it seems terrifyingly powerful compared to everything I've ever wanted to draw.

• Registered Users Posts: 2,481 ✭✭✭

I never messed around with any built-in drawing software. To be honest, the path of least resistance is
Mathematica (or wolfram alpha) -> screenshot -> jpeg -> import jpeg

though I've forgotten the command to do the last bit :pac:

If it's just a project or thesis, I'd go with this way. Might be worth learning the built-in stuff if you're doing something that's publication quality though.

• Registered Users Posts: 992 ✭✭✭

Is \usepackage{tikz} the right way to include it?

• Registered Users Posts: 2,481 ✭✭✭

Well, my preamble looks like this
\documentclass[12pt,a4paper]{report}

\usepackage{graphicx,epsfig}

\usepackage{amsfonts}

\usepackage{amsthm, amsmath}

and the figure looks like this:
\begin{figure}[h]
\centering
\includegraphics[scale = .55]{MertonVega.pdf}
\caption{caption here}
\label{fig:MertonVega}
\end{figure}

For some reason I converted the images to PDF... maybe you have to do that. I forget how or why though. Not sure how much of this is strictly necessary either. I'd just get it working with some random PDF then play with it until it breaks.

• Registered Users Posts: 13,104 ✭✭✭✭

gerry87 wrote: »
For some reason I converted the images to PDF... maybe you have to do that. I forget how or why though.
You were probably compiling with PDFLatex? When compiling with Latex, graphics have to be in EPS format. If you're compiling with PDFLatex, then JPG, PNG or PDF can be used.

• Registered Users Posts: 2,481 ✭✭✭

yup, I used gedit in unbuntu and compiled with PDFLatex, that would explain it.

• Registered Users Posts: 170 ✭✭

fh041205 wrote: »
Is \usepackage{tikz} the right way to include it?

Yeah... as in I have a document like

\documentclass[12pt]{article}

\usepackage{tikz}
\begin{document}

\section{Section}

Some font, some font, some font.

\subsection{Now a TikZ diagram}

We can draw a picture of a lightcone!

\begin{center}
\begin{tikzpicture}
\begin{scope}[scale=1.3]
\shade[inner color=yellow, outer color=yellow!50!white!50] (-3,-3) -- (0,0) -- (-3,3) -- (3,3) -- (0,0) -- (3,-3) -- (-3,-3);
\draw[->] (-3.1,0) -- (3.1,0);
\draw[->] (0,-3.1) -- (0,3.1);
\draw[color=black,->] (-3,-3)--(3,3);
\draw[color=black,->] (3,-3)--(-3,3);
\draw (0.,3.3) node {$ct$};
\draw (3.3,0) node{$x$};
\draw[->] (0,0) -- (0.8,2);
\draw[->] (0,0) -- (2,1);
\draw (0.8,2.2) node{\scriptsize $v<c$};
\draw (2.1,1.2) node{\scriptsize $v>c$};
\draw (3.1,3.1) node{\scriptsize$v=c$};
\draw (0.6,-1.5) node{Past};
\draw (-0.8,1.8) node{Future};
\end{scope}

\end{tikzpicture}
\end{center}

\end{document}

and it works fine (though I'm using linux not XP, but I've definitely used Tikz on Windows too...)

I'm not sure I understand though, is the problem that tikz only works when there is no other text other than between the \begin{ and \end{tikzpicture} commands? Are you using any other packages in the other documents that might interfere with it? (I seem to remember there being an issue involving using the color package and tikz).

• Registered Users Posts: 869 ✭✭✭

djpbarry wrote: »
You were probably compiling with PDFLatex? When compiling with Latex, graphics have to be in EPS format. If you're compiling with PDFLatex, then JPG, PNG or PDF can be used.

I didn't say that

• Registered Users Posts: 12,821 ✭✭✭✭

One suggestion I might add is to use the \displaystyle method when posting here. It makes the formula a little larger and more legible.

Before:
$\frac{d}{dx} \int_0^x{f(t)dt}=\int{\left(\frac{d}{dx}f(x)\right)dx}=f(x)$

After:
$\displaystyle \frac{d}{dx} \int_0^x{f(t)dt}=\int{\left(\frac{d}{dx}f(x)\right)dx}=f(x)$
\displaystyle
\frac{d}{dx} \int_0^x{f(t)dt}=\int{\left(\frac{d}{dx}f(x)\right)dx}=f(x)


We are afraid to put men to live and trade each on his own private stock of reason; because we suspect that this stock in each man is small.

-- Edmund Burke

• Registered Users Posts: 12,821 ✭✭✭✭

Something weird I've noticed when editing a post containing LaTeX: sometimes, plus (+) signs go missing after you save the edit. The workaround seems to be: select "Go Advanced" when editing, that seems to avoid the issue.

testing: $r^2=x^2+y^2$

We are afraid to put men to live and trade each on his own private stock of reason; because we suspect that this stock in each man is small.

-- Edmund Burke

• Registered Users Posts: 119 ✭✭

Just saw this thread, I found LaTeX so useful doing my final year project. Here are some notes and a sample .tex file I made for learning LaTeX when I was giving a tutorial in TCD.

Hope they are some help to some one! I got really enthusiastic learning tricks in LaTeX during the year

• Registered Users Posts: 2,338 ✭✭✭