Archive for the “latex” Category

For anyone struggling to work out the Latex codes for different maths symbols, this link is very useful: http://detexify.kirelabs.org/classify.html

 It lets you draw the symbol in the box and then offers you the most likely matches. Not seen it get it wrong yet. The only thing to watch for is which mode the recommended symbols are in, sometimes there’s a maths and text version, use the wrong one in a \begin{eqn*} section and it’ll be errors everywhere :). So far there’s been nothing it couldn’t work out for me, and it’s a hell of a lot easier than going through one of the huge Latex symbol charts on line.

As the Open University uses Latex to typeset their maths text books it would be nice if they could include a crib sheet of new symbols being introduced in each section (took me ages on MS221 to work out how to get the Unit Circle symbol)

Share

Comments No Comments »

I decided early on that typing my TMA answers up would be the best way for me to go. This was due to my awful handwriting, and also as a means to ensure that I proofread them properly (I have a horrible habit of not checking work). The actual use of LaTeX wasn’t a problem as I’ve played around with it a few times in the murky past for work. But trying to think of a decent layout for TMAs was a different matter as I’d always worked in predefined styles before. The following is what I came up with (Link to a PDF output version)

\documentclass[a4page]{article}

Just let latex know that we’re using A4 paper

\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{verbatim}
\usepackage{blindtext}
\usepackage{fancyhdr}
\usepackage{mathtools}

Here we load all the packages we need for use in this document. Most of these just enable all the maths features we’ll use, plus fancyhdr which lets us set the nice headers

\mathtoolsset{showonlyrefs}  %

This line ensures that LaTeX only prints equation numbers for equations that are specifically marked to be labelled/numbered

\pagestyle{fancy}
\fancyhead[LO,LE] {Joe Student}
\fancyhead[CO,CE] {B1234567}
\fancyhead[RO,RE] {MS123 - TMA01}

This sets our headers, these are what the OU recommend. Adjust to taste.

\numberwithin{equation}{section}

Set the numbering scheme for equations

\begin{document}

Let LaTeX know that from here on this is the actual content of the document

\setcounter{section}{1}
\setcounter{equation}{0}
\section* {Question 1}
\subsection*{a)}
\subsubsection*{i)}

Reset counters, and then put in the subsections. It is possible to skip sections if they’re not needed for a specific question. I you omit the * then Latex will number each section, which may not be what you want.

From here down it’s just normal LaTeX formatting.

\begin{align}
a=b+c \label{q1eq1}\\
c=a-b\\
\end{align}
\subsubsection*{ii)}
blah, blah, blah, refer to equation \eqref{q1eq1}\\
\subsection*{b)}
Answer question 1) b) here\\
equation labeling:\\
\begin{align}
a^2=b^2+c^2 \label{q1eq2}
\end{align}
Labels as \eqref{q1eq2}\\
\setcounter{section}{2}
\setcounter{equation}{0}
\section*{Question 2}
Equation numbering here:
\begin{align}
y^2=b^2+38 \label{q2eq1}\\
\end{align}
So the label is \eqref{q2eq1}\\
\end{document}

And here’s a link to the source tex file without any comments. (LaTeX source file with no comments)

Share

Comments 4 Comments »

Thankfully I’ve managed to crack through drafting the solutions to TMA01, so i’ve only got to type it up now.

All went pretty well, managed to do most of it just referring to the handbook. I’ve decided that getting to know the handbook inside out is probably a strong key to passing the Exam in October. So from now on I’m going to use that for most of my reference.

Did like that a number of questions have a ‘check’ built in to them, so you can tell if your solution is right. Helps build some confidence up, as I don’t think it’ll help in the exam to be constantly putting figures back into solution to check.

Got myself well and truley tied up in knots with Question 6, just could not see where I was going wrong. then a little light bulb went off in my head and it worked. And thanks to Wolfram Alpha for giving me a means of sanity checking the answer (and myself in the process).

And I’ve worked out how to do the transformation stuff in LaTeX as well:

r_{\theta}\colon \mathbb{R}^2 \rightarrow \mathbb{R}^2\\(x,y) \mapsto (x\cos\theta-y\sin\theta,y\sin\theta+x\cos\theta)

Though obviously, better aligned in a proper document :).

Share

Comments No Comments »

Second tutorial for MS221 last night. Covered a lot of ground (Chapters A3 and B1).

Going over the A3 stuff was very helpful, especially the isometry stuff. Was good to get some more examples of how to use the notation. Most of the trig stuff is settling back in slowly, this seemed to be a major topic in my A-Levels so some vague semblance of it is lurking at the back of my head. Just need to remember that most of the identities are on page 48 of the handbook.

While our reading wasn’t have meant to have got that far we then moved on to cover B1 (the only problem with the MS221 tutorials is that they aren’t quite enough of them, and the timings seem to be a little less than optimal). Not having read this chapter yet I was expecting a bit of a struggle. Thankfully it seems we’re still in A-Level territory. A bit of combinatorics came flooding back:

 {^n}C_r = \dfrac{n!}{(n-r)!r!}

The rest of the examples seemed to be basic calculus, so not too worried about those.

Typing this up I’ve noticed that the OU seem to want to use a different notation to the default combination one within LaTeX. LaTeX seem to use the binomial version:

 {n \choose r} = \dfrac{n!}{(n-r)!r!}

rather than the large C version. So to get around that I typeset the first equation as:

{^n}C_r = \dfrac{n!}{(n-r)!r!}

The panic now coming on is that I’d got the wrong submission date for TMA01, I though I had till the 23rd for some reason, and i’ve just noticed this morning that it’s actually for the 7th. Rats, with the Easter postal delays, I’m going to have to have it in the post for next Monday, so that’s 5 days to draft it and typeset it. And I’m going to work out the LaTeX stuff to do the transformations/translation notation nicely.

Oops.

Share

Comments No Comments »

A couple of days past my initial guess, but I decided I really should spend time with a pretty young lady rather than text books on Sunday :).

Really enjoyed the chapter vectors to finish section B off.  All came back nice and easily (always did enjoy Mechanics) The only tricky bit was getting used to using Headings (ie; N30°W) rather than the usual degrees/radians anticlockwise from x was a bit confusing.

Done the pencil work for most of TMA02 as well. So I’ll type it up at some point. Think I’ve finally worked out a Latex style that should fit the assignments. Need to go through all the MathCad stuff as well, though that shouldn’t take too long.

Share

Comments No Comments »

now if this works properly I’ve got Latex formatting in wordpress working:

e^{\i \pi} + 1 = 0

should have been generated from e^{\i \pi} + 1 = 0

Share

Comments No Comments »