Register to reply

Typing in Latex on a mac

by piercebeatz
Tags: latex
Share this thread:
piercebeatz
#1
Nov26-12, 04:29 PM
P: 232
Hello everyone,

In the past few days, I have learned quite a bit of basic Latex. Thank you all for the tips. Now for the question: do macs automatically come with a latex typesetter (I think that this is the case), and if so, how do I use it? Right now, I'm just going to use this post to copy and paste something into an email- I'll delete when I'm done.

P.S. Is there a shortcut so I don't have to keep writing tex before and after everything I write?
Phys.Org News Partner Science news on Phys.org
Suddenly, the sun is eerily quiet: Where did the sunspots go?
'Moral victories' might spare you from losing again
Mammoth and mastodon behavior was less roam, more stay at home
Michael Redei
#2
Nov26-12, 04:39 PM
P: 181
I've never heard of any computer coming aith TeX pre-installed when you buy it, and I just realise that I've been TeXing for nearly 30 years. But you can get a simple-to-install TeX system called "TeX Live" from TUG (TeX User Group) here: http://www.tug.org/texlive/
piercebeatz
#3
Nov26-12, 05:44 PM
P: 232
Quote Quote by Michael Redei View Post
I've never heard of any computer coming aith TeX pre-installed when you buy it, and I just realise that I've been TeXing for nearly 30 years. But you can get a simple-to-install TeX system called "TeX Live" from TUG (TeX User Group) here: http://www.tug.org/texlive/
I just downloaded something and it looks like this. Do you know how I can do some math in this? I tried entering some commands that I learned and pressed "typeset", but here's what came up:
Attached Thumbnails
Screen shot 2012-11-26 at 6.42.47 PM.png   Screen shot 2012-11-26 at 6.44.03 PM.png  

Michael Redei
#4
Nov26-12, 06:00 PM
P: 181
Typing in Latex on a mac

You can try this small example:


\documentclass{article}
\begin{document}
What's the difference between
$E=mc^2$ and $c=\sqrt{\frac{E}{m}}$?
\end{document}


and then press the "Typeset" button just underneath your "traffic lights". You'll find lots of information on how to use TeX from TUG (www.tug.org).

P.S.: The "documentclass" line is part of this example. I don't know how to get it to stay in that box though.
piercebeatz
#5
Nov26-12, 06:10 PM
P: 232
Quote Quote by Michael Redei View Post
You can try this small example:


\documentclass{article}
\begin{document}
What's the difference between
$E=mc^2$ and $c=\sqrt{\frac{E}{m}}$?
\end{document}


and then press the "Typeset" button just underneath your "traffic lights". You'll find lots of information on how to use TeX from TUG (www.tug.org).

P.S.: The "documentclass" line is part of this example. I don't know how to get it to stay in that box though.
OK, that worked. Can you explain to me why it didn't work until I added the \documentclass{article} and the \begin/end{document}? Also, is there a preferred document class for writing math equations?
Michael Redei
#6
Nov26-12, 06:38 PM
P: 181
Your program is switched to "LaTeX" mode (as you can see next to the "Typeset" button). LaTeX provides easier formatting of documents, things like tables of contents, inserting figures etc. than PlainTeX. But LaTeX also demands some framework code, the "documentclass" and a "begin-end{document}" pair.

If you just want to typeset a formula, switch to "TeX" a.k.a. "PlainTeX" (next to the "Typeset" button) and try this:

Here is a nice equation:
$\sqrt{12+\sqrt{12+\sqrt{12+\ldots}}} = 4$.
Care to prove this?
\bye

and click "Typeset".
piercebeatz
#7
Nov26-12, 07:25 PM
P: 232
Quote Quote by Michael Redei View Post
Your program is switched to "LaTeX" mode (as you can see next to the "Typeset" button). LaTeX provides easier formatting of documents, things like tables of contents, inserting figures etc. than PlainTeX. But LaTeX also demands some framework code, the "documentclass" and a "begin-end{document}" pair.

If you just want to typeset a formula, switch to "TeX" a.k.a. "PlainTeX" (next to the "Typeset" button) and try this:

Here is a nice equation:
$\sqrt{12+\sqrt{12+\sqrt{12+\ldots}}} = 4$.
Care to prove this?
\bye

and click "Typeset".
Thanks a lot! If I need any help I know who to ask :)
piercebeatz
#8
Nov26-12, 07:34 PM
P: 232
By the way, I think I figured out a proof to your problem:

[tex]\sqrt{12+\sqrt{12+\sqrt{12+\ldots}}} = x[/tex]
[tex]12+\sqrt{12+\sqrt{12+\sqrt{12+\ldots}}}=x^2[/tex]
[tex]x^2-x-12=0[/tex]
[tex](x+3)(x-4)=0[/tex]
[tex]x=4 \space or \space x=-3[/tex]

Is there another way of going about this that does not accumulate a negative solution?

P.S. How do you use the $ instead of [tex]? It didn't work for me.
Michael Redei
#9
Nov26-12, 07:44 PM
P: 181
Quote Quote by piercebeatz View Post
P.S. How do you use the $ instead of [tex]? It didn't work for me.
I used two dollar signs without a space between them, i.e.

$ (no space here) $
Lots of mathematics
$ (no space again) $

Test:

$$
Lots of mathematics
$$

Okay, let's say that was a list of variables, since they're often put in italics :-)

Your solution to the square-root problem is fine, except that x=-3 must be excluded (a root f anything , no matter how complicated, can't be negative and real). I don't know of any direct way of solving that equation, but you did the only thing possible: assume there is some solution x and try to find it.
piercebeatz
#10
Nov26-12, 08:37 PM
P: 232
Quote Quote by Michael Redei View Post
I used two dollar signs without a space between them, i.e.

$ (no space here) $
Lots of mathematics
$ (no space again) $

Test:

$$
Lots of mathematics
$$

Okay, let's say that was a list of variables, since they're often put in italics :-)

Your solution to the square-root problem is fine, except that x=-3 must be excluded (a root f anything , no matter how complicated, can't be negative and real). I don't know of any direct way of solving that equation, but you did the only thing possible: assume there is some solution x and try to find it.
OK, so if you put a $ $ w/o a space at the top and bottom of a bunch of lines of equations, you don't have to keep inserting the [tex] and [ /tex]?

Test:

$$
\lim_x\to\infty e^(-x)
e^{-\infty}
0
$$
Michael Redei
#11
Nov26-12, 08:57 PM
P: 181
Works perfectly for me:
$$
\lim_x\to\infty e^(-x)
e^{-\infty}
0
$$
You need braces around subscripts and superscripts though, and an = or two:

$$
\lim_{x\to\infty} e^{(-x)} =
e^{-\infty} =
0
$$
gives you
$$
\lim_{x\to\infty} e^{(-x)} =
e^{-\infty} =
0
$$

Hmmm... I've been using the preview first before submitting these things. Maybe you should try that too.
Michael Redei
#12
Nov26-12, 08:59 PM
P: 181
Does this work inline with just one dollar at each end? Like $a+b=c$ this?

No :-(
jtbell
#13
Nov26-12, 09:44 PM
Mentor
jtbell's Avatar
P: 11,586
On PF, for inline LaTeX, use two pound signs (#'s) on each end: ##E = mc^2##.

For information about LaTex on PF, see here:

http://www.physicsforums.com/showthr...17#post3977517
piercebeatz
#14
Nov26-12, 10:08 PM
P: 232
Sorry, but what does inline mean?
Michael Redei
#15
Nov26-12, 11:12 PM
P: 181
Quote Quote by piercebeatz View Post
Sorry, but what does inline mean?
Inline maths is set "in the line", like ##\tan\alpha = (\sin\alpha)/(\cos\alpha)##, whereas "display-style" maths is set between paragraphs, like
$$
\tan\alpha = \frac{\sin\alpha}{\cos\alpha}.
$$
This can be easier to read, bit it needs more space.
jtbell
#16
Nov27-12, 12:05 AM
Mentor
jtbell's Avatar
P: 11,586
Quote Quote by piercebeatz View Post
what does inline mean?
"in the middle of a line"
piercebeatz
#17
Nov27-12, 07:02 AM
P: 232
$$
Testing Inline
$$

Awesome, it worked. Thanks for the advice, guys


Register to reply

Related Discussions
Typing formulas Math & Science Software 5
TeX, LaTeX, typing systems Computers 0
Math typing Math & Science Software 4
Mathmatical typing Academic Guidance 1
Typing formulas without latex. General Physics 11