Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import table file #461

Open
michoug opened this issue Mar 15, 2022 · 2 comments
Open

import table file #461

michoug opened this issue Mar 15, 2022 · 2 comments

Comments

@michoug
Copy link

michoug commented Mar 15, 2022

Hi,
I have big tables that I want to include in my manuscript, but I would prefer it if they could be imported directly from an outside file as are the figures (images/images.png). Is it possible? it would be something like this, maybe

![lA table with a top caption and specified relative column widths](tables/tables.txt){#tbl:bowling-scores}

where tables.txt contains just

| *Bowling Scores* | Jane          | John          | Alice         | Bob           |
|:-----------------|:-------------:|:-------------:|:-------------:|:-------------:|
| Game 1 | 150 | 187 | 210 | 105 |
| Game 2 |  98 | 202 | 197 | 102 |
| Game 3 | 123 | 180 | 238 | 134 |

Best
Greg

@agitter
Copy link
Member

agitter commented Mar 15, 2022

This would be a great feature, but I don't know of any examples doing this with Manubot. A related question came up previously (#350). At the time, we recommended the Pandoc filter pandoc-placetable. However, that filter is only compatible with pandoc < 2.10 so it won't work with recent version of Manubot.

pandoc-csv2table may be able to support. If you want help setting up Manubot to use this Pandoc filter, we can help with that.

@rando2
Copy link

rando2 commented Apr 1, 2022

@michoug, we were able to implement this (see linked PR above and greenelab/covid19-review#1104) by reading the data into python via pandas, using DataFrame.to_markdown to convert it to markdown, and storing that in the .json file we use to handle other variables. Then the table can be inserted into the manuscript as {{variable_name}}.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants