ipypublish icon indicating copy to clipboard operation
ipypublish copied to clipboard

Docx output format and reference to csv

Open diallobakary4 opened this issue 5 years ago • 4 comments

It will nice to have a Microsoft Word output. Pandoc already the format Docx as output format. It also allows to specify a template (--reference-doc= ), similar to latex template, for formatting the docx. Many journals provide Word format template. Another interesting feature will be to import csv table into markdown cell. ![An example of table](path_to_simple.csv) pandoc-csv2table, pandoc filter can implement it.

diallobakary4 avatar Apr 01 '19 16:04 diallobakary4

Hey @diallobakary4 thanks for the suggestions

Word Output

So firstly I'm definitely not a fan of Word lol. Yes its simpler to use for more computer illiterate people but, if you have a basic grasp of programming, LaTeX offers you far superior control over things like formatting, referencing, citations, etc. More problematic though, is that the Word file isn't plain text, so you inherently need to first convert the notebook to an intermediary format, then convert that file. e.g. notebook -> ipypublish -> <intermediary> -> pandoc -> Word What I would like to do in the future is to convert the notebooks directly to the underlying document representation used by pandoc, known as the pandoc AST (see #79), but I'm afraid this won't be any time soon.

CSV Tables

It would be pretty simple to implement a pandoc filter to achieve this (using panflute). Essentially what it would do is call pandas:

import pandas
df = pandas.read_csv(path_to_simple.csv)

Again, I don't have time to do this any time soon. Would it not be easier for you to just use this code in a notebook code cell, as I do in: https://ipypublish.readthedocs.io/en/latest/code_cells.html#tables-with-pandas

chrisjsewell avatar Apr 19 '19 14:04 chrisjsewell

Latex and Markdown (simplicity) offer superior control. I am asking for word output from an academic perspective and for collaboration. The main drawback is the lack of the system of review, comments and track changes available in word, which is used a lot in academia between students and supervisors and collaborators. Pandocs seems to offer a feature which to handle them but I am not sure if it as effective as word one. A related topic here. I recently managed to output a notebook to a manuscript word and pdf (a first draft), using mainly the markdown cells. So the intermediate format is Markdown. But from this first draft and now, it becomes very difficult to integrates changes from collaborators made in the word document, will have to continue with Word.

diallobakary4 avatar Apr 24 '19 12:04 diallobakary4

If you want track changes and collaboration with latex, I suggest you check out Overleaf

Trying to do round trips (i.e. converting in both directions) between the notebook and word/latex, is going to be extremely difficult though. Note this round-trip conversion can be achieved for Markdown, using jupytext

If you're working with the notebook (or markdown) as the source document, then really collaborators should be proposing changes to that document. Personally the way I would do this is to have the notebook(s) in a GitHub repository, then collaborators/reviewers would propose changes to them, by submitting pull requests, in exactly the same way people collaborate on code

chrisjsewell avatar Apr 24 '19 14:04 chrisjsewell

Thank you for your input. As you said the best way may be the GitHub pull request system. Actually, it will be very nice to have a git version for academia. Raw data and codes for the calculations will be available on git (with all possibilities for forking, branching and cloning).

diallobakary4 avatar May 07 '19 13:05 diallobakary4