Live data from Hacker News

Reach for Markdown, not LaTeX

blog.jez.io

111–120 of 184 posts

Re: Reach for Markdown, not LaTeX

#111

Pandoc is really awesome. Even mathematics papers can be written in (mostly) markdown, and then converted to latex before compiling to PDF. For mathematics I would also recommend using Unicode symbols in place of LaTeX commands, which makes the source even more readable. For instance $∏_{x∈X} ∑_{y∈Y} Ψ(x,y) → ∑_{f : X → Y} ∏_{x∈Y} Ψ(x,y)$ instead of $\prod_{x \in X} \sum_{y \in Y} \Psi(x,y) \to \sum_{f : X \to Y} \pr…

But you can type the second one way easier

Not really! I use an XCompose file derived from the Plan 9 keyboard setup. So to write ∏ i press my modifer (left shift) button once, and then 'p' followed by 'r'. So it is fewer key presses than \prod (three key presses vs five).

I have similar shortcuts for all maths symbols I use regularly. Here is an excerp from the configuration

2200 fa ∀ for all

2202 pd ∂ partial differential

2203 te ∃ there exists

2205 es ∅ empty set

2206 De ∆ increment

2207 gr ∇ nabla

2208 mo ∈ element of

(…)

220E qed ∎ tombstone

The last one is most sattisfying to type !

Re: Reach for Markdown, not LaTeX

#113

Earlier quoted context omitted.

Many flavors of Markdown support math extensions. Many do so in a way that degrades gracefully when the extended Markdown is opened in a standard Markdown tool. Typora is a great WYSIWYG Markdown editor that uses MathJax to render LaTeX mathematical expressions.

The problem is, if you do a lot of formula writing in a narrative, most WYSIWYG editors that support LaTeX formula rendering are just not efficient. I want to type my thoughts, start a formula block, write my expression, end the block, and continue going. You can't do that in most WYSIWYG editors.

You can definitely do that in Typora (unless I miss something what exactly you meant).

Re: Reach for Markdown, not LaTeX

#114

Pandoc is really awesome. Even mathematics papers can be written in (mostly) markdown, and then converted to latex before compiling to PDF. For mathematics I would also recommend using Unicode symbols in place of LaTeX commands, which makes the source even more readable. For instance $∏_{x∈X} ∑_{y∈Y} Ψ(x,y) → ∑_{f : X → Y} ∏_{x∈Y} Ψ(x,y)$ instead of $\prod_{x \in X} \sum_{y \in Y} \Psi(x,y) \to \sum_{f : X \to Y} \pr…

But you can type the second one way easier

There's a very simple emacs extension called "pretty lambda", which displays a word "lambda" as a lambda character (but presents as ascii still). I wonder if something like this is possible to do here (of course, the syntax with arguments makes it harder).

Re: Reach for Markdown, not LaTeX

#115
post #29

Earlier quoted context omitted.

From my (limited) experience of writing a documentation page for a library I made, Markdown is pretty limited (speaking of CommonMark here). Even basic things like table or image need HTML to be done. The gain in syntax is lost on the coherence side as the document mixes two languages, and an additional step of processing the document is required to transform it in full HTML. It have it use cases but writing long and…

CommonMark _does_ support images: http://spec.commonmark.org/0.27/#images Some other, non-standard variants of Markdown also handle tables via a syntax which resembles ASCII art. And while that format does do an excellent job of adhering to Markdown's ethos of remaining readable in plain text; I usually prefer to use HTML fallback anyway as it's easier to maintain.

The most commonly used Markdown variants (Github, So, Reddit, probably Slack) support tables, they've been in use for years and work well. I can't believe Commonmark can't just standardise what's already being used by the majority of users.

Some of the suggestions in the discussion thread[0] don't pay any attention to this, and if they agree on something that nobody uses it'll just be ignored.

[0] https://talk.commonmark.org/t/tables-in-pure-markdown/81/29

Re: Reach for Markdown, not LaTeX

#116
post #114

Earlier quoted context omitted.

But you can type the second one way easier

There's a very simple emacs extension called "pretty lambda", which displays a word "lambda" as a lambda character (but presents as ascii still). I wonder if something like this is possible to do here (of course, the syntax with arguments makes it harder).

Using XCompose (see sibling post) has the advantage of working in all programs on X, and producing real unicode.

Re: Reach for Markdown, not LaTeX

#117

Earlier quoted context omitted.

LaTeX in my experience, is worse than markdown for one crucial use case: formatting code. Formatting large blocks of monospaced text (especially monospaced text that includes character sequences that can be interpreted as LaTeX commands) has always been kind of a chore. In markdown, on the other hand, it's as simple as enclosing the text between two sets of triple-backticks (```).

\usepackage{listings} \begin{lstlisting} your code here \end{lstlisting} That's not much harder, is it? Plus, it has a ton of other functionalities you might want.

Now add syntax highlighting. In Markdown, it's trivial (```language-name), in LaTeX, you're going to have to define a style. LaTeX is more flexible, but it does come at a cost.

Re: Reach for Markdown, not LaTeX

#118

Earlier quoted context omitted.

You seem to be well over half-way to LaTeX there, so what's the point in using markdown? If the verbosity of writing \begin{description} ... \item[basis]... \end{description} is the issue, you can get around that with a couple of shorthand macros.

I wrote my math phd thesis in Markdown/LaTeX in this way. I also replaced all maths symbols with their Unicode equivalent. The result was very readable markdown source text, easily compiled to Latex and PDF, using a mk file. My thesis also included formalised proofs in a proof assistant, and they were just written straight into the markdown files as code blocks, and were using the same Unicode symbols as the rest. La…

I wrote mine in plain LaTeX, never had an issue with it. Regarding code, you can use the listings package (\lstincludelisting) to include source code files directly. I fail to see the interest in having a bastardized, not quite TeX, not quite MD file (unless you're using something like Org, of course, and using its other functionalities).

Regarding having unicode for the maths, how did you deal with symbols that needed scaling (brackets, integrals, etc.?) They may look simpler when seen as text, but they certainly won't render nicely as math...

Re: Reach for Markdown, not LaTeX

#119
This reminds me very much of the emacs org-mode experience. But the good (bad?) thing about this is that it doesn't require emacs. I was looking for an alternative to recommend to my friends, since having to learn both the new notation and emacs really creates some friction.

Re: Reach for Markdown, not LaTeX

#120

Pandoc is really awesome. Even mathematics papers can be written in (mostly) markdown, and then converted to latex before compiling to PDF. For mathematics I would also recommend using Unicode symbols in place of LaTeX commands, which makes the source even more readable. For instance $∏_{x∈X} ∑_{y∈Y} Ψ(x,y) → ∑_{f : X → Y} ∏_{x∈Y} Ψ(x,y)$ instead of $\prod_{x \in X} \sum_{y \in Y} \Psi(x,y) \to \sum_{f : X \to Y} \pr…

You can avoid having to declare each character separately if you use the unicode-math package: https://github.com/wspr/unicode-math . I suggest you try it; it's life-changing for e.g. general relativity stuff where there are a lot of Greek letters being thrown around!
Post reply on HN