Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backslash + nonletter bug #236

Closed
jakobkogler opened this issue Feb 2, 2018 · 3 comments
Closed

Backslash + nonletter bug #236

jakobkogler opened this issue Feb 2, 2018 · 3 comments
Assignees
Labels

Comments

@jakobkogler
Copy link
Member

The Markdown to HTML converter throws away any backslash, if it is not followed by letter.
This is quite annoying, since there are many cases in Latex where this would be useful. E.g. new line \\ and curly brackets \{\}.

The current workaround is to escape the backslash.

Example of not working code:

$$\begin{array}{cc}
1 & 2\\
3 & 4
\end{array}$$
$$\{1, 2, 3\}$$

Workaround:

$$\begin{array}{cc}
1 & 2\\\\
3 & 4
\end{array}$$
$$\\{1, 2, 3\\}$$
@RodionGork
Copy link
Member

RodionGork commented Feb 5, 2018

Thanks for creating an issue! I'll try to look at it!

UPD well, I just read and recollect that markdown uses backslashes as escape characters. It seems to understand that escapes are not needed before letters and hence these are really backslashes.

So what you show as "workaround" is really the correct way to insert backslashes in Markdown, though I understand it is not very handy. I'll see if there is some simple approach to disable escaping inside the formulas...

@algmyr
Copy link
Contributor

algmyr commented Oct 24, 2018

Pandoc does handle \\ and a host of other things "correctly". When playing around with pandoc to produce the pdf I also tried html, and it tends to work rather well: binary-exp (pandoc) binary-exp (current)

Style-wise it's a bit different and the header/footer is not there (custom html template would solve that). It could be something worth investigating.

@jakobkogler
Copy link
Member Author

@algmyr Yeah, I also tried it with pandoc before (as I wrote you once, I also compile articles offline all the time, although not into a big book). I even suggested it to @RodionGork once in a private conversation, since I was unhappy with the bugs. But his opinion was mostly, that it isn't much of a hassle currently, so why switch completely. And of course for some part he is right. Switching might give us other problems (e.g. implementing custom features, like the ```cpp snippet-name feature, would be more difficult, the test page would be more difficult to set up).

Although it could have some benefits. For one I would expect faster loading times. I'm not 100% sure how the system currently works, but I believe that every few minutes somebody opens a new page, the PHP program checks first if there is a newer version in the Github repo, and fetches the changes before showing you the page. This of course slows down loading the pages a lot (average loading time according to Google Analytics is 6.87 second!!!). A better solution would be, to just trigger Pandoc (or any other system) to compile the pages every time there is a new commit in the master branch, and just serve the html files regardless what.

Another alternative to Pandoc is mkdocs, which @Ir1d recently suggested. I played a few minutes with it, but it also worked pretty great. You can use it offline as an interactive web-server (it compiles and reloads each time you save a document), has a stable latex functionality (using plugins), can compile to html files, has a great integrated search using JavaScript (so that we don't rely on Yandex or a different search provider), is easy to modify, has a modern touch to it (Pandoc htmls or the current website have a very outdated feel to it), ...

In conclusion, I would like some changes, to make the site better, don't rely on bugs in the system, get a more modern design, faster loading times, ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants