Using Atom for academic writing


#17

I had no idea that this kind of package exists in Atom. Probably because I use Atom for coding, not writing.

I was thinking how helpful those packages would be for me. Actually I’m trying to develop an epub framework, and I was wondering if render markdown to XHTML it’s a good idea (and it is). This kind of package would make Atom the perfect text editor for an epub development with markdown.

Thanks for sharing!


split this topic #18

I moved 4 posts to a new topic: LaTeX question


#19

What I couldn’t find yet is an easy way to convert the Markdown file to PDF or DocX within Atom, as you can do with the Pandown package in Sublime Text. Does anyone has a solution for that?

I would also like to know this. What I love about Pandown is that you can store a configuration json file in the same folder as the markdown document which contains all of the arguments you used to compile the document with. I find this essential, particularly if you use lots of pandoc templates with custom variables. Otherwise you’re coming back to a document after some time away from it, and you have no idea how you generated the pdf.

Plus, just being able to spit out a fully-finished document with Cmd-B is obviously really great.

Any ideas where to start? I guess a terminal script might get you half of the way there.


#20

Just to partially answer the question, looking at the workflow section of Pandoc Extras https://github.com/jgm/pandoc/wiki/Pandoc-Extras and it looks as if the Panzer program is the closest to this particular functionality of Sublime Text Markdown

(in fact, it could be even better, as it allows you to indicate the document’s style in the metadata block. One downside of ST pandown is that you could only have one style template per folder, eg CV.markdown and CoverLetter.markdown would need to be in separate folders if you wanted to process them with different arguments/ templates etc).

I’ve installed Panzer and am playing around with it.

Now I just need to work out a way to activate it from Atom.

EDIT: or, this Makefile could work https://github.com/kjhealy/pandoc-templates/blob/master/examples/Makefile


#21

Thanks for pointing out panzer, looks interesting.

At the moment I just use aliases in my .bash_profile so I can type docx <file>, for example, to convert the document. I combine that with the atom-terminal package which can open a terminal in the folder of the file I’m working on in atom. Not as elegant as Pandown but OK.


#23

A quick update. I made a pull request to https://atom.io/packages/script . It now has pandoc support. It requires the panzer pandoc wrapper https://github.com/msprev/panzer and the pandoc-flavored-markdown language package in Atom https://atom.io/packages/language-pfm . You also need to launch Atom from the terminal unless you’ve set up your GUI to see your shell bin.

I opted to use the panzer wrapper rather than vanilla pandoc because I use pandoc for a variety of tasks, writing articles, CVs, letters, syllabi etc. These have different sets of settings, custom templates etc etc. Panzer allows you to easily define what a document is in the YAML metadata block, eg:

---
style: article
title: "title here"
...

This saves you having to construct a lengthy pandoc command (and then store it somewhere so that you can reproduce the article at a later date).

If you don’t want to use panzer you can override this by selecting “Configure Script”, then in the dialogue that opens entering “pandoc” in the command field.

One limitation: I set it to only outputs pdfs, because this is mainly what I use pandoc for. This is because, annoyingly, pandoc doesn’t accept pdf as an output format, that is, -t pdf is not an option. You can only produce a pdf in pandoc by setting the output filename to pdf, eg -o myDocument.pdf. However, this would mean that you would lose the automatic naming of the output file on the same path as the input file, which is kind of the point of using a feature like this, saving you typing a lengthy pandoc command into terminal.

The owner of the script package suggested that a custom pandoc package might be the way to go in order to conveniently access the various output formats that pandoc offers.

But, if you mainly use pandoc for outputting pdfs, the script package is a good solution.


How do I build my pandoc document/ run pandoc build script on current document?
#24

Nice list! What UI theme are you using? I’m starting off with atom and your pen-paper-coffee syntax theme is great!


#25

Glad you like it!
I am currently using the default One Light UI theme, which is a great allrounder. Sometimes I switch to Isotope Light for a change. For a more native feel on a Mac try Unity UI or on Gnome/GTK Adwaita Pro.


#26

I am using language-latex for syntax highlighting, latex for compilation, latexer for autocompletion, pdf-view for PDF viewing inside Atom with SyncTeX enabled and linter-chktex for linting.


#27

Hope people don’t mind if I advertise my latextools package. It handles compilation (with error / warning reporting), autocompletion of references and citations, and more. Pardon the interruption :slightly_smiling:


#28

This topic has been quiet for a while, but I recently came across a very useful package I would like to share here: atom-csv-markdown. I always found tables to be a pain in Markdown and this package makes it so much easier, at least for small, simple tables. For more complex tables I also found pandoc-csv2table.


#29

Here is another package I instantly fell in love with: wrap-with-anything to easily wrap words with *, ~, /, _, and space.

I think I should actually just update the initial post here so it’s easier to find. Will do so later when I have the time :slight_smile:


#30

I’ve really enjoyed this discuss question as it has helped me setup up Atom for my academic writing using Markdown.

I’ve been trying to find a package that will allow me to fold/unfold the contents sections or subsections or provide an outline using the headings/subheadings. I tried markdown-folding, [markdown-folder] (https://atom.io/packages/markdown-folder), and markdown-document. I didn’t find them to work very well.

Thoughts on good packages for these two functions?

cheers,


#31

Great discussion!

If you need auto numbering of tables/figures/equations and cross referencing in markdown, checkout the bookdown package for R Markdown which is based on Pandoc. And you don’t need to know R to use it.


#32

Just a quick note that will make most of us writers very happy: Atom 1.12 has native support for international keyboards and the spell-check package finally supports multiple languages and an ‘Add to dictionary’ option!

To activate, go to settings -> Packages -> spell-check. There you can add your ‘locales’ (I added en-US, en-GB, de-DE). When you activate Add Known Words you get the option to add words to your dictionary in the pop-up for correcting ‘misspelled’ words.

@santokh: What’s wrong with markdown-folding?


#33

Live from the shameless commerce division, let me also point out my BibTeX snippets package https://atom.io/packages/bibtex-snippets, inspired from the old Emacs snippets, which I’ve always found more helpful than the BibTeX manual. Hope that comes in handy to others for academic writing. Cheers!


#34

I just found latexer. It doesn’t solve a lot of things, but I found the bibtex autocomplete be a lot nicer than autocomplete-bibtex, since it automatically parses the bibliography{file} statement instead of a global .bib file like in autocomplete-bibtex


#35

Wow. This is a great list!

I’m surprised nobody’s mentioned asciidoct-assistant. I write in Asciidoc with a strong bias against Markdown (which flavor?) and the extensive suite of additional tools needed to make it even remotely useful for book-length projects.

And I can do all the TeX, math, diagraming, whatever I need with asciidoc and not have to rely on a bunch of other plugins, keeping atom (relatively) lightweight and responsive. asciidoc-preview (part of asciidoc-assistant) even parses and previews series of include::somefile[] statements, which is super helpful during the editing process because I can see my whole book and toc, not just individual chapters, all at once in the preview.

I’m also becoming a fan of linter-proselint in addition to linter-write-good.

I’m debating about installing one of the vim plugins and I seriously need to find a better spellchecker and maybe a thesaurus.

I disable all of the language- packages which are programming stuff I never use. This also helps keep the editor relatively lightweight and responsive.


#36

Hi, All.

I recall being able to preview criticmarkup highlights, deletes et al. in HTML side by side to my Markdown in Sublimetext on a Mac.
Do any of you know if it is possible with Atom over Windows?


#37

language-markdown supports CriticMarkup highlighting in the source. If you’re like me and you’re using language-pfm for handling your markdown, then pen-paper-coffee-syntax and pubster-syntax provide the CriticMarkup highlighting in the source.

In order to get CriticMarkup to show in the HTML preview, I recommend using markdown-preview-plus along with pandoc. markdown-preview-plus supports using pandoc to parse the markdown and generate the HTML preview along with any command flags you want. Thus, you can specify to use a pandoc CriticMarkup filter (like this one). I’ve not fully tried this out yet. I’ll update this post when I do.


Update: I am able to run this filter from the command line, but I get createProcess: invalid argument (Exec format error) when I try to call the filter from markdown-preview-plus (even with a fully specified path). I did notice when running from the command line that this filter wraps CriticMarkup HTML in spans with specific classes like insertion. Unless your syntax theme has definitions for these classes, they won’t show up any differently in markdown-preview-plus anyways. I forgot to mention that I already made an enhancement request on markdown-preview-plus’s repo to explicitly support CriticMarkup.


Update2: I’m able to get markdown-preview-plus if I place a copy of the filter in the same directory as the file I’m previewing and place --filter=./<filtername>.py in the MPP settings. The problem is, even if you write your own CSS file and include via --css=<criticmarkupCSSfile>.css, the CSS will be embedded in the preview data, but MPP doesn’t reference it when rendering the preview.