by kugurerdem · 2y ago · 0 comments
I use it for turning .md files into .html or .pdf.
I use it for creating slides with it.
I even use it for fixing the hard-wrapped text I write in vim before sending emails. When I write in vim, I prefer the text to be hard-wrapped, but for emails, I like it better when the text is not wrapped. I recommend arp242's essay explaining the problem with hard-wrapping [1], but basically the way I workaround this problem is using a local script which uses pandoc at some point [2].
Overall, pandoc is really good.
[1]: https://www.arp242.net/email-wrapping.html
[2]: https://github.com/kugurerdem/dotfiles/blob/2d68357273e1bc30...
* I use this css file when converting: https://gist.github.com/killercup/5917178
As for pandoc, yes it's amazing, and I have been using it to convert my word documents to markdown so I can publish a technical textbook I'm working on using Quarto. I tried writing directly in Quarto for a while, but as per my point above, it really slowed me down and distracted me from actually writing, so I figured out the pandoc pipeline. My most favoritest feature so far is that it converts tables AND equations to markdown and latex perfectly. It's so seamless that I'd actually recommend Word->pandoc as the best way to write a complicated markdown table.
> writing should happen in "word processing software"
Writing should happen where you are comfortable editing text. I am comfortable in same editor where I write code.
> To people who say "Word sux", I say "That just means you don't know how to use Word properly". Writing any markup or markdown syntax in an IDE is a disaster for the creative process.
To all the people who say "Writing markup in an IDE sux", I say "That just means you don't know how to use it properly". I can write in a flow and apply/change formatting easily. I can jump around and rearrange documents with ease. And it is in a format that can be opened and read by native software on almost any computer.
If you think that Jack Kerouac would prefer MS Word over a much simpler plain text editor, I don't agree.
For that particular context of text.
I write my code, notes, text and emails in vim. Some in markdown. But to this day, I still miss the incredible usability of LyX 1.x when writing pure long-form text.[ß] I could force all writing to occur within central 60% of the editable screen height [doable with vim but not as cleanly]. No whitespace or formatting issues, ever - set the document defaults according to my liking and it would feel "just right".
Proper rendering and visually correct editing of math formulas as part of text. Oh my. Fond memories of being able to type '<raw latex hotkey>\frac' and continue fitting in the values...
If it had had vim's search-powered navigation, it would have been nearly perfect. LyX 2.x was a step up in visual appeal and two steps down in raw usability. I've since picked up writing raw latex where I need good formatting, just because I could not make LyX 2.x bend to my taste anymore.
ß: Back on early 2000's, I wrote a book in LyX. As well as all my university course papers, including the master's thesis.
That's not a prerequisite for the Latex folks, in my experience :D
(I'm also in the "wrote my masters thesis in word, including the fair number of equations" group)
We are the ones that have to suffer because people we are forced to collaborate with do not take 5 minutes out of their day to learn the basics of a tool they use professionally.
It is the equivalent of seeing somebody use right-click to copy-paste, except it tangibly makes my day worse.
BTW, when I said tech people, I was thinking mostly about the computer savvy academics who use Latex for everything.
[0]: Not a rhetoric question that implies one answer to be the only "right" one.
What would you prefer, instead? CTRL-C, CTRL-V? SHIFT-INS, CTRL-INS? some vim incantation?
As a select-to-copy/middle-click-to-paste guy, seeing people use these inferior alternatives looks extremely annoying to me.
I've used Word professionally since the mid-1990s. I do know how to use it properly, and it still sucks.
"Writing" isn't meant to be done in a word processor, which was developed as a business tool, not a creative tool. Writing should be done in whatever tool one wants to write in.
Word is, be design, both a desktop publishing app and a secretarial tool. For book-length writing, it works poorly with long files, the file format is subject to corruption. The docx format is also proprietary and subject to Microsoft's whim; any conversion scheme is a hack (though Pandoc and many others do work adequately). Unless you learn the ins and outs of Word's style scheme (and sometimes even if you do) and follow it slavishly, formatting is often inconsistent and there's no certainty that the styles you apply to make your document to make it look a certain way ensure it looks that way on someone else's machine.
There's no doubt, though, that a Word-compatible word processor needs to be in every writers' toolkit, since it is the standard in the publishing world.
[0] https://www.sfwriter.com/wordstar.htm, scroll down or search for THE LONG-HAND PAGE METAPHOR.
Kerouac used a typewriter, which is about as minimal as it gets before you drop down to pen and paper. Something like Word is full of distractions: fonts, section headings, various formatting options, etc.
If you really want to get into the flow of writing, do it like Kerouac: plain text editor that wraps words at whatever width is reasonable to you.
After you're done, then copy it into a word processor and apply your formatting rules. Or just stick with the plain text editor and use anything from markdown to tex.
Ultimately, though, use what you're most comfortable with! That's going to be different, sometimes, for different people. The idea that it's a "fact" that everyone should be writing in any particular way using any particular software is just nonsense.
The fact? Should? In "word processing software"? Why shouldn't it happen in "text editing software"? Writing produces text, after all.
When it's time to collaborate, I use Pandoc to turn it into docx and then I send it around and the final formatting happens in Word because that's the easiest for everyone to work with, but the "get the ideas down" phase works best for me in a more "minimal" editor with little formatting.
I love the idea of Quarto, and if I had that when I was in grad school, it would have made my life so much easier. The workflow I see for Quarto is that you can write your paper while you're doing the experimentation because the code is embedded with your thoughts. But in that case, you're mostly slowed down by the research process so it can be a little more clunky to get the writing done because you have time and you're iterating over ideas more than words in that phase. I'd use it now for work in the R&D phase, but I know I won't have a critical mass of collaborators to make it worth while.
There's also Typst which is the new kid on the block but seemingly very good.
It's a bit of a matter of perspective.
The distinction between looking at a document in markdown versus Word is a bit analogous to the distinction between looking at a movie in its textual form as a screenplay versus looking at a movie as a piece of video: Text is capable of abstraction in a way that video is not.
In the screenplay, it might say "table", but when the director translates it to video, the director will have to decide: What kind of table? What design? What period? What texture? Is there anything on the table?
None of these decisions matter to the construction of the story, so, for a screenwriter, it would be very distracting if they had to make all of those decisions just to be able to get "table" committed to the medium.
In Markdown you worry about text and nothing but text. But Word shoves a particular font in your face as soon as you're laying down the first letter, so, if you don't like Word's choice of fonts, you can either let it annoy you throughout the project, or you can start worrying about fonts right then and there, which will be a distraction. If you write Markdown in a code editor, then, presumably, you've already set up the code editor in a way that doesn't annoy you. And then your future self (or someone else entirely) can worry about the font.
It puts the header notation and style (like italic, etc) in-line. So does Typst or LaTeX, and I can't think of any typical stand-off examples for headers and such, but it does muddy the text in-line in that sense. It typically doesn't really slow down the writing, but if you're writing \# as comments for code, then don't have those wrapped in \`\`\`, you can get some problems.
pandoc and some other tools turn those scenes into a full screenplay.
Anyway, to work within your analogy, I would say that Word lets the write do a bit of a 'mockup' of the set with nearly 0 effort. Like "I want a table here", so 2-3 clicks and you have it. Then you can "let the director" take your mock up and flesh it out properly later. As a writing, it helps me to see the mock up of the product as a go, but I want that mock up to be effortless. And as I said above, I do some work up front to make sure that Word's mock up looks good (or good enough).
Have you tried Libre Office? I'd love to hear your opinion.
Now granted, if you're just hammering out words without any editing this doesn't matter, but I think almost every piece of good writing has had 3+ revisions.
Of course this is a personal preference, but my friends who do a lot of writing (and never used vim at all) still seem to prefer a distraction-free editor with a lot less features and a much less noisy UI for the actual writing.
In Excel, you click on the cell and see either e.g. the number or formula used to get the result you see.
In Word, well, it's just difficult to figure out exactly why a thing looks the way it does.
Can also use control+space to strip off any direct formatting.
2. Add formatting using preferred markup language
3. ???
4. Profit!
Seriously, though, writing prose in a simple text editor and worrying about formatting later is far less distracting than writing prose in a WYSIWYG word processor. Also, adding formatting using a markup language ends up looking far nicer far faster than using a WYSIWYG word processor.
However, I'm not sure that even with greater knowledge of Word's features, whether developers in general would come to like it.
Or maybe those people just have eyes which can spot the differences in spacing between documents created with different Word versions, the mediocre kerning, and a multitude of other typographical annoyances.
Even a website is easier to replicate exactly in another browser than a Word document to be replicated from scratch in a new version of Word. And if by some miracle you manage that, the end result will always look meh.
I used to teach how to write serial letters with Word to secretaries when I was in high school. I used to write VBA macros that call in and out SAP systems when I was a junior software engineer - because "I was young and I needed the money."™
Now I either write in Emacs or Sublime on a Linux box with 2 TB RAM, or in Overleaf (LaTeX collab Web application), and I say: "Word sucks", I shall be suffering no more.
Word does not exist in my operating system (except for QEMU), and nobody notices.
LaTeX creates beautifully typeset publications, and most day to day writing requires nothing more than plain text, which is the most durable format.
I think of this as another version of enshittification -- the acceptance of poor performance as the "standard".
And don't get me started on math equations in Word ...
"Word sux" because it takes forever to start up and I forget what I went there to type. It's like opening a jetbrains ide to take a quick note. The only time that's worth it is when I'm sitting down to write for several minutes at a time, which happens (maybe) once a quarter, vs 17 times a day for quick notes.
Now, you could argue that I just don't want what word offers, but that's what everyone means when they say something sucks. It doesn't do the thing they want (usually because the implementers made trade-offs for other things).
MS Word or markup in an IDE are not the only options.
I used to use Lyx quite a lot. The best of both worlds in many ways.
There are text editors which give you a simple UI than an IDE without the distractions and complexity of a word processor. I find Kate quite pleasant to write in.
There are distraction free writers editors (which will often save in wordprocessor formats) that exist only because a lot of people find wordprocessors are a "disaster for the creative process".
So, as it must be me not knowing, can you tell me why Word won't let me change table column size ~50% of the time (for the same table from the same source). Half the time autofit works (yay!), half the time it won't let me resize columns, neither by typing the number, nor dragging the invisible off-page divider (Microsoft should just make the transparency of off-page content 50%??), nor changing to draft view and dragging the actual dividers ... wtf is going on there? If I paste it into OneNote first then it fits ... sometimes, if I drag a column wider first (which it already rendered 5x the width OneNote did) then it will let me narrow it afterwards, what's that feature called AutoNoNarrowColumnRenderedIncorrectlyFiveTimes ExpectedWidth?? I'll just search the settings to turn that off ... oh wait!
These are the times I long for markdown, or 'reveal codes' ... MS Word has a lot of problems they could probably have fixed if they hadn't put so much effort into preventing interoperability. These sorts of issues were around 20 years ago when I stopped using Word, and 5 years ago when I restarted. Same asinine poorly implemented numbering and styles that are unintuitive, opaque, and ungainly ... and don't get me started on search! Multi-highlights? Sorry best I can do is "find next" with no find previous, no regex, ... you can do find in AutoText though, right, right? ... and all the AutoText and AutoCorrect gets saved in a single sensible format that's easily modified? ... Word changes the format of all windows when you open a new one too, just in case you thought the suck was restricted to within the window chrome ... and doesn't have always-on-top, and doesn't open windows in their last position, and ...
Doesn't suck ...???!
Whilst you're here, any ideas why OneNote eliminates footnotes so you can't cut-paste between Word and OneNote? I'm sure it's not flawed and I'm just holding it wrong, right ...?
Pandoc was a game changer for me. I picked up LaTeX equation editor pretty quick, and being able to write markdown was so much more pleasant in my mind.
It’s not perfect; tables are a pain still, but I have no desire to go back to Word.
Uh, that's just like, your opinion, man.
You might be interested in Texmacs [1]. It is has a wysiwyg interface, and it handles nicely tables and mathematical equations. Also you can export documents to the latex format.
Or Scrivener. No Zotero plugin, though.
It depends on the person. The best way for me to write is on paper, on a desk with lots of empty space, with paper versions of all reference material.
I would like to quote this on a MonsterWriter landing page
markdown -> pandoc -> docx -> upload to google doc -> share
Other than that, I strongly agree. Word is also de facto standard when you want others to open and edit your document.
Emacs has `fill-paragraph` built in and `unfill-paragraph` is a short function definition [1]. Both work across multiple paragraphs.
You are absolutely right and I understand what you mean though. I am open to trying other alternatives and I should try to come up with a better method to workaround this problem.
Never tried Emacs, just went with Vim so far. Did not know that Emacs had already an elegant solution for this problem. Nice! :)
I am certainly not gonna be learning and switching to emac just to perform this task for unwrapping a .docx file
Never used Shellcheck?
I also very much like Pandoc-markdown's ‘simple table’ syntax, because it's actually human-readable and human-writable without confusion and pain.
Back in the day there were a couple of utilities (I think they were "catdoc" and "wordview") which could take MS Word input and generate text-only output. Good for reading MS Word attachments in mutt or from a terminal / console / SSH session.
<https://wvware.sourceforge.net/>
A primer on lessfilter:
<https://www.miskatonic.org/2020/06/24/lessfilter/>
And lesspipe:
Currently, I just open vim in the terminal, write what I need, then copy the text. I open dmenu using a shortcut, type something like "unwr", which is sufficient for selecting the "unwrap-clipboard" script of mine, press enter, which unwraps the text on the clipboard. Finally, I paste it in the email client.
I know it might seem a bit tricky, but it's better than what I did before. I used to set the textwidth to a really large number like 9999, highlight the text I wanted to unwrap, and then type 'gqq' for formatting. And don't forget, you also have to wrap the text back if you don't want to change the original format of the text file you wrote.
You can use soft-wrapping in vim, but I don't prefer it. Soft-wrapping is not as convenient to me as hard-wrapped text when using vim shortcuts. For instance, if you are using soft-wrapping in vim and you press 'o,' the insertion mode will start at the end of the paragraph because vim will consider the entire paragraph as a single line. However, there are many situations where I only want to insert text in the middle of a paragraph. You will also most likely set j to act like gj and k to act like gk, to make the cursor move between lines that are visually separated but actually form a single line. I don't like this either.
Someday I may try that again, if email is still relevant by then. Vim and email would be my perfect set up.
Wow, this is very interesting, and I might even try it at some point. It might have been a bit challenging to sync and read the emails though, but the sending part seems nice.
Was the reason for why you gave up related to syninc emails?
I've got it installed on MacOS and Linux, occasionally use it for longer HN comments.
The extension automatically invokes a vim session with the contents of your current browser edit window, and reads back in the output of your vim session when you're done with it.
<https://addons.mozilla.org/en-US/firefox/addon/edit-with-vim...>
:set tw=0 linebreak nolist
You'll get soft-wrapped text in vim, with no line limits.There are recipies which will reflow paragraphs to the end of a document (or a given mark), but here one of the issues is text which shouldn't be reflowed, say, Markdown syntax for tables, lists, possibly blockquotes, code blocks, and the like.
My preferred solution is to write either single-sentence-per-line (rarely) or flowed text in vim using:
:set tw=0 linebreak nolist wrap
Latter lets me just type paragraphs without breaking lines. Vim will flow those in the edit buffer. Other tools which can't handle hard linebreaks are much happier.