Warning: Illegal string offset 'html' in /home/hsn/public_html/forum/cache/skin_cache/cacheid_1/skin_topic.php on line 909

Warning: Cannot modify header information - headers already sent by (output started at /home/hsn/public_html/forum/cache/skin_cache/cacheid_1/skin_topic.php:909) in /home/hsn/public_html/forum/admin/sources/classes/output/formats/html/htmlOutput.php on line 114

Warning: Cannot modify header information - headers already sent by (output started at /home/hsn/public_html/forum/cache/skin_cache/cacheid_1/skin_topic.php:909) in /home/hsn/public_html/forum/admin/sources/classes/output/formats/html/htmlOutput.php on line 127

Warning: Cannot modify header information - headers already sent by (output started at /home/hsn/public_html/forum/cache/skin_cache/cacheid_1/skin_topic.php:909) in /home/hsn/public_html/forum/admin/sources/classes/output/formats/html/htmlOutput.php on line 136

Warning: Cannot modify header information - headers already sent by (output started at /home/hsn/public_html/forum/cache/skin_cache/cacheid_1/skin_topic.php:909) in /home/hsn/public_html/forum/admin/sources/classes/output/formats/html/htmlOutput.php on line 137

Warning: Cannot modify header information - headers already sent by (output started at /home/hsn/public_html/forum/cache/skin_cache/cacheid_1/skin_topic.php:909) in /home/hsn/public_html/forum/admin/sources/classes/output/formats/html/htmlOutput.php on line 141
Writing maths in your posts with LaTeX - HSN forum

Jump to content


Writing maths in your posts with LaTeX


3 replies to this topic

#1 Nathan

    Fully Fledged Genius

  • Members
  • PipPipPipPipPipPipPip
  • 1,736 posts
  • Location:Aberdeen, Scotland
  • Gender:Male

Posted 22 March 2007 - 04:39 AM

Looking through the Maths forum last night (yes, see, I do do other things on here rather than just spam up the "What's on your mind" thread wink.gif), I noticed that there's loads of posts that are misleading as they've not been explained properly (see my first example below).

Hopefully people actually read this and take heed, just so that I haven't wasted 30 mins of my valuable time. tongue.gif

PS. Point out anything that I've missed out/got wrong. Thanks, Nathan smile.gif
----------------------------------------------------------

LaTeX is a special type of coding which can help you and others when posting for help on the HSN Maths forums. Basically, it stops confusion when it comes to things like:

x2/5x+3

I mean, is this

\frac{x^2}{5x+3}, \frac{2x}{5x+3}, or something entirely different?

It's really simple to use once you get the hang of it, and for the basics, you only need to remember a few simple words that'll get you writing equations in no time at all.

Writing in LaTeX

To write in LaTeX in this forum, you need to put the LaTeX in [tex ] and [/tex ] tags. For example,

CODE
[tex]x^2[/tex]

becomes x^2

Plus/Minus

To use the \pm\\, use

CODE
[tex]\pm[/tex]


Multiplying and Dividing

For 2 \times 2= 4, you would use

CODE
[tex]2 \times 2= 4[/tex]


For 4 \div 2 = 2, you would use

CODE
[tex]4 \div 2 = 2[/tex]


Fractions

Example: \frac{x}{2} would be
CODE
[tex]\frac{x}{2}[/tex]


Note the backslash (\) and use of curly brackets ({&}). If you miss out the \ or use the wrong type of brackets, then the code won't work!

Multiple lines of working

You can put more than 1 line of working in [tex ] tags. All you need to do is put a double backslash (\\) at the start of each new line.

\\12y=24
\\y=2

CODE
[tex]\\12y=24
\\y=2[/tex]


Calculus

For \frac{d}{dx}x^2=2x, use

CODE
[tex]\frac{d}{dx}x^2=2x[/tex]


For \int 2x dx = x^2, use
CODE
[tex]\int 2x dx = x^2[/tex]


Greek Letters

\\\pi, \theta, \delta, \alpha would be

CODE
[tex]\pi \theta \delta \alpha[/tex]


Fractions

To get larger fractions, either use "display" tags rather than "tex" ones, e.g. 

\begin{align*}\frac{x^2}{2}\end{align*}

, or use "\dfrac", e.g. \dfrac{x^2}{2}

Alligning equations

The "display" one is more powerful, since that lets you do multiple lines of equations aligned at the = sign, e.g.



\begin{align*}
y-b &=m(x-a) \\
y &= 2x + 3
\end{align*}

CODE
[display]
y-b &=m(x-a) \\
y &= 2x + 3
[/display]


The "&=" is used instead of just "=", since the & symbol tells latex where you want things to line up.

The only other thing I would point out is trig - if you just do "sin x" it looks funny - sin x. You should really do "\sin x", with the slash, so that the "sin" bit appears upright: \sin x.

This also applies to "\cos x" and "\tan x".

Logs

Also, for logs:

\log_{10}100=\log_{10}10^2=2
CODE
[tex]\log_{10}100=\log_{10}10^2=2[/tex]

Edited by Nathan, 08 April 2007 - 11:43 AM.


#2 The Wedge Effect

    HSN Legend

  • Members
  • PipPipPipPipPipPipPipPip
  • 2,477 posts
  • Location:Paisley
  • Interests:I'm me, I guess. I wear glasses, have short spiked hair, about 5ft 9 (I think). I left fifth year of school in 2005 and is currently unemployed. I used to go to Strathclyde University to do MEng Chemical Engineering, but I hated the course, so I quit. I've started doing MSc Mathematics, from September 2006, as I have a keen (almost unhealthy) interest in Mathematics, and its applications.<br /><br />The grades I achieved in the exams:<br /><br />1 - Standard Grade Mathematics<br />1 - Standard Grade Physics<br />1 - Standard Grade Chemistry<br />1 - Standard Grade Computing Studies<br />1 - Standard Grade Craft and Design<br />2 - Standard Grade English<br />2 - Standard Grade Geography <br /><br />A (Band 1) - Higher English<br />A (Band 1) - Higher Mathematics<br />A (Band 2) - Higher Chemistry<br />B (Band 3) - Higher Physics<br /><br />Anything else ya wanna know about me, PM me or add me to your MSN contact list and chat to me there. :P
  • Gender:Male

Posted 07 April 2007 - 10:42 PM

Why hasn't this been pinned yet?

#3 George

    Child Prodigy

  • Admin
  • PipPipPipPipPipPip
  • 720 posts
  • Location:West Lothian
  • Gender:Male

Posted 08 April 2007 - 11:29 AM

Done smile.gif

And Nathan - to get larger fractions, either use "display" tags rather than "tex" ones, e.g. 

\begin{align*}\frac{x^2}{2}\end{align*}

, or use "\dfrac", e.g. \dfrac{x^2}{2}

The "display" one is more powerful, since that lets you do multiple lines of equations aligned at the = sign, e.g.



\begin{align*}
y-b &=m(x-a) \\
y &= 2x + 3
\end{align*}

CODE
[display]
y-b &=m(x-a) \\
y &= 2x + 3
[/display]


The "&=" is used instead of just "=", since the & symbol tells latex where you want things to line up.

The only other thing I would point out is trig - if you just do "sin x" it looks funny - sin x. You should really do "\sin x", with the slash, so that the "sin" bit appears upright: \sin x.

This also applies to "\cos x" and "\tan x". Also, for logs:

\log_{10}100=\log_{10}10^2=2
CODE
[tex]\log_{10}100=\log_{10}10^2=2[/tex]


#4 thedealer07

    Showing Improvement

  • Members
  • PipPip
  • 16 posts
  • Gender:Female

Posted 16 May 2007 - 04:21 PM

mental:


 X^2





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users