LaTeX implementation ready for testing on Physics Forums
- Context: LaTeX
- Thread starter Greg Bernhardt
- Start date
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
161 replies · 8K views
Physics news on Phys.org
Staff Emeritus
Science Advisor
Gold Member
- 10,270
- 45
Originally posted by enigma
Greg, Warren,
I think that the intro thread which Warren posted should be made into a general announcement to all forums.
Most likely -- I can't do that though.
(except I currently have access to the entire site's code... supermegalomentor, here I come! )
- Warren
Staff Emeritus
Science Advisor
Gold Member
- 10,270
- 45
The browser does not display alt tags for images that are loading, it displays them for images that are unloadable -- in other words, images that don't exist on the server.Originally posted by Ambitwistor
Sometimes the equation images take a while to load. Perhaps the TeX source could be squished into an ALT tag for the browser to display while it's loading the images (for those browsers that do that)?
Are you saying it takes a long time to view a page that has TeX equations on it, because the image files take time to download? Or do you mean it takes time for a newreply (or editpost) operation to complete for a post with images in it?
- Warren
Staff Emeritus
Science Advisor
Gold Member
- 755
- 2
Wolfenstein parameterization:
[tex] V = \left( \begin{array}{ccc}<br /> 1-\frac{1}{2}\lambda^2 & \lambda & A\lambda^3(\rho-i\eta) \\<br /> -\lambda & 1-\frac{1}{2}\lambda^2 & A\lambda^2 \\<br /> A\lambda^3(1-\rho-i\eta) & -A\lambda^2 & 1<br /> \end{array} \right) + {\cal O}(\lambda^4)[/tex]
[tex] V = \left( \begin{array}{ccc}<br /> 1-\frac{1}{2}\lambda^2 & \lambda & A\lambda^3(\rho-i\eta) \\<br /> -\lambda & 1-\frac{1}{2}\lambda^2 & A\lambda^2 \\<br /> A\lambda^3(1-\rho-i\eta) & -A\lambda^2 & 1<br /> \end{array} \right) + {\cal O}(\lambda^4)[/tex]
Staff Emeritus
Science Advisor
Gold Member
- 10,270
- 45
Okay -- well, the images already have an alt tag -- so if your browser is not displaying it, I don't know what to tell you.Originally posted by Ambitwistor
Some browsers do display ALT tags for images that are loading, and then replace them with the actual images after they have loaded.
That's surprising. I chose the converters and formatting specifically to limit file sizes. In fact, the largest equation png file generated so far is just a hair over two kilobytes -- files of this size shouldn't be a problem on even an ancient phone modem. (Each image would take about half a second to download.)Yes.
As far as I can tell, the images haven't slowed my page loads noticeably at all.
What browser, OS, and internet access medium are you using?
- Warren
Staff Emeritus
Science Advisor
Gold Member
- 10,270
- 45
Originally posted by Ambitwistor
Oh. Heh. My browser at home does that, but I never actually checked to see if this one does (I just started using it).
Are you using a proxy server? Do you just happen to have some very slow link in your traceroute to physicsforums.com?Well, my page loads are always slow, even over broadband ... I don't think it's due to image size, but due to the fact that each HTTP request stalls briefly while connecting. I don't think there's anything you can do about that.
- Warren
Staff Emeritus
Science Advisor
Gold Member
- 755
- 2
Originally posted by chroot
Post your examples in the general physics thread. :) Looks very pretty! I thought Wolfenstein was a video game.
I knew the game too. I should have brought it up with him sometime.
Ok, General Physics, here it goes!
Staff Emeritus
Science Advisor
Gold Member
- 10,270
- 45
Yeah, it's entirely possible your browser is opening new connections for each and every HTTP request -- and only opening one connection at a time. Ack!Originally posted by Ambitwistor
No, I'm not using a proxy. My traceroute isn't bad, and I get 85 ms pings. It's probably the browser (Konqueror). I was using Mozilla, but I mangled some of my libraries beyond the current limits of my patience to fix them, so it doesn't work right for now.
- Warren
Staff Emeritus
Science Advisor
Gold Member
- 755
- 2
Tests...
[tex] \newcommand{\colv}[2] {\left(\begin{array}{c} #1 \\ #2 \end{array}\right)}<br /> L_L &=& \left(<br /> {\colv{\nu_e}{e}}_L,<br /> {\colv{\nu_\mu}{\mu}}_L,<br /> {\colv{\nu_\tau}{\tau}}_L\,<br /> \right), \qquad Y_L = -\frac{1}{2}[/tex]
[tex] \newcommand{\colv}[2] {\left(\begin{array}{c} #1 \\ #2 \end{array}\right)}<br /> Q_L &=& \left(<br /> {\colv{u}{d}}_L,<br /> {\colv{c}{s}}_L,<br /> {\colv{t}{b}}_L\,<br /> \right), \qquad\quad\ Y_Q = \frac{1}{6}[/tex]
[tex] \newcommand{\colv}[2] {\left(\begin{array}{c} #1 \\ #2 \end{array}\right)}<br /> L_L &=& \left(<br /> {\colv{\nu_e}{e}}_L,<br /> {\colv{\nu_\mu}{\mu}}_L,<br /> {\colv{\nu_\tau}{\tau}}_L\,<br /> \right), \qquad Y_L = -\frac{1}{2}[/tex]
[tex] \newcommand{\colv}[2] {\left(\begin{array}{c} #1 \\ #2 \end{array}\right)}<br /> Q_L &=& \left(<br /> {\colv{u}{d}}_L,<br /> {\colv{c}{s}}_L,<br /> {\colv{t}{b}}_L\,<br /> \right), \qquad\quad\ Y_Q = \frac{1}{6}[/tex]
Last edited:
Staff Emeritus
Science Advisor
Gold Member
- 4,229
- 61
[tex]^{33}_{17}Cl^{16}\xrightarrow{n,n)^{31}_{15}P^{16}+^4_2He^2[/tex]
..wtf! :P ?
I don't see what's wrong with this.. it worked individually?
[tex]^{33}_{17}Cl^{16}~\xrightarrow{n,n}~^{31}_{15}P^{16}~+~^4_2He^2[/tex]
ah, a wrong bracket..
..wtf! :P ?
I don't see what's wrong with this.. it worked individually?
[tex]^{33}_{17}Cl^{16}~\xrightarrow{n,n}~^{31}_{15}P^{16}~+~^4_2He^2[/tex]
ah, a wrong bracket..
Last edited:
Staff Emeritus
Science Advisor
Gold Member
- 10,270
- 45
I can't even get your code to work properly in tex on my local machine...
I'm trying
\newcommand{\atom}[4]{{x}^{#1}_{#2} {#3}^{#4}}
\atom{33}{17}{Cl}{16}
\xrightarrow{n,n}
\atom{31}{15}{P}{16} + \atom{4}{2}{He}{2}
I'll have to look into what's making it fail.
- Warren
I'm trying
\newcommand{\atom}[4]{{x}^{#1}_{#2} {#3}^{#4}}
\atom{33}{17}{Cl}{16}
\xrightarrow{n,n}
\atom{31}{15}{P}{16} + \atom{4}{2}{He}{2}
I'll have to look into what's making it fail.
- Warren
Staff Emeritus
Science Advisor
Gold Member
- 10,270
- 45
Okay Ambi
It's the [ 4 ] that's causing problems, since it's being parsed by the smilie parser before being sent to latex. Here are two solutions:
1) Write [ 4 ] with spaces inside the tag, so the smilie parser won't touch it. LaTeX doesn't care about spaces.
2) Disable smilies in the post to stop the smilie parser from messing with it.
I'll update the code to put the smilie parser AFTER the latex parser when I get a chance.
- Warren
It's the [ 4 ] that's causing problems, since it's being parsed by the smilie parser before being sent to latex. Here are two solutions:
1) Write [ 4 ] with spaces inside the tag, so the smilie parser won't touch it. LaTeX doesn't care about spaces.
2) Disable smilies in the post to stop the smilie parser from messing with it.
I'll update the code to put the smilie parser AFTER the latex parser when I get a chance.
- Warren
Staff Emeritus
Science Advisor
Gold Member
- 4,229
- 61
Could the font be made slightly smaller? A longer formula will be cut off it seems.
How about automatic spaces? Do I always have to put in spacers, or will it be automatically done with some characters?
[tex]{one}+{one}={one}~+~{one}[/tex]
ah, apparently it already does that :P
How about automatic spaces? Do I always have to put in spacers, or will it be automatically done with some characters?
[tex]{one}+{one}={one}~+~{one}[/tex]
ah, apparently it already does that :P
- 3,773
- 1,991
[tex]
\begin{array}{rcccl}<br />
\ &\ &\mathrm{H}& \ & \ <br />
\\<br />
\ &\ &\mid&\ &\ <br />
\\<br />
\mathrm{H}& - &\mathrm{C}& - &\mathrm{OH}<br />
\\<br />
\ &\ &\mid&\ &\ <br />
\\<br />
\mathrm{H}& - &\mathrm{C}& - &\mathrm{OH}<br />
\\<br />
\ &\ &\mid&\ &\ <br />
\\<br />
\mathrm{H}& - &\mathrm{C}& - &\mathrm{OH}<br />
\\<br />
\ &\ &\mid&\ &\ <br />
\\<br />
\ &\ &\mathrm{H}& \ & \ <br />
<br />
\end{array}[/tex]
Glycerin
[tex] \begin{array}{ccccccccc}<br /> \ &\ &\mathrm{H}&\ &\mathrm{H}&\ &\mathrm{H}& \ & \ <br /> \\<br /> \ &\ &\mid&\ &\mid&\ &\mid&\ &\ <br /> \\<br /> \mathrm{H}& - &\mathrm{C}& -&\mathrm{C}& -&\mathrm{C}& - &\mathrm{H}<br /> \\<br /> \ &\ &\mid&\ &\mid&\ &\mid&\ &\ <br /> \\<br /> \ &\ &\mathrm{H}&\ &\mid&\ &\mathrm{H}& \ & \ <br /> \\<br /> \ &\ &\mathrm{H}&-&\mathrm{C}&-&\mathrm{H}&\ &\ <br /> \\<br /> \ &\ &\ &\ &\mid&\ &\ &\ &\ <br /> \\<br /> \ &\ &\ &\ &\mathrm{H}\ &\ &\ &\ <br /> <br /> \end{array}[/tex]
Isobutane
Glycerin
[tex] \begin{array}{ccccccccc}<br /> \ &\ &\mathrm{H}&\ &\mathrm{H}&\ &\mathrm{H}& \ & \ <br /> \\<br /> \ &\ &\mid&\ &\mid&\ &\mid&\ &\ <br /> \\<br /> \mathrm{H}& - &\mathrm{C}& -&\mathrm{C}& -&\mathrm{C}& - &\mathrm{H}<br /> \\<br /> \ &\ &\mid&\ &\mid&\ &\mid&\ &\ <br /> \\<br /> \ &\ &\mathrm{H}&\ &\mid&\ &\mathrm{H}& \ & \ <br /> \\<br /> \ &\ &\mathrm{H}&-&\mathrm{C}&-&\mathrm{H}&\ &\ <br /> \\<br /> \ &\ &\ &\ &\mid&\ &\ &\ &\ <br /> \\<br /> \ &\ &\ &\ &\mathrm{H}\ &\ &\ &\ <br /> <br /> \end{array}[/tex]
Isobutane
- 3,773
- 1,991
[tex]
\begin{array}{ccccccc}<br />
<br />
\ &\ &\ &\mathrm{H}&\ &\ &\ \\<br />
<br />
\ &\ &\ &\mid&\ &\ &\ \\<br />
<br />
\ &\ &\ &\mathrm{C}&\ &\ &\ \\<br />
<br />
\ &\ &\ &/\!\!/\backslash &\ &\ &\ \\<br />
<br />
\ &\mathrm{H}&-&\mathrm{C}\ \mathrm{C}&-&\mathrm{H}\\<br />
<br />
\ &\ &\ &\mid\ \|&\ &\ \\<br />
<br />
\ &\mathrm{H}&-&\mathrm{C}\ \mathrm{C}&-&\mathrm{H}\\<br />
<br />
\ &\ &\ &\backslash\!\!\backslash / &\ &\ &\ \\<br />
<br />
\ &\ &\ &\mathrm{C}&\ &\ &\ \\<br />
<br />
\ &\ &\ &\mid&\ &\ &\ \\<br />
<br />
\ &\ &\ &\mathrm{H}&\ &\ &\ \\<br />
\end{array}<br />
[/tex]
Benzene
[tex]\mathrm{C}_{\mathrm{6}}\mathrm{H}_{\mathrm{6}}[/tex]
This could look better if I had actual diagonal lines to work with rather than slashs; something like[tex]\nwarrow[/tex] and [tex]\swarrow[/tex] without the arrow tips.
Benzene
[tex]\mathrm{C}_{\mathrm{6}}\mathrm{H}_{\mathrm{6}}[/tex]
This could look better if I had actual diagonal lines to work with rather than slashs; something like[tex]\nwarrow[/tex] and [tex]\swarrow[/tex] without the arrow tips.
Staff Emeritus
Science Advisor
Gold Member
- 755
- 2
More tests...
[tex] \begin{array}{cc}<br /> \begin{picture}(10,10)(0,0)<br /> \put(0,0){\line(1,1){10}}<br /> \put(2,0){\line(1,1){10}}<br /> \end{picture} &<br /> \begin{picture}(10,10)(0,0)<br /> \put(0,10){\line(1,-1){10}}<br /> \end{picture} \\<br /> \begin{picture}(10,10)(0,0)<br /> \put(0,10){\line(1,-1){10}}<br /> \end{picture} &<br /> \begin{picture}(10,10)(0,0)<br /> \put(0,0){\line(1,1){10}}<br /> \put(2,0){\line(1,1){10}}<br /> \end{picture}<br /> \end{array}[/tex]
[tex] \begin{array}{cc}<br /> \begin{picture}(10,10)(0,0)<br /> \put(0,0){\line(1,1){10}}<br /> \put(2,0){\line(1,1){10}}<br /> \end{picture} &<br /> \begin{picture}(10,10)(0,0)<br /> \put(0,10){\line(1,-1){10}}<br /> \end{picture} \\<br /> \begin{picture}(10,10)(0,0)<br /> \put(0,10){\line(1,-1){10}}<br /> \end{picture} &<br /> \begin{picture}(10,10)(0,0)<br /> \put(0,0){\line(1,1){10}}<br /> \put(2,0){\line(1,1){10}}<br /> \end{picture}<br /> \end{array}[/tex]