-
-
Notifications
You must be signed in to change notification settings - Fork 97
Conversation
What happens if you don't use raw strings? Just curious.
|
What do you mean if I don't use raw strings? I put raw so that I can write normal LaTeX instead of doubling all slashes. |
What I mean is that maybe that could affect whitespace handling as well. I |
Made doctests pass! Also, we are going to make use of proper HTML processing in http://trac.sagemath.org/ticket/19097 and it would be fantastic to have it in 6.10 ;-) |
Wow - it looks like this change also fixed a recurring problem from long ago which was actually quite annoying - if you click to the left of output from a formula in the current notebook (e.g. because you followed traceback directions), everything disappears (and frightens the student, especially on exams). With this commit you will see latex code which may scare uninitiated as well, but at least not like "nothing works!" Please-please-please add it to the next release! |
Whaddya think the timeline for Sage 6.10 would be? I can't try this for
at least a couple weeks but I agree there are a few things that we should
get in.
|
I imagine a couple months, so a couple of weeks is not at all a problem. |
By the way, SageNB has its own "math catcher" that looks for $ and replaces them with script tags. Which means a) we do ourselves MathJax job for no good reason, potentially not handling some corner cases (I definitely had issues with using $, even escaped, in doc strings) and b) the code that one could copy-paste from the browser is not LaTeX anymore, also for no good reason. I've tried to remove it, but got stuck and I think this pre wrapping was the issue. Once it is approved, will try again removing our |
Okay, I'm ready to start working on this! Any updates you need or know about on this? |
Not really - the ticket mentioned has been positively reviewed (I've switched it to needs work till SageNB is upgraded) and has a printout showing some advantages of the changes. |
This pull request seems to work properly. Can you give me an explicit example of the other thing you said it fixed about clicking on the left? I tried a few things but they didn't work any differently than before. |
Switch a worksheet to "Typeset" with a check box. Enter "matrix(3)" to see a nicely typeset version of it. Click once to the left of the output: it disappears. With the change here you will see the latex code of it, so no impression that "it just does not work at all". As always refreshing the browser cache may be necessary. |
I don't see this behavior disappearing. It behaves the same in both of them. Even in a browser I didn't use before for this worksheet! And now I understand what you meant by that comment. |
Interesting. I saw it in Firefox/Iceweasel on Debian Jessie in case it is relevant. In any case my main point here is to stop pre-wrapping because it makes sense and will be consistent across different interfaces and that hopefully you can replicate ;-) |
So - any objections to getting it in?.. |
No, I was hoping to get @gutow 's in first so he doesn't have to rebase yet again... but I guess maybe that isn't happening, which would be understandable given the time of year. |
Sorry folks, I am really swamped at the moment. I might get to look at things over Thanksgiving break, but the reality is probably not until the holidays or our January short term. Jonathan
Chemistry Department gutow@uwosh.edu mailto:gutow@uwosh.edu |
Okay, thanks for that update! |
Do not wrap HTML output in <pre>
Thank you!!! |
@novoselt the Trac ticket is now 'needs review' if you wish to review it... it will need testing in 'real life' before it gets into 6.10, assuming it would get into a beta of that. |
Currently HTML from html command is inserted into a
<pre>
block which means that you actually don't see real HTML output corresponding to your code. It also leads to extra dances for MathJax, we have our own parser for $ that replaces them with<script>
tags. And I could not figure out how to turn on processing of environments. (My use case here: output a sequence "explanation formula explanation formula ..." which works way better in MathJax and LaTeX if each formula is a separate formula, rather than combining everything into a single math object.)The change here is to wrap into
<pre>
every block which is NOT html - then we mostly have old behaviour, but HTML processing is now sensible and consistent with cell and cloud interfaces. (In particular, math environments are processed.)Attaching sample output for before and after.
![before](https://cloud.githubusercontent.com/assets/1993227/10325735/518bca54-6c51-11e5-862f-b196814a15a8.png)
![after](https://cloud.githubusercontent.com/assets/1993227/10325737/575b4c7a-6c51-11e5-9823-884dea06f2d1.png)