Skip to content

Clarify usage of parameters when using CSV from file #65

Closed

Description

@mfhepp

It seems pantable understands parameters like caption, alignment, etc. in combination with CSV from a file only if they are in the markup or in the file, not in the element meta-data.

As putting them into the file will make the file unusable for most other tools, this is a bit unfortunate.

Approach 3, i.e. putting the meta-data including the include parameter into the code block is actually fine, but it should be documented more clearly if possible. Thanks!

This works: Approach 1

```{.table include="data/csv_example_with_header.csv"}
```

File: csv_example_with_header.csv

---
caption: '*Awesome* **Markdown** Table from `pantable`'
alignment: RC
table-width: 2/3
markdown: True
---
prefix, city_or_region, comments, Status
'030', 'Berlin', 'My comment', True
'069', 'Frankfurt', , False
'089', 'Munich', 'Another comment', True

This does not work (caption etc. missing): Approach 2

```{.table include="data/csv_example.csv" alignment="RC" caption="A cool CSV Table"}
```

This also works: Approach 3

```table
---
caption: '*Awesome* **Markdown** Table from `pantable`'
alignment: RC
table-width: 2/3
markdown: True
include: "data/csv_example.csv"
---
```

File: csv_example.csv

prefix, city_or_region, comments, Status
'030', 'Berlin', 'My comment', True
'069', 'Frankfurt', , False
'089', 'Munich', 'Another comment', True

Environment:

pandoc                    2.17.0.1             
pandoc-crossref           0.3.12.2           
pantable                  0.14.2

Activity

  1. added a commit that references this issue on Oct 6, 2026
    2f6c0d0
  2. ickc commented on Oct 6, 2026

    @ickc
    Owner

    Documented in 2f6c0d0 (#71): options are read from the YAML block only, not from attributes on the code block, so approaches 1 and 3 are the ways to do it. Reading options from attributes, and from other places, is tracked in #31. This closes when #71 is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions