If LW would suddenly change so that math could be saved for reading at a later time when I’m not connected to the internet, the amount thinking I do about math would probably suddenly triple.
Details: the main way I save text from web for reading at a later time is by copying a part of the web page, then pasting into a file on my local machine. That does not work for most text containing math.
If LW would suddenly change so that math could be saved for reading at a later time when I’m not connected to the internet, the amount thinking I do about math would probably suddenly triple.
The way the static approach on GreaterWrong & gwern.net works is that the original LaTeX is stored alongside the CSS/font/HTML stuff you actually see. Then when you copy-paste, instead of getting a bunch of gibberish letters sans formatting, a little bit of Javascript swaps out the gibberish for the accompanying LaTeX.
So for example, if I go to a random recent page with LaTeX in it, like https://www.greaterwrong.com/posts/wR8CFTasFpfCQZKKn/if-influence-functions-are-not-approximating-leave-one-out , and I copy-paste the first complicated-yet-abstractly-beautiful math expression, I get: LOO(\hat x,\hat y) = \text{argmin}_\theta \frac 1 N\sum_{(x,y)\sim D-\{(\hat x,\hat y)\}}L(f_\theta(x),y) in my Emacs text buffer. This is what the author originally wrote, so it’s as lossless as it gets, and if you are able to understand what it means, you presumably already know how to read the LaTeX version, and your text editor can render it or whatever else you need to do with it. I haven’t seen any better solutions.
(Whereas for OP, written in MathML, I get e−7t on LW, and Equation on GW. Hypothetically, they could try to decompile or interpret it as LaTeX, but needless to say, they do not. And even if they copy-pasted it as MathML—what destination programs would support MathML? Very few, I imagine.)
I can’t replicate this with my Ubuntu Linux/MATE/Firefox/Emacs setup. I get the whole equation no matter how I copy it.
(Note that there is one catch to the JS copy-paste listener: confusingly to contemporary users, X.org has multiple copy-paste buffers, ‘primary’ / ‘secondary’ / ‘copypaste’, of which browsers will apparently only allow web page JS to affect the first one. Since the browser doesn’t cooperate, this cannot be fixed by the webpage. So if you copy-paste in X.org, depending on how you do it, you may get the intended P(xi)=<xi,v> or you may get that newline-after-every-character version that jefftk quotes. If you are unsure what is going on, you can investigate using the xclip utility, like xclip -o -selection copypaste vs xclip -o -selection primary.)
Which version of Chrome, please? (You can find this out by putting chrome://version into your URL bar.)
5 other instances of LaTex (some paragraph equations, some not) on 3 other posts work.
Hmm, so it is just that one specific post, and the equations in that one post copy-paste incorrectly, while the equations in every other post you’ve tried copy-paste correctly? Is that right?
Great! My being given some way to obtain the original LaTeX as written by the author is the solution I have been tending to imagine over the years when I imagined what might be the best realistically-achievable way to change LW to accommodate my current workflow!
Thanks for pointing it out!
BTW, I’d like to learn more about the workflows of people who work with math all day every day.
I’ve been pasting into Emacs. If you’re a Linux user, I would be interested to know what program you paste math into. Or if the thing you paste into “uses web tech” (and consequently is independent of OS), tell me which web site or program it is.
If LW would suddenly change so that math could be saved for reading at a later time when I’m not connected to the internet, the amount thinking I do about math would probably suddenly triple.
Details: the main way I save text from web for reading at a later time is by copying a part of the web page, then pasting into a file on my local machine. That does not work for most text containing math.
The way the static approach on GreaterWrong & gwern.net works is that the original LaTeX is stored alongside the CSS/font/HTML stuff you actually see. Then when you copy-paste, instead of getting a bunch of gibberish letters sans formatting, a little bit of Javascript swaps out the gibberish for the accompanying LaTeX.
So for example, if I go to a random recent page with LaTeX in it, like https://www.greaterwrong.com/posts/wR8CFTasFpfCQZKKn/if-influence-functions-are-not-approximating-leave-one-out , and I copy-paste the first complicated-yet-abstractly-beautiful math expression, I get:
LOO(\hat x,\hat y) = \text{argmin}_\theta \frac 1 N\sum_{(x,y)\sim D-\{(\hat x,\hat y)\}}L(f_\theta(x),y)
in my Emacs text buffer. This is what the author originally wrote, so it’s as lossless as it gets, and if you are able to understand what it means, you presumably already know how to read the LaTeX version, and your text editor can render it or whatever else you need to do with it. I haven’t seen any better solutions.(Whereas for OP, written in MathML, I get
e−7t
on LW, andEquation
on GW. Hypothetically, they could try to decompile or interpret it as LaTeX, but needless to say, they do not. And even if they copy-pasted it as MathML—what destination programs would support MathML? Very few, I imagine.)There is a bug in GW around the functionality you describe: navigate to an article posted today, namely,
https://www.lesswrong.com/posts/JCgs7jGEvritqFLfR/evaluating-hidden-directions-on-the-utility-dataset
Then use the mouse to select the equation that occurs right after “the projection (aka the scalar product)”
When you paste that equation (I tried 2 programs, Emacs and gnome-text-editor, as the destination of the paste operation), you get
P(x_i) =
--with the right-hand side of the equation completely missing.
I can’t replicate this with my Ubuntu Linux/MATE/Firefox/Emacs setup. I get the whole equation no matter how I copy it.
(Note that there is one catch to the JS copy-paste listener: confusingly to contemporary users, X.org has multiple copy-paste buffers, ‘primary’ / ‘secondary’ / ‘copypaste’, of which browsers will apparently only allow web page JS to affect the first one. Since the browser doesn’t cooperate, this cannot be fixed by the webpage. So if you copy-paste in X.org, depending on how you do it, you may get the intended
P(xi)=<xi,v>
or you may get that newline-after-every-character version that jefftk quotes. If you are unsure what is going on, you can investigate using thexclip
utility, likexclip -o -selection copypaste
vsxclip -o -selection primary
.)Hmm, I can’t replicate this bug on GreaterWrong. Could you please say what browser/version/platform you are using?
Also, do other equations on other posts work?
Chrome downloaded from Google, running on Fedora 38 using the standard graphical environment (Gnome on Wayland).
Firefox works correctly.
>Also, do other equations on other posts work?
5 other instances of LaTex (some paragraph equations, some not) on 3 other posts work.
Which version of Chrome, please? (You can find this out by putting
chrome://version
into your URL bar.)Hmm, so it is just that one specific post, and the equations in that one post copy-paste incorrectly, while the equations in every other post you’ve tried copy-paste correctly? Is that right?
Chrome reports as 117.0.5938.92 (Official Build) (64-bit).
I already described the problem with the first paragraph equation (display equation) on the page.
The second paragraph equation, which can be located by searching for “log-likelihood”, also has the problem. In particular, it copies as
\text{PPL}(X) = \exp\left(-\frac{1}{n}\sum_i^n \log p_\theta(x_i|x_{
The third one, locatable via “concept vector v”, works correctly:
P_{\perp}(x_i) = x_i - \frac{}{||v||^2}v\,.
There is no fourth paragraph equation on the page.
Let me know if you want me to continue to search for instances of the bug, on other pages.
Alright, thank you.
I’ll try to figure out what might be causing this, though I can’t promise it’ll be soon, unfortunately.
Copying that equation from LW with Chrome on Mac, anything I paste it into (pbpaste, standard website, Google Docs) I get:
But when I use the GW version I get:
P(x_i) = <x_i, v>
Did you mean to link to the LW version of the post?
Great! My being given some way to obtain the original LaTeX as written by the author is the solution I have been tending to imagine over the years when I imagined what might be the best realistically-achievable way to change LW to accommodate my current workflow!
Thanks for pointing it out!
BTW, I’d like to learn more about the workflows of people who work with math all day every day.
MathML should copy fine, as long as the destination program supports it. What program are you pasting it into?
I’ve been pasting into Emacs. If you’re a Linux user, I would be interested to know what program you paste math into. Or if the thing you paste into “uses web tech” (and consequently is independent of OS), tell me which web site or program it is.
After shooting my mouth off I went and tried it, and even programs that I would expect to handle it well (ex: Google Docs) didn’t. Sorry!
(I think my statement is still literally true, except for the problem that ~no destination program currently supports it)