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
I want to thank those members who interacted with me a couple of years ago in two Optics Forum threads. They were @Drakkith, @hutchphd, @Gleb1964, and @KAHR-Alpha. I had something I wanted the scientific community to know and slipped a new idea in against the rules. Thank you also to @berkeman for suggesting paths to meet with academia. Anyway, I finally got a paper on the same matter as discussed in those forum threads, the fat lens model, got it peer-reviewed, and IJRAP...
This came up in my job today (UXP). Never thought to raise it here on PF till now. Hyperlinks really should be underlined at all times. PF only underlines them when they are rolled over. Colour alone (especially dark blue/purple) makes it difficult to spot a hyperlink in a large block of text (or even a small one). Not everyone can see perfectly. Even if they don't suffer from colour deficiency, not everyone has the visual acuity to distinguish two very close shades of text. Hover actions...
About 20 years ago, in my mid-30s (and with a BA in economics and a master's in business), I started taking night classes in physics hoping to eventually earn the science degree I'd always wanted but never pursued. I found physics forums and used it to ask questions I was unable to get answered from my textbooks or class lectures. Unfortunately, work and life got in the way and I never got further the freshman courses. Well, here it is 20 years later. I'm in my mid-50s now, and in a...

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