Live data from Hacker News

Reach for Markdown, not LaTeX

blog.jez.io

101–110 of 184 posts

Re: Reach for Markdown, not LaTeX

#101
post #26

Author here! I'd like to take a second to point out that the audience I had in mind when writing this article was mostly my fellow classmates in college. In school we were hastily introduced to LaTeX freshman year and were required to typeset our homeworks before submission. The point of the article isn't "you should never use LaTeX" but rather "hey, there's this other, simpler tool that you might like better!" plus…

Interesting, and a bit surprising. Back in the Triassic Age, I picked up LaTeX from an undergrad roommate because it was easier than writing up homework by hand, and because you can turn a basic ".txt" file into a ".tex" file with very few changes. I agree that Markdown and friends have their place, but they quickly reach their limits. You write that "Pandoc can take care of the presentation for us," but in my experi…

You can write markdown and pandoc will leave any latex fragments for the backend. This only works for latex based backends like pdf but it works great if you have some formulas.

Code formatting and tabels are also vastly easier with pandoc.

Re: Reach for Markdown, not LaTeX

#102
post #21

Markdown can do quite a lot, but it doesn't have any way to write mathematical formulae. Since that's 90% of why I use LaTeX in most cases it seems silly to recommend Markdown. LaTeX has a superset of features, and is well suited to what it does properly (typesetting). Markdown is quick and easy to use, so it's good for blog posts.

Pandoc's tex_math_dollars, tex_math_single_backslash and raw TeX mode makes it possible to fallback to TeX whenever you need: https://pandoc.org/MANUAL.html#math-input A Markdown -> LaTeX -> pdf pipeline was how I wrote all of my algorithm assignments in college. I wrote things like: * **Basis**. Prove for $n = 0$... * **Induction**. If \mathcal{G} is a graph ... \begin{equation} ... \end{equation}

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.

Re: Reach for Markdown, not LaTeX

#103
post #99

Earlier quoted context omitted.

I thought Latex was superior to Word in every way than I had a colleague that knew Word. Word if you learn it is just fine generating a ToC or autonumbering sections, figures, and tables. In practice, Markdown is better than either for documentation that isn't printed. It's easier to edit, can be viewed with a plain text editor, and has a minimal learning curve.

"Word if you learn it is just fine generating a ToC or autonumbering sections, figures, and tables." : but can it do this? -- [Common Lisp Quick Reference]( http://clqr.boundp.org/clqr-a4-booklet-all.pdf )

Wow, that's beautifully set!

Re: Reach for Markdown, not LaTeX

#104
post #68

Earlier quoted context omitted.

Do you think legal writing falls into this category?

I have a dream where someone writes a processor that will allow the writer to bang out some Markdown-ish plaintext and turn it into a p&a with automatically generated Table of Contents, Table of Authorities, caption, and pleading paper. Call it LexDown or something even less mellifluous and free millions from the tyranny of Word style sheets forever.

I was curious and searched if there was a project of that name already: https://github.com/OpenIus/lexdown

Re: Reach for Markdown, not LaTeX

#105

Earlier quoted context omitted.

I'm a bit confused by this. As I see it, LaTeX can do everything that Markdown can before things get complicated. Where LaTeX does get complicated (e.g. when designing figures or drawings), Markdown doesn't offer any advantage or even any functionality. For composing simple documents or outlines and doing typesetting of equations, LaTeX has some boilerplate but it's really not that much.

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.

Re: Reach for Markdown, not LaTeX

#106
post #21

Earlier quoted context omitted.

Pandoc's tex_math_dollars, tex_math_single_backslash and raw TeX mode makes it possible to fallback to TeX whenever you need: https://pandoc.org/MANUAL.html#math-input A Markdown -> LaTeX -> pdf pipeline was how I wrote all of my algorithm assignments in college. I wrote things like: * **Basis**. Prove for $n = 0$... * **Induction**. If \mathcal{G} is a graph ... \begin{equation} ... \end{equation}

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.

Later, when publishing the different parts of my thesis, this separation from Latex made it easier to convert to whatever cls the publisher wanted, since I would just change the template.

Re: Reach for Markdown, not LaTeX

#108
post #26

Author here! I'd like to take a second to point out that the audience I had in mind when writing this article was mostly my fellow classmates in college. In school we were hastily introduced to LaTeX freshman year and were required to typeset our homeworks before submission. The point of the article isn't "you should never use LaTeX" but rather "hey, there's this other, simpler tool that you might like better!" plus…

I'd also add that while Markdown and LaTeX can do some of the same things, they're designed toward very different tasks. I've used both numerous times in my career, and I can't remember a case where it's been ambiguous which tool was more appropriate for the task. If it's going to be printed, you probably want LaTeX. If it's going to be rendered to a screen, you probably want Markdown. If it's going to be rendered to…

While not exactly the simplest tool around, org mode is still a lot simpler than LaTeX and brings excellent export features to both LaTeX/pdf and html. It’s probably a hard sell for anyone who doesn’t use Emacs already, but for someone already using Emacs, it’s quite neat. I’ve found that for me, it offers the right balance between simple basic functionality (like Markdown) and optional advanced features.

Re: Reach for Markdown, not LaTeX

#109
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} \prod_{x \in Y} \Psi(x,y)$

To get this compiling, your template will have to include declarations for these such as:

\DeclareUnicodeCharacter{220F}{\ensuremath{\prod}}

Re: Reach for Markdown, not LaTeX

#110

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
Post reply on HN