Live data from Hacker News

Reach for Markdown, not LaTeX

blog.jez.io

151–160 of 184 posts

Re: Reach for Markdown, not LaTeX

#151
post #130

I don't get it. Say I already know that I'll need some formulae in my document. Then the use case here seems to be, essentially, that I can write # Section Name instead of \section{Section Name} and that I can write *important stuff* instead of \emph{important stuff}. I can see that the markdown version is a little nicer on the eyes and keyboard, but only by a small margin. Now, if I write a document in latex I need…

It might surprise you, but lots of documents and side sets are written without any formula at all.

Re: Reach for Markdown, not LaTeX

#152
post #130

I don't get it. Say I already know that I'll need some formulae in my document. Then the use case here seems to be, essentially, that I can write # Section Name instead of \section{Section Name} and that I can write *important stuff* instead of \emph{important stuff}. I can see that the markdown version is a little nicer on the eyes and keyboard, but only by a small margin. Now, if I write a document in latex I need…

I think it is worth the extra complexity to avoid having to write \section and \emph all the time, and to make your notes more readable as a .TXT files. Also I find it easier to just set up a basic document, for markdown you can just open a new text file and start writing, for Latex you have to do a lot of setup at the start of the document to define your margins and import packages. Its not going to work well if you want a perfectly formatted document, but if you want to write simple notes styled with CSS it is much nicer to work with.

Re: Reach for Markdown, not LaTeX

#153
post #134

Earlier quoted context omitted.

Pandoc is awesome for things like tables or code blocks. Here is a table in pandoc markdown: | Header 1 | header 2 | |-|-| | Column 1 | Column 2 | Which is easy to write via emacs mode/vim plugin. Similar for code blocks. Plus this is extendable, I frequently use an extension that transforms DOT syntax into embedded graphs.

Tables are very complicated in LaTeX... but for a goodreason: tables are just hard . In your example: - Should the table appear flushed to the left? Centered in the page? flushed to the right? Full-width or only content-width? - What happens when Column 1 is long? Should the text wrap inside its own cell, overflow, or what? - Which row/column lines should appear? None? All of them? Only those that separate headers? T…

I think the author mentioned this elseware, but he wasn't suggesting to use .md for complicated documents, just for notes and simpler documents where you don't need the extra options like complex table formatting, you just want something quick that works.

Re: Reach for Markdown, not LaTeX

#154

Earlier quoted context omitted.

Web essays is definitely not the place to use professional typesetting tools. Browsers are simply incapable of doing professional quality typesetting of the type books have had since the 15th century because the output environment is too heterogeneous, unless you abandon html and render documents as SVG or PDF or something (I would not recommend doing that). Authoring tools won’t help you. On the web the best you can…

I've always been curious: Pretend I'm totally ignorant, and have no idea what need a typesetting tool fulfills. Someone who has used and been happy with Word / Open Office for years to write documents. What does LaTeX/InDesign solve for me, besides "nice looking math" that I'm not getting out of basic word processors? How do I know which one I need? I honestly have no clue. If I were to start writing a book tomorrow,…

For writing a non-fiction book, you should probably use Word or something similar. Just make sure to avoid any formatting tools, only use semantic markup. Word is a pretty decent authoring tool. The end result can then be imported to a typesetting tool for formatting.

InDesign is used when you need precise control of the output. For instance controlling exactly how figures are placed, you might more advanced control of how text flows between boxes, etc. It also has tools for very precise control of how the type is set, how big space should there be between letters and words, how should the right edge of columns look, should there be different number of columns on different pages, etc.

Some of those things can be somewhat managed in Word, but you'll have to fight a lot of the automatic stuff, really not worth it if you are a full time design professional, much cheaper then to buy an expensive InDesign license.

Latex is pretty good at having sane defaults. This was a bigger issue back in the days when the defaults of Word were frankly terrible. Today it's to a large extent about style choice. If you publish in an area where Latex dominates, the Latex styling will make your document appear as more serious. Latex also generally uses a more advanced type setting engine, for example it might join "fi" with ligatures etc. This can also improve the look of the document.

Some people like the fact that you can manage Latex code as raw text. For instance using a VCS to manage version history. Word has some built in version management functionality, but it's quite clunky compared to Git.

Personally I gave up on using Latex after my first master thesis and tend to use Word. I get too caught up in the formatting when I use Latex. Maybe it's too much power to handle for me?

Re: Reach for Markdown, not LaTeX

#155
post #28

Earlier quoted context omitted.

>Documentation is meant to be read by everyone, not make you feel good about being forced to write it. I think you missed the point you were trying to make here because nobody has any difficulty reading the PDFs rendered from latex.

Yes, but maintaining documentation in PDF is not. Half the people that manage our doc are non-programmers. They're not learning LaTeX. They're not editing raw PDFs while the other half of the team uses LaTeX.

Then you should have focused on maintainability in your comment, not legibility.

Re: Reach for Markdown, not LaTeX

#156
post #62

Earlier quoted context omitted.

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…

When you say "rendered to a screen", do you really mean "placed on a webpage"? PDFs generated by LaTeX are rendered to screen all the time. edit: Actually, I find that I completely agree with your point if "printed" is replaced by "shared in pdf format" and "rendered to screen" is replaced by "shared in plain text or HTML format".

You can simplify it even further:

Will the content be shown with fixed line lengths, or with responsive line lengths?

Re: Reach for Markdown, not LaTeX

#157

Earlier quoted context omitted.

I just make the symbols shortcuts for the commands. So for instance ∑_{0≤n≤k}n² expands to \sum_{0\le n\le k} n^2.

Do you have a library of these substitutions available? Sounds like it could be useful.

I just have this[0], which is a list of the substitutions. You can either make it a sty file, or just stuff it in the preamble, or template.

Some of these are suboptimal. But you can just change them, and make your own.

[0]: http://lpaste.net/362623

Re: Reach for Markdown, not LaTeX

#158
post #130

I don't get it. Say I already know that I'll need some formulae in my document. Then the use case here seems to be, essentially, that I can write # Section Name instead of \section{Section Name} and that I can write *important stuff* instead of \emph{important stuff}. I can see that the markdown version is a little nicer on the eyes and keyboard, but only by a small margin. Now, if I write a document in latex I need…

I wrote my dissertation and several papers for publication using mardown + pandoc + latex. On Arch. I have to say, you're far overstating the difficulty of this arrangement, and understating the benefits. As long as you're willing to accept the haskell package madness, which pacman takes care of for you, everything else works in a very straightforward manner. The trick is, you don't have pandoc generate straight through to PDF. You treat pandoc as a preprocessor, have it generate tex. Then your main LaTeX source file boils down to a bunch of \usepackages and \includes. I pulled it all together with a very simple makefile.

The markdown source is a great deal more readable -- all of those little substitutions that seem inconsequential individually add up to a lot less noise in your document source. Equations just pass through to LaTeX, so you write them the same. All of my floats started out using markdown syntax, which is really beneficial when drafting, since much harder to mess up a single line when cutting and pasting it around. In the end, I wanted finer control over how they looked, so I pasted the generated tex into my sources and worked from there.

My one caveat is, you absolutely must understand LaTeX first, or you will be in for a bad time. Pandoc + markdown + LaTeX is no substitute for understanding LaTeX, but it's a huge win if you're already familiar with LaTeX and you're tired of typing backslashes.

Finally, the recommendation to use article is unfortunate. Memoir will save you a lot of headaches.

Re: Reach for Markdown, not LaTeX

#159
post #134

Earlier quoted context omitted.

Pandoc is awesome for things like tables or code blocks. Here is a table in pandoc markdown: | Header 1 | header 2 | |-|-| | Column 1 | Column 2 | Which is easy to write via emacs mode/vim plugin. Similar for code blocks. Plus this is extendable, I frequently use an extension that transforms DOT syntax into embedded graphs.

Thing is, if you're already looking to use e.g., Emacs, you'll be better off using org-mode instead of markdown. Same lightness of syntax, tens of times the functionality (including much better tables, which you can use directly from a TeX document, as well, via radio tables). Editing ascii tables with no editor support is painful. There's also some org functionality in vim plugins, though I've never used them, so I…

I’ll second this. We’ve had good experiences converting org-mode files to LaTeX for internal documents.

Re: Reach for Markdown, not LaTeX

#160

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 (```).

If you can type ``` without breaking your hand.

` is a three-key combination AND a dead key on non-US keyboards.

Post reply on HN