typora / typora-issues

Bugs, suggestions or free discussions about the minimal markdown editor — Typora
https://typora.io
1.53k stars 56 forks source link

Line break before / after math block #1107

Open chipbrock opened 6 years ago

chipbrock commented 6 years ago

I really enjoy typora... I'm actually writing a textbook using it. But there's one issue that's really annoying and has been evident since day one on the mac.

If I want to add a numbered or display equation, I should be able to hit return at the end of a paragraph [that creates a line feed in the viewer], type the $$ and return, fill in the equation in the nice tool, and then exit. That produces a rendering that looks like the following:

previous paragraph line space equation 2 line spaces <--- ? next paragraph

in the source view it becomes:

All three natural motions just happened...um, naturally. $$ E=mc^2 $$ (space) (space) Unnatural motion was different. It required a pusher...an active force that was in

This is verbatim: those spaces are visible in the source view and there is no space before the first $$, not what's seen in the viewer which looks to have one space above the equation (like it should be rendered in a web browser) and two or three spaces (not clear) after the equation.

In a browser, the equation actually is in line! Not display!

In order to get the equation to be properly positioned as a display equation, I must do something unnatural:

I must hit another carriage return in the viewer - which translates into MANY spaces now in the source view. Like this:

All three natural motions just happened...um, naturally. (space) (space) $$ E=mc^2 $$ (space) (space) Unnatural motion was different. It required a pusher...an active force that was in

This is a huge amount of white space in the viewer, which is attached.

Only then does it work properly

screenshot_935

in a browser.

This doesn't make sense. If one is triggering the equation tool with the $$ it's clear that the plan is a display equation and typora should insert all of the necessary blank lines - AND NO MORE - in order to accomplish that goal.

It seems silly, but it's annoying and makes the nice viewer not reflect html reality.

thanks Ray

abnerlee commented 6 years ago

duplicate with https://github.com/typora/typora-issues/issues/779

abnerlee commented 6 years ago

Is the expected output look like

All three natural motions just happened...um, naturally. (space) (space) $$ E=mc^2 $$ (space) (space) Unnatural motion was different. It required a pusher...an active force that was in

In a browser, the equation actually is in line! Not display!

You mean export to HTML, then open it in browser it will become inline math?

chipbrock commented 6 years ago

Yes. That’s what I mean. I’ve attached 3 screen shots of the browser rendering, the typora window, and the typora source view.

Ray [cid:5528F499-23AF-429A-8685-E473848F7BD2][cid:3E70F4F7-1D5A-46F7-BFB9-58B1D9F5B120][cid:EB8E13D0-4161-4D29-857A-07269F2CD587]

On Jan 19, 2018, at 11:21 AM, AbnerLee notifications@github.com<mailto:notifications@github.com> wrote:

Is the expected output look like

All three natural motions just happened...um, naturally. (space) (space) $$ E=mc^2 $$ (space) (space) Unnatural motion was different. It required a pusher...an active force that was in

In a browser, the equation actually is in line! Not display!

You mean export to HTML, then open it in browser it will become inline math?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/typora/typora-issues/issues/1107#issuecomment-359015151, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AETlzdXyCgPFF_j5QuxoujllGy3G4I-6ks5tMMEcgaJpZM4REeyb.


Raymond Brock University Distinguished Professor Department of Physics and Astronomy 3210 BPS Building Michigan State University East Lansing, MI 48824 sent from: raymond.brock@gmail.commailto:raymond.brock@gmail.com brock@pa.msu.edumailto:brock@pa.msu.edu

MSU office: (517)353-1693/884-5579 open fax: (517)355-6661 secure fax: (517)351-0688 Vidyo personal room: http://goo.gl/AgiDJ4 CERN Office: 32 2-B03 * 76-71756

Twitter: @chipbrock Home: http://www.pa.msu.edu/~brock/ ISP220: http://www.pa.msu.edu/courses/ISP220/ ISP213H: http://www.pa.msu.edu/courses/2007spring/ISP213H/ Facebook: http://msu.facebook.com/profile.php?id=2312233

abnerlee commented 6 years ago

In a browser, the equation actually is in line! Not display!

You mean export to HTML using Typora, then open it in browser it will become inline math?

chipbrock commented 6 years ago

Oh. Sorry. No, I process the saved markdown in a Jekyll machine to produce the html.

The problem is at least in part the lack of space between the end of the text and the beginning of the $$ as it appears in the Typora course rendering. It shows:

words words words. $$ E=mc^2 $$ words words words

It should be:

words words words.

$$ E=mc^2 $$

words words words

Then there's too much whitespace in the Typora actual rendering (more than it would type set) and yet I have to add even more space in the regular typing in order to force the actual markdown to be correct.

Sorry for the confusion. It’s basically markdown output that is my Typora deliverable.

Ray

On Jan 20, 2018, at 10:43 PM, AbnerLee notifications@github.com<mailto:notifications@github.com> wrote:

In a browser, the equation actually is in line! Not display!

You mean export to HTML using Typora, then open it in browser it will become inline math?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/typora/typora-issues/issues/1107#issuecomment-359221529, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AETlzT-4PCcv3_s84f363c3R4WZn3K_Iks5tMrJ9gaJpZM4REeyb.


Raymond Brock University Distinguished Professor Department of Physics and Astronomy 3210 BPS Building Michigan State University East Lansing, MI 48824 sent from: raymond.brock@gmail.commailto:raymond.brock@gmail.com brock@pa.msu.edumailto:brock@pa.msu.edu

MSU office: (517)353-1693/884-5579 open fax: (517)355-6661 secure fax: (517)351-0688 Vidyo personal room: http://goo.gl/AgiDJ4 CERN Office: 32 2-B03 * 76-71756

Twitter: @chipbrock Home: http://www.pa.msu.edu/~brock/ ISP220: http://www.pa.msu.edu/courses/ISP220/ ISP213H: http://www.pa.msu.edu/courses/2007spring/ISP213H/ Facebook: http://msu.facebook.com/profile.php?id=2312233

chipbrock commented 6 years ago

Any progress on this?

noxware commented 4 years ago

I'm having the same problem. Any progress on this?

skriptum commented 1 year ago

any update on this?