Can in-line latex be aligned better?

  • Context: LaTeX 
  • Thread starter Thread starter jackmell
  • Start date Start date
  • Tags Tags
    Latex
Click For Summary

Discussion Overview

The discussion centers around the alignment and appearance of in-line LaTeX in forum posts, with participants expressing concerns about visual presentation, vertical alignment, and font size. The scope includes technical aspects of formatting and user experience on the forum.

Discussion Character

  • Debate/contested
  • Technical explanation
  • Meta-discussion

Main Points Raised

  • One participant suggests that in-line LaTeX, such as \sqrt{x}, does not align well with surrounding text and appears smaller, impacting overall readability.
  • Another participant notes that while some issues may have been resolved, symbols like arrows over letters still get cut off, affecting clarity.
  • A participant mentions the necessity of cutting off LaTeX above a certain height, indicating a technical limitation in rendering.
  • Concerns are raised about the inability to use certain LaTeX commands, like \vec{F} or \ddot{X}, in in-line formatting.
  • One participant shares a link to another forum where in-line LaTeX appears better aligned and formatted, questioning the differences in presentation quality.
  • Another participant attempts to illustrate the issue by copying a post from the referenced forum, noting that while alignment seems fine, the font size and sharpness differ significantly.
  • Disagreement arises regarding whether specific LaTeX elements are aligned correctly, with some participants asserting misalignment while others do not observe the same issue.
  • One participant acknowledges that the tops of some fractions are cut off, indicating a persistent problem that is not dependent on the browser used.

Areas of Agreement / Disagreement

Participants express mixed views on the alignment of in-line LaTeX, with some agreeing on the presence of issues while others believe the alignment is acceptable. The discussion remains unresolved regarding the specific causes of the observed misalignments and the effectiveness of potential solutions.

Contextual Notes

Participants note that visual discrepancies may be influenced by browser differences and monitor sizes, but there is no consensus on the exact nature of the alignment issues or how to address them effectively.

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 [itex]\sqrt{x}=y[/itex] and note how [itex]\sqrt{x}[/itex] is not aligning perfectly with the text. The [itex]\sqrt{x}[/itex] 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 [itex]1+e^u-e^u[/itex]. That's not what Dick is doing. He is simply using [itex]1=1+e^u-e^u[/itex] 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, [itex]\vec{F}[/itex] 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: [itex]\frac{e^{X^2}}{2}[/itex]

tex: [tex]\frac{e^{X^2}}{2}[/tex]
 
Yeah, I realize there's got to be some limit. It's just unfortunate that currently you can't write [tex]\vec{F}[/tex] or [tex]\ddot{X}[/tex] 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 [itex]D(i,r)[/itex] such that [itex]f(z)^2 = z^2+1[/itex]. Proof: Think of [itex]r[/itex] as small. Suppose there is such an [itex]f[/itex]. Then [itex]f[/itex] is nonzero in [itex]D(i,r)- \{i\}[/itex]. Let [itex]z\in D(i,r)- \{i\}[/itex]. Then [itex]\frac{f(z+h)^2-f(z)^2}{h} = \frac{f(z+h)-f(z)}{h} (f(z+h)+f(z)) \to 2z[/itex] as [itex]h\to 0[/itex]. By the continuity of [itex]f[/itex], we get [itex]f'(z) = \frac{2z}{2f(z)}= \frac{z}{f(z)}[/itex]. This shows f is analytic in [itex]D(i,r)- \{i\}[/itex]. But clearly [itex]f[/itex] is bounded near [itex]i[/itex], so the singularity at [itex]i[/itex] is removable, hence [itex]f[/itex] is analytic in [itex]D(i,r)[/itex]. But [itex]f(i)=0[/itex], and this implies [itex]f'(z)[/itex] blows up at [itex]i[/itex], 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 [itex]D(i,r)[/itex] such that [itex]f(z)^2 = z^2+1[/itex]. Proof: Think of [itex]r[/itex] as small. Suppose there is such an [itex]f[/itex]. Then [itex]f[/itex] is nonzero in [itex]D(i,r)- \{i\}[/itex]. Let [itex]z\in D(i,r)- \{i\}[/itex]. Then [tex]\frac{f(z+h)^2-f(z)^2}{h} = \frac{f(z+h)-f(z)}{h} (f(z+h)+f(z)) \to 2z[/tex] as [itex]h\to 0[/itex]. By the continuity of [itex]f[/itex], we get [itex]f'(z) = \frac{2z}{2f(z)}= \frac{z}{f(z)}[/itex]. This shows f is analytic in [itex]D(i,r)- \{i\}[/itex].


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 [itex]\mathbb R[/itex]. (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 [itex]D(i,r)[/itex] such that [itex]f(z)^2 = z^2+1[/itex]. Proof: Think of [itex]r[/itex] as small. Suppose there is such an [itex]f[/itex]. Then [itex]f[/itex] is nonzero in [itex]D(i,r)- \{i\}[/itex]. Let [itex]z\in D(i,r)- \{i\}[/itex]. Then [itex]\frac{f(z+h)^2-f(z)^2}{h} = \frac{f(z+h)-f(z)}{h} (f(z+h)+f(z)) \to 2z[/itex] as [itex]h\to 0[/itex]. By the continuity of [itex]f[/itex], we get [itex]f'(z) = \frac{2z}{2f(z)}= \frac{z}{f(z)}[/itex]. This shows f is analytic in [itex]D(i,r)- \{i\}[/itex]. But clearly [itex]f[/itex] is bounded near [itex]i[/itex], so the singularity at [itex]i[/itex] is removable, hence [itex]f[/itex] is analytic in [itex]D(i,r)[/itex]. But [itex]f(i)=0[/itex], and this implies [itex]f'(z)[/itex] blows up at [itex]i[/itex], 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 [itex]D(i,r)[/itex]

The [itex]D(i,r)[/itex] 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 [itex]D(i,r)[/itex] 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 [itex]D(i,r)[/itex] 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 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 2 ·
Replies
2
Views
6K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 9 ·
Replies
9
Views
6K
  • · Replies 11 ·
Replies
11
Views
6K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
7K