LaTeX Can in-line latex be aligned better?

  • Thread starter Thread starter jackmell
  • Start date Start date
  • Tags Tags
    Latex
AI Thread Summary
The discussion centers on the need for improvements in the presentation of in-line LaTeX in forum posts. Participants express concerns about misalignment and font size discrepancies, noting that symbols like \sqrt{x} and \vec{F} do not align well with surrounding text, leading to an awkward appearance. There are mentions of specific examples where the LaTeX formatting appears better on other platforms, prompting suggestions for enhancements. Some users highlight issues with cut-off symbols and the vertical alignment of certain expressions, indicating that these problems persist across different browsers. The conversation also touches on the potential benefits of transitioning to MathJax for better rendering of mathematical expressions, which could resolve many of the current formatting issues. Overall, the thread emphasizes the importance of clear and visually appealing mathematical notation for improved user experience on the forum.
jackmell
Messages
1,806
Reaction score
54
Hi. May I suggest the administrators consider improving how in-line latex appears in posts? For example consider:

This is my in-line post of \sqrt{x}=y and note how \sqrt{x} is not aligning perfectly with the text. The \sqrt{x} would look nicer if it were just slightly lower in the line and it also appears to have a slightly smaller font then the text. Notice other posts when lots of in-line latex appears, the entire paragraph looks awkward due to this mis-alignment. Here is another actual example of just one I picked at random in the homework forum:

Tom Mattson said:
Dick's method is the right one, but it's not what you were saying in post 5. In that post you said multiply the top and the bottom by 1+e^u-e^u. That's not what Dick is doing. He is simply using 1=1+e^u-e^u in the numerator alone. That's the way to do it.

Notice how the in-line latex is way-off center.

I don't wish to be critical but rather am offering a constructive criticism that if it were fixed, would improve the look of the forum.
 
Physics news on Phys.org
Looks like it's been fixed. :smile:

Unfortunately, symbols, like arrows, over letters still get cut off. For example, \vec{F} should be an F with an arrow over it, but all you see is a dot at the right.
 
I'm no expert on this, but it seems that the cutting off above a certain height is necessary:
chroot said:
Yeah, the inline LaTeX is a little tough.. I can't just use a trim command. I have to trim it exactly to some known y dimension.
The following should read eX2/2 (that's uppercase "X")...

itex: \frac{e^{X^2}}{2}

tex: \frac{e^{X^2}}{2}
 
Yeah, I realize there's got to be some limit. It's just unfortunate that currently you can't write \vec{F} or \ddot{X} using inline TeX.
 
Redbelly98 said:
I'm no expert on this, but it seems that the cutting off above a certain height is necessary:
From a software perspective, it's certainly possible to trim the images. I do that on my personal blog. It can mess up the vertical alignment a bit, depending on which browser is being used, but I personally think including the important parts of the image is more important than preserving the line alignment.

Of course, if/when PF transitions to MathJax, I think that whole issue goes away :wink:
 
Last edited:
Guys look, I don't want to be annoying but I would like to more explicitly illustrate what I am suggesting and I apologize for using another forum as an example:

http://www.artofproblemsolving.com/Forum/viewtopic.php?f=359&t=371489&

Now look through that thread. All the in-line latex is perfectly adjusted, perfectly formatted, aligned, whatever to make a very nice presentation.

What they got that we ain't got?
 
That does look really good. I'll try a copy and paste of post #19 from that thread, with itex tags around the math, just to see what it looks like here:



There is no function f continuous on a disc D(i,r) such that f(z)^2 = z^2+1. Proof: Think of r as small. Suppose there is such an f. Then f is nonzero in D(i,r)- \{i\}. Let z\in D(i,r)- \{i\}. Then \frac{f(z+h)^2-f(z)^2}{h} = \frac{f(z+h)-f(z)}{h} (f(z+h)+f(z)) \to 2z as h\to 0. By the continuity of f, we get f'(z) = \frac{2z}{2f(z)}= \frac{z}{f(z)}. This shows f is analytic in D(i,r)- \{i\}. But clearly f is bounded near i, so the singularity at i is removable, hence f is analytic in D(i,r). But f(i)=0, and this implies f'(z) blows up at i, contradiction.



The alignment is fine, isn't it? But the images at the other forum are much sharper for some reason, and larger. We get a really tiny font in the fractions. They don't. And of course, that large fraction is messed up. We would have to use tex tags around that one:



There is no function f continuous on a disc D(i,r) such that f(z)^2 = z^2+1. Proof: Think of r as small. Suppose there is such an f. Then f is nonzero in D(i,r)- \{i\}. Let z\in D(i,r)- \{i\}. Then \frac{f(z+h)^2-f(z)^2}{h} = \frac{f(z+h)-f(z)}{h} (f(z+h)+f(z)) \to 2z as h\to 0. By the continuity of f, we get f'(z) = \frac{2z}{2f(z)}= \frac{z}{f(z)}. This shows f is analytic in D(i,r)- \{i\}.


Not very pretty. I will also mention that I find it annoying that itex increases the distance to the next line, e.g. when I write \mathbb R. (There seems to be no reason why this particular symbol would do that). Maybe it would be a good idea to increase the default distance between two lines of text by a small amount.
 
Last edited:
Fredrik said:
That does look really good. I'll try a copy and paste of post #19 from that thread, with itex tags around the math, just to see what it looks like here:



There is no function f continuous on a disc D(i,r) such that f(z)^2 = z^2+1. Proof: Think of r as small. Suppose there is such an f. Then f is nonzero in D(i,r)- \{i\}. Let z\in D(i,r)- \{i\}. Then \frac{f(z+h)^2-f(z)^2}{h} = \frac{f(z+h)-f(z)}{h} (f(z+h)+f(z)) \to 2z as h\to 0. By the continuity of f, we get f'(z) = \frac{2z}{2f(z)}= \frac{z}{f(z)}. This shows f is analytic in D(i,r)- \{i\}. But clearly f is bounded near i, so the singularity at i is removable, hence f is analytic in D(i,r). But f(i)=0, and this implies f'(z) blows up at i, contradiction.

The alignment is fine, isn't it?

No. It's not. Look at the very first line:

There is no function f continuous on a disc D(i,r)

The D(i,r) is not vertically aligned with the rest of the text. It is shifted far upward with the lower boundary at near mid-line or is that just my browser doing that?
 
jackmell said:
The D(i,r) is not vertically aligned with the rest of the text. It is shifted far upward with the lower boundary at near mid-line or is that just my browser doing that?
It doesn't look that way for me. I'm using Firefox, but I verified that it's the same in IE. The bottom of the text is aligned with the bottom of the rest of the text on the line.
 
  • #10
Fredrik said:
It doesn't look that way for me. I'm using Firefox, but I verified that it's the same in IE. The bottom of the text is aligned with the bottom of the rest of the text on the line.

Ok Fredrik. Maybe it's just me. Sorry about that guys. I really don't mind too much anyway. Just suggesting something I though might be helpful.
 
  • #11
I do note that the tops of some of the fractions are cut off - that part of the problem is not browser-dependent.
 
  • #12
jackmell said:
Ok Fredrik. Maybe it's just me. Sorry about that guys. I really don't mind too much anyway. Just suggesting something I though might be helpful.
I agree that the LaTeX on that other site looks better. I wonder why their images are sharper, and not so small.

A minor correction to what I said earlier: The bottom of the D is aligned with the bottom of the text. The parentheses go down a little bit further. The D is a bit taller than the rest of the text.

diazona said:
I do note that the tops of some of the fractions are cut off - that part of the problem is not browser-dependent.
I think we all see the same images, but apparently not in the exact same location.
 
  • #13
Could someone please explain to me how to fix my browser? Take this line:

The D(i,r) is not vertically aligned with the rest of the text. It is shifted far upward with the lower boundary at near mid-line or is that just my browser doing that?

The bottom of the D is aligned with the horizontal line of the "e" preceding it, that is, it's shifted up. Other in-line code is even more mis-aligned.

I'm using Firefox 3.6.12 and also, I recently got one of those larger monitors I think 12x18 but I believe this occurred with my previous monitor as well.
 

Similar threads

Replies
1
Views
3K
Replies
11
Views
5K
Replies
7
Views
3K
Replies
3
Views
2K
Back
Top