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

Separate numbering for supplemental figures/tables #35

Closed
infotroph opened this issue Sep 28, 2015 · 3 comments
Closed

Separate numbering for supplemental figures/tables #35

infotroph opened this issue Sep 28, 2015 · 3 comments

Comments

@infotroph
Copy link
Contributor

For a paper with a large supplemental section, I needed to maintain two separate sets of figure and table numberings, e.g. (See @fig:fig1, @fig:fig4, @supfig:figS1) ==> "(See Figures 1, 4, and S1)". I've hacked together most of a solution for this at https://github.com/infotroph/pandoc-crossref/tree/supplemental.

This is not a pull request, because I doubt you want my code: It duplicates nearly all of the existing figure and table code, provides no way to support other supplements (equations, listings, etc) other than also duplicating their code, and the numbering is broken in LaTeX and would probably need a custom Pandoc writer to fix it. I'm only posting it here in case it can help someone else who'd otherwise be hassling you for a real fix :)

@lierdakil
Copy link
Owner

I'd say that per-chapter numbering does pretty close to what you want. A
custom template could also help somewhat. Can't remember all implementation
details from the top of my head, but it should be possible without horrible
hacks :)
28 сент. 2015 г. 18:28 пользователь "Chris Black" notifications@github.com
написал:

For a paper with a large supplemental section, I needed to maintain two
separate sets of figure and table numberings, e.g. (See @fig:fig1,
@fig:fig4, @supfig:figS1) ==> "(See Figures 1, 4, and S1)". I've hacked
together most of a solution for this at [
https://github.com/infotroph/pandoc-crossref/tree/supplemental].

This is not a pull request, because I doubt you want my code: It
duplicates nearly all of the existing figure and table code, provides no
way to support other supplements (equations, listings, etc) other than also
duplicating their code, and the numbering is broken in LaTeX and would
probably need a custom Pandoc writer to fix it. I'm only posting it here in
case it can help someone else who'd otherwise be hassling you for a real
fix :)


Reply to this email directly or view it on GitHub
#35.

@lierdakil
Copy link
Owner

Okay, it seems like I only wanted to implement custom section reference text. This is implemented by 34180d7, but I'm short on ideas on how to make this work with LaTeX output.

@infotroph
Copy link
Contributor Author

I finally got around to trying this. Yes, per-chapter numbering works nicely (and degrades well in the LaTeX case). Thanks!

For anyone else who needs unnumbered chapters, continuous figure/table numbering through all body sections ("fig. 1") and separately numbered supplements ("fig. S1"), the following worked for me:

---
chapters: True
chaptersDepth: 1
chapDelim: ""
---

# Methods {-}

Lorem ipsum dolor sit amet, consectetur adipiscing elit (@fig:lorem, @fig:ipsum).

![Lorem and legemds](a.png){#fig:lorem}

# Results {-}

![I like to ipsum water on a hot day](b.png){#fig:ipsum}

Etiam cursus dictum dui, id condimentum (@fig:lorem, @fig:supsic, @tbl:table, @tbl:suptable).

Table: Ipsum est? {#tbl:table}

| Word | English | Ipsum |
|------|---------|-------|
| day  | YES     | NO    |
| amet | NO      | YES   | 
| sit  | YES     | YES   |



# Discussion {-}

Quisque finibus enim est, quis placerat turpis volutpat at.

# Supplementary Material {label="S"}

Suspendisse vel ante sapien. Donec vitae magna suscipit (@fig:supsic, @fig:lorem).

![Sic transit](c.png){#fig:supsic}

Table: Is English? {#tbl:suptable}

| Word | English | Ipsum |
|------|---------|-------|
| day  | YES     | NO    |
| amet | NO      | YES   | 
| sit  | YES     | YES   |

Tested with Pandoc 1.17.1 and pandoc-crossref 0.2.1.3: pandoc test.md --filter pandoc-crossref -o test.docx.

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

2 participants