Hacker News new | past | comments | ask | show | jobs | submit login
Markdown and LaTeX Editor (s2cms.ru)
172 points by ommunist on Aug 13, 2015 | hide | past | web | favorite | 61 comments



See also rMarkdown (http://rmarkdown.rstudio.com/) for Markdown supporting LaTeX (and bunch of other things) and its real-time editor editR (https://github.com/swarm-lab/editR).

Or for a longer list/discussion: https://hackpad.com/New-scientific-markup-language-utAjFcYuv... (it includes https://stackedit.io/).


+1 for RMarkdown and editR. The best thing about RMarkdown is the ability to do calculations in R and use those variables within LaTeX. A simple example:

  ```{r}
  a = 3
  b = 6
  c = a / b
  ```

  Did you know that $\frac{`r a`}{`r b`} = `r c`$?
http://i.imgur.com/IpiqDEx.png


You should check out http://orgmode.org as well - though I'm sure someone has mentioned it.

The best part is that you do these kind of:

    #+begin_src <lang> <options>
      some code
    #+end_src
Such that you can cross between R, python, C, whatever you want, and end up with a cohesive, executable document.


I quite like sagetex: http://doc.sagemath.org/html/en/tutorial/sagetex.html

A python like mathematica clone.


Softcover handles Markdown + embedded LaTeX on your local machine (no 'net connection required) using a standard text editor and web browser:

http://softcover.io/

I use Softcover to write and maintain both the code-heavy Ruby on Rails Tutorial (http://railstutorial.org/book) and the math-heavy Tau Manifesto (http://tauday.com/tau-manifesto). (Disclosure: I'm also the principal author of Softcover.)


I just watched your video and I think your tool is exactly what I'm looking for! Downloading it now.

In the meantime, I was wondering if you ever compose on your iPad? What is your workflow for that?


Using Softcover requires a standard shell & text editor, which I doubt is available on iPad. But it works great as a de facto second monitor, as described [here](http://manual.softcover.io/book/getting_started#sec-html_sof...).


Oh well, I was hoping I'd missed something. I'll just keep doing what I'm doing now -- write it in Evernote and then copy/paste when I get back to a computer.


I've found Simplenote on the iPad and Notational Velocity or nvALT on a Mac to be a really lightweight and quick workflow. Plus, there's the added benefit of it all being plain text, whereas Evernote always seems to make guesses about unwanted formatting for me.


Here's an iPad app that does Markdown + LaTeX: http://eqeditor.com/writer/ and then outputs HTML, ePub, etc. Not sure if it's exactly what you need but there you go.


Is the HTML generation with backlinks from an external lib or custom built for softcover? I'm working on a CMS and this would be fantastic to use as a module for writing articles.


Not sure exactly what you mean by "backlinks", but most of the software is custom-built.


ah. backlink = back references, Figure 1.1 and link to the Figure 1.1 :)

What your license for the project? If we wanted to use it, we'd porting it to Go and JS with our own stylized CSS.


Cross-references are all custom. License is MIT. [1] Porting would likely be a huge PITA.

[1]: http://github.com/softcover/softcover


That's seriously cool.

Had I had something like that some years ago, my workflow for both my BSc and my MSc thesis would have been quite different.


I'm curious as to the percentage of users here that use Markdown regularly? I'm one of the founders of Overleaf, and we've found that our users tend to either want to be able to edit in full LaTeX or want to avoid the need to code even in markdown (hence the reason we built a rich text layer for overleaf[1])

If you do use Markdown regularly, how often does it allow you to do everything you need (i.e. how often do you have to switch to something else)?

Feedback appreciated, thanks.

[1] https://www.overleaf.com/blog/81


When it comes to Markdown its main advantage is not its features (it does not have many), but its simplicity (and ability to edit it in a text editor - blazing fast, no distractions, etc). And then I can convert it to anything.

Vs LaTeX - sometimes I need just to note (a to do list, a draft of a blog post, an outline of workshop), without the boilerplate or visual noise of LaTeX.

(And I wrote more than a dozen of papers in LaTeX - so mine argument isn't "LaTeX is too hard".)

That said, I enjoyed using Overleaf - but mainly for teaching LaTeX (no installation, very nice and readable error messages, nice examples (I use your default page as the first introduction)). But for anything longer it's a pain that everything needs to recompile every few keystrokes (especially on a slow connection); I know it's not you but LaTeX; but for the same reason sometimes (when not requiring full features of LaTeX) it's easier to use Markdown + MathJaX.


That's a good summary, and the ability to easily convert to e.g. html is definitely a plus point for markdown. I always find however that I'd rather either work in html (for any web content), LaTeX (for any research papers or lengthy docs) or plain text (for notes)... I never found markdown quite useful enough in any of those cases (it has been a while since I last gave it a serious test though).


GitHub README.md files are a nice example for use case.

It is a text file, but which can use lists, code inclusions, links and images (the later are not available in text mode... unless you want to do ASCII art).

When it comes to notes opinion vary. Some use Markdown (BTW: for notes I only keep them in the plain text mode - so the only difference is some highlighting), some org-mode, some various other tools.


Your plain text notes are actually in Markdown already. :)


I'm another Markdown regular. It's my preferred markup language for online sites (Reddit, StackExchange, Elllo), and the results with only modest site styling are quite impressive (Ello looks _markedly_ better with modified CSS). Sites _without_ Markdown (such as HN) drive me nuts as I'm always tossing in Markdown code and realising (after the edit window's expired) that I effed up....

I've used vi/vim since the late 1980s, it's drilled into my finger-memory (I'm composing it now in an external editor).

I also know HTML and LaTeX (having picked up the latter fairly recently), and have used a few other markup languages (nroff/groff, DocBook, etc.).

What's great about Markdown is that it's close to a 99% solution. I'm usually authoring into HTM or PDF, and if necessary, I'll generate HTML or LaTeX and finish up with either for detail work. With a full-featured Markdown parser though, there's little that cannot be accomplished, short of equations. Online implementations have various annoying omissions -- Reddit doesn't support images or subscripts, Ello lacks blockquotes. Neither has footnotes. Otherwise, it's fairly complete.

While LaTeX is actually pretty lightweight for prose (once I grokked it, surprisingly so), Markdown's lighter. And not having to pair up open/close tags makes it much lighter-weight than HTML.


I'm always tossing in Markdown code and realising (after the edit window's expired) that I effed up

QED.

And I knew I was doing it as I wrote it, forgot to clean it up.

Sigh.

What I'd really prefer is that sites simply said "hey, what's your preferred markup language" and offered the choice....


I love TeX and LaTex. I've been using TeX even before LaTeX was available. However, I barely use it any more and write most documents in Markdown.

To turn your question upside down, the reason I don't use TeX and LaTeX any more (despite being quite invested in it) is that I rarely care about the quality of output any more. I'm more interested in the text editor representation.

For the types of documents I write (about software, very rarely doing any math) Markdown's syntax is just simpler and quicker. It produces readable HTML output with code syntax highlighting. That's all I want.

If I need to typeset something, I will go back to TeX/LaTeX. I'm afraid, though, that I'm not a good fit for overleaf as I am already invested in the concept of splitting composition from presentation. When I am writing, I specifically don't care about (and would rather not have) anything showing me what the final output is going to look like.

Typesetting is a completely different process for me. Once I have a good portion of the document written (sometimes all of it), then I will start looking at presentation. I'm also one of the crazy people who writes his own styles in TeX ;-)

What's interesting is that the last time I used LaTeX, I actually wrote my own markup language (similar to markdown) and had a build step that would convert it to LaTeX. This was because I was doing a lot of writing with very weird formatting (non-standard output of furigana in Japanese where I displayed both the Chinese characters, the Japanese reading of the characters, and the romanization of that reading). Doing that with TeX macros would have worn my fingers off.

So I suppose to sum up, since I don't need precise typesetting in most of my documents, Markdown is "good enough" and it is easier to type. When I do need precise typesetting, TeX/LaTeX is what I go for, but even then I would rather write in a markdown style DSL and translate to TeX which I can output. As much as I love TeX, it really does suck compared to any modern macro language. LaTeX gives a semi-nice veneer, but it still isn't optimal. Pushing it off to one side is how I cope ;-)


I taught myself LaTeX to be able to write academic papers. It was invaluable in teaching me about a large part of the document processing ecosystem I knew nothing about and made me appreciate that WYSIWYG was a step backwards to some degree.

Strangely enough though for the current paper I have to write (> 20,000 but < 40,000 words) I have decided to see how far I can get with Markdown, Pandoc, and a lightweight custom pipeline. I'm going on a hunch but I have the feeling that this will work out ok. I may be wrong. Pandoc will auto-gen a table of contents from the Markdown headers. I'm going to try and grab citations straight from Zotero. AnnotateJS will give me endnotes but also allow others to make annotations and I should be able to generate HTML5+RDFa for semantic annotation. And yes, PDF because the university requires it -- I think I'll be able to go to PDF via LaTeX with Pandoc. Markdown does blockquotes too. I don't need complex Math, but I will need notation for propositional/predicate calculus. There really aren't that many _elements_ in an academic paper when you break it down to its constituent components and Markdown+extensions seems to have it all covered.

Pollen, which featured here recently, looks interesting too and I'm going to investigate that.

Edit: I've used Overleaf (and love it!) and even demo'd it to others and I think it's a great product. Scrivener is doing interesting things as well.


Firstly, thanks for helping spread the word about Overleaf, that's much appreciated! If you're still demoing with it, feel free to join our Advisors programme [1] (it comes with a free Pro+ account amongst other things!)

Be very interested to hear how you get on with your current paper -- it is one you're working on independently or do you have co-authors? If it's the latter, do you have a workflow for handling the collaboration?

Thanks also for the note about Pollen, will take a look at it in the morning!

[1] https://www.overleaf.com/advisors


I should be thanking you. The issue we have is that science-type students have no problem working with LaTeX. Our humanities students on the other hand will use MS Word which as we all know is completely suboptimal for creating long structured documents with lists of tables, figures, and so on.

We've found that by importing our university branded template into Overleaf and getting to our humanities students to think about their work as a structured document we can try to transition them away from MS Word. Unfortunately I think all bar two kept their old workflow.

Do check out the video by Pollen creator and typography nerd "(fourth RacketCon): Matthew Butterick — Like a Blind Squirrel in a Ferrari" linked from http://pollenpub.com/ His argument is that LaTeX has hindered innovation because it is so good. He gives his reasons for re-inventing the wheel with a Racket DSL. In the end we may realise the errors of our ways and come crawling back to LaTeX :)


    is completely suboptimal for creating long structured documents
I actually saw many science students work very well with MS Word. They knew how to use it and liked it, whereas I completely despised it as I was never able to fit an image properly for example. To me, LaTeX seemed completely logical and superior to MS Word, but I have seen long documents typeset using Word also.

The people who liked MS Word had no programming knowledge, if that's an indicator ;)


I have a content platform (medical app) where our clients create or upload a significant percentage of the content.

Although markdown has its limitations, as well as a barrier to entry for the non-technical user, it enables us to make sure our content is uniform in appearance with minimal style guides. A good markdown table editor would be a real winner, and some f the better open source editors don't have a consistent set of features, so it is often s bit of a trade off determining what is best.


> A good markdown table editor would be a real winner

All I want is markdown with orgmode tables. Never gotten around to do it myself, but how hard can it be? I really have to wonder about why the Web2.0+ crowd think tables should never be used for anything, especially not by content editors.


Yes, I can see where markdown is a good middle ground for that type of regular, consistent content. Out of curiosity, did you have to set up templates for the content to help the non-technical users, or was a markdown tutorial enough?


We provide them with a PDF introduction doc when we acquire new clients or they wish to have new authors added which has the essentials, explaining what it is and why. Our editor also has hyperlinks which insert tags for headings (two options), bold, lists and links etc. So far it's been well received, although we are continually looking to tweak


I use it very regular at work to document projects we are developing or to document software/practices at work. For my personal blog it is also my preferred syntax to edit articles. It is easy and very quick to pick-up.

I seldom need to switch to something else or it should be to design diagrams or imagery. Even code - using extensions to highlight stuff - works relatively well. The only thing I dislike is the table stuff which for me always involves some fiddling.

But to be perfectly honest I'm also thinking of looking into latex. I also use pandoc to convert my markdown files to PDF which uses latex templates if I’m not mistaken. For me personally it works and looks great but the company has invested a lot of resources in branding and creating some-kind of corporate identity.

So now they want all the documentation including the fancy headers/footers and I think the only way of inserting it with pandoc involves creating a latex template and using the fancyhdr (off the top of my head so I could be wrong) package. Definitely something that I need to look into.


I used Overleaf to write my most recent paper, as it is incredibly useful for collaborating on documents. I think the coauthor was similarly impressed. I've never used Markdown (in fact this is the first I've heard of it) and always write in full Latex. There are a lot of equations involved, and I like to use some of the fine control that Latex gives you over the formatting. Plus, everyone in my field is expected to know Latex.


I'm writing my PhD dissertation in Markdown. It's killer feature (for me) is that a) it converts to a plethora of different formats (including Latex and Word) via Pandoc, b) it works well with version control, and c) Pandoc filters let me do an almost unlimited amount of automated preprocessing on the document with simple scripting.


I use markdown regularly for writing documentation. I've decided to never touch LaTeX as long as I can until someone writes an implementation with non-useless error messages.


I have the same setup in atom using Markdown Preview Plus (https://atom.io/packages/markdown-preview-plus)

Works amazing and is offline, I highly recommend it.


This webpage on whatever backwoods Russian server he is using seems a lot snappier though...


Atom is too slow. I use sublime text with markdown preview.


I personally use Emacs with markdown-mode. I don't need the preview, really; the whole point of Markdown is to be readable in and of itself.


There's always C-c C-c p anyway.


I have been using https://stackedit.io/ a lot for Markdown editing and have loved it's simple and straightforward preview interface.

For LaTeX, I've used https://www.overleaf.com/ till now.

From my initial interactions with this editor, it just might prove to be a single replacement for both the above sites!


I'm quite amazed at how responsive it feels compared to sharelatex or the likes. It's extremely simple. I like it. I may not use it myself, but I'll mention it to friends who are learning LaTeX.


I run the ShareLaTeX open-source version and it renders a PDF each time I want to see the changes I made. With ShareLaTeX I can exactly see how the end product will look, something you can't do with this app. It's much less responsive, but having a PDF is a bigger advantage to me.


Does this use mathjax? It doesn't seem to send my CPU into a whirlwind when typing latex as mathjax sometimes does (although I didn't test it for very long). I enjoy that there's more of a pause between typing the latex and seeing the updated version. I hate how some sites bounce up and down due to formatting on every keyup when editing latex.


Looks like it compiles the Markdown locally but for LaTeX it sends each source snippet to their server to compile: http://tex.s2cms.ru


It appears to be (realtime) server rendered svg.


If you haven't seen it yet ProseMirror is a hopefully to be open-sourced CommonMark editor. I'm sure LaTeX support could be added as a module.

https://www.indiegogo.com/projects/prosemirror


I really like it! It seems lightweight, and editing is almost instant.

What i'm not quite sure is what is the subset of available latex commands? Can you use only math formulas or there is also something else?


The most of "standard" latex features and some packages. You can find details here: https://tex.s2cms.com/


Thanks Roman, this is very nicely done. I wonder what software are you running on the back-end that copes with HN's traffic so casually?


Nginx + php-fpm + TeX Live. But the key feature is the caching system: once a formula has been rendered, it is served by nginx as a regular static file.


What about writing in a WYSIWYG, and get a LaTeX document and a markdown document?

http://www.escherpad.com/signup


Does this also do a subset of LaTeX, or is it the whole thing?


Please don't downvote comments like this. I found this to be a very helpful comment that contributed to the discussion, and found a neat editor in the process.

Thanks for sharing geyang, sorry for the downvoters, HN has a problem with downvoting (not the least of which is the inability to undo downvotes).


The real url where the latex rendering takes place seems to be here: http://tex.s2cms.ru/

The link that was submitted has an editor that detects latex formulas, send them to the link I mentioned earlier, get back an svg and insert it on the page.


Very curious as to why this so much more responsive than overleaf and sharelatex. Anyone?


I'd guess that the rendering is done client side here and can be done with partial updates. ShareLaTeX and Overleaf have to do a full LaTeX pass on the server just to show the change of a small part of the document.


Is there a good js library available for LaTeX markdown that can be integrated with others markdown libraries? I'm working on http://www.faqt.co and would love to add LaTeX support.


Try either MathJax or KaTeX from Khan Academy


Markdown + LaTeX editors that I have personally used (and recommend)

https://stackedit.io/

Atom editor + markdown preview with Katex

iPython notebook with mathjax


I would love something similar for reST or ascii doc




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: