Suggestion Add how to make blockquotes in posts to the FAQ

  • Thread starter Thread starter blaisem
  • Start date Start date
AI Thread Summary
The discussion focuses on how to achieve compact spacing for LaTeX equations in forum posts, particularly the aesthetic benefits of using a blue box format. Users express frustration with the default spacing around equations, which can be excessive, and share various methods to achieve single spacing, including using the \begin{align} command and inline equations with double dollar signs. The blue box format, which utilizes HTML and CSS, is preferred for its visual appeal but is not easily implemented in standard posts. Suggestions are made to include instructions for this formatting in the FAQ to assist other users. Overall, the conversation highlights the need for clearer guidance on LaTeX formatting options within the forum.
blaisem
Messages
28
Reaction score
2
In the LaTex help page:

https://www.physicsforums.com/help/latexhelp/

the 2nd section, "Delimiting your LaTex code," formats the LaTex equations into a blue box. An advantage of this box is that line spacing before, between, and after $$ delimiters is single-spaced. Otherwise, you end up with massive spacing like this:

$$ F=ma $$
$$ P=mv $$
$$ \hat H \Psi = - \frac{\hbar ^2}{2 \mu } \nabla^2 \Psi (r) + V(r) \Psi (r) = E \Psi (r) $$

For this reason, I would like to use this blue box, but I could not find anywhere how.

I initially attempted the {linespacing} LaTex formatting from its help site, but that doesn't seem to work on PF. I did however eventually find the spacing inbetween delimiters can be forced into single spacing via \begin{align}, although it requires the inconvenience of trial and error to arrange the proper alignment with "&"—not to mention the admittedly very mild annoyance of typing out the extra text. Nevertheless, the spacing before and after the equations remains dramatically pronounced. Example:

$$ \begin{align} F=ma \nonumber \\ p=mv \nonumber \\ \hat H \Psi = - \frac{\hbar ^2}{2 \mu } \nabla^2 \Psi (r) + V(r) \Psi (r) = E \Psi (r) \nonumber \end{align}$$

Also notice the necessity to trial and error the alignment with longer equations, making this work-around suboptimally tedious.

Personally, I prefer the aesthetic provided by the blue box in the help tutorial, where the spacing is more compact, and potentially more convenient to implement. Would it be possible to add how to do this somewhere in the FAQ? Or did I manage to miss it explained somewhere?
 
Physics news on Phys.org
The code itself is the same. The forum adds one line break before and after these equations. To avoid that:
  • You can use the inline equations with double #: ##a_1^2+b_2^2##. To make them look more like the other style, add \displaystyle and center them. That leaves about the regular line spacing.
    ##\hat H \Psi = - \frac{\hbar ^2}{2 \mu } \nabla^2 \Psi (r) + V(r) \Psi (r) = E \Psi (r)##​
  • Between equations, you can use the LaTeX line break \\, no special alignment necessary: $$a^2=b^2\\c^2=e^2+f^2$$
 
  • Like
Likes blaisem
blaisem said:
I would like to use this blue box
The "Help/How-To" articles use HTML tags for formatting. These do not work elsewhere in the forum. The blue box is a <p> tag with some inline CSS code:

<p style='margin-left: 10%; margin-right: 10%; background-color: Azure'>

If you're interested only in the single-spacing, I use the LaTeX line-break code // that mfb mentioned, in my ordinary posts. To avoid extra space before and after the entire block of equations, I put the code (with $$ delimiters) in-line inside a paragraph, with no extra newlines before and after the delimiters. You can see an example of this in one of my "blue boxes".
 
Last edited:
  • Like
Likes blaisem
I see. I did not realize \\ was standard LaTex for a newline, nor that it was the actual reason the alignment formatting was singly spaced. That's also interesting double $ in a paragraph eliminates spacing before and after; I understood from the tutorial to only use double $ in a separate line since it's intended for stand-alone equations. It does seem easier than \displaystyle, although I may play around with both when the occasion arises.

I will use these methods going forward. Thank you both for the help!
 
Last edited:
  • Like
Likes dlgoff

Similar threads

Replies
3
Views
2K
Replies
7
Views
3K
Replies
4
Views
4K
Replies
1
Views
1K
Replies
15
Views
5K
Replies
2
Views
2K
Back
Top