Bug Problem with links to the library

  • Thread starter Thread starter sylas
  • Start date Start date
AI Thread Summary
The discussion addresses issues with LaTeX code in a forum post, specifically regarding the autolink feature that interferes with the word "flux." The autolink system mistakenly adds links to the LaTeX code, causing formatting problems. Two solutions are proposed: adjusting the placement of the \textrm command or using the word "flux" earlier in the text to prevent autolinking. The participants confirm that these adjustments successfully resolve the issue. The conversation concludes with a request for a post fix and appreciation for the quick resolution.
sylas
Science Advisor
Messages
1,647
Reaction score
9
Make sure that you have library autolinks enabled, and then have a look at [post=2162699]msg #1[/post] of thread "Estimating the impact of CO2 on global mean temperature"; in particular the LaTeX equation near the top, with the heading "The short form".

Here's what I see at present:
AutolinkBug.JPG


There's a lot of weird looking code sitting just above the table. I've looked at the html source, and the problem is that the LaTeX is an attempt to give a table, which includes as text the word "flux". The autolink system is adding an autolink to the library entry to the popup LaTeX code that goes with the image. This causes odd problems with quoting strings.

I'll see if I can reproduce the problem here:

Using the word flux:
\textrm{the flux is} \; 10 \; W/m^2​

Using the word flow:
\textrm{the flow is} \; 10 \; W/m^2​

Cheers -- sylas
 
Physics news on Phys.org
two solutions

sylas said:
… There's a lot of weird looking code sitting just above the table. I've looked at the html source, and the problem is that the LaTeX is an attempt to give a table, which includes as text the word "flux". The autolink system is adding an autolink to the library entry to the popup LaTeX code that goes with the image. This causes odd problems with quoting strings. …

Hi Sylas! :smile:

There's two ways of fixing it …

i] close the \textrm (btw, you can just type "\text" in PF :wink:) either immediately before "flux" (being careful to include the space before you close), or immediately after it, and reopen … that eliminates the space before, or after, "flux", so the autolink (which needs a space before and after) isn't activated

ii] gratuitously use " flux " before you get to the LaTeX … autolinking only works on the first appearance in each post.​

Here's two copies of your table, the first with the extra "\text", showing (I hope! :rolleyes:) no autolinking, and the second exactly as you posted it …

\begin{array}{lcll}<br /> \textrm{Energy balance} &amp; \approx 239 &amp; W/m^2 &amp; \textrm{(energy }\text{flux to, and from, space)} \\<br /> \textrm{CO2 forcing} &amp; 3.7 &amp; W/m^2/2xCO_2 &amp; \textrm{(change to balance per doubling)} \\<br /> \textrm{Current CO2 increase} &amp; 2 &amp; ppm/year \\<br /> \textrm{Current 2xCO2 per year} &amp; \log_2(1+2/385) = 0.0075 &amp; 2xCO_2 / year &amp; \textrm{(using 385ppm for current levels)} \\<br /> \textrm{Climate sensitivity} &amp; 3 \pm 1.5 &amp; K/2xCO_2 &amp; \textrm{(Temperature response for forcings, to restore balance)} \\<br /> \textrm{Temperature impact of CO2} &amp; 0.022 \pm 0.011 &amp; K/year &amp; \textrm{Estimated contribution of CO2 to current warming trends}\end{array}​
\begin{array}{lcll}<br /> \textrm{Energy balance} &amp; \approx 239 &amp; W/m^2 &amp; \textrm{(energy flux to, and from, space)} \\<br /> \textrm{CO2 forcing} &amp; 3.7 &amp; W/m^2/2xCO_2 &amp; \textrm{(change to balance per doubling)} \\<br /> \textrm{Current CO2 increase} &amp; 2 &amp; ppm/year \\<br /> \textrm{Current 2xCO2 per year} &amp; \log_2(1+2/385) = 0.0075 &amp; 2xCO_2 / year &amp; \textrm{(using 385ppm for current levels)} \\<br /> \textrm{Climate sensitivity} &amp; 3 \pm 1.5 &amp; K/2xCO_2 &amp; \textrm{(Temperature response for forcings, to restore balance)} \\<br /> \textrm{Temperature impact of CO2} &amp; 0.022 \pm 0.011 &amp; K/year &amp; \textrm{Estimated contribution of CO2 to current warming trends}\end{array}​

EDIT: Cool, it worked! :cool:
 
Last edited:


Thanks... that will work. I'll ask someone to fix it for me in the post.

If it is easy to fix, it may be worth altering the autolinking code to check that it is not munging html... something for chroot in his no doubt copious free time. :-p

Cheers -- sylas
 


sylas said:
Thanks... that will work. I'll ask someone to fix it for me in the post.

Done.
 


cristo said:
Done.

Wow. That was quick. Ta muchly!
 
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...
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...
Back
Top