Comments (10)
A few notes:
-
The TeX approach recommended above uses the subcaption package, which is recommended over other options.
-
A stacked layout using subcaption is discussed here.
-
Perhaps a markdown syntax like this would work:
::: {#fig:one} ![Caption 1a](figure1.png){#fig:one-a} ![Caption 1b](figure2.png){#fig:one-b} Caption 1. :::
The above uses pandoc divs. Note that figures must be on their own line according to pandoc. Configuration items could be added to the main div and subfigure attributes.
-
The next step is to generate some latex and html code (these are essential target formats). Docx is going to require input from someone who knows what they are doing with OOXML.
from pandoc-fignos.
Thanks for your input, @gepcel.
To implement this feature I would need a well thought out spec to work from. Does such a spec exist?
It has to have well-defined behaviours for at least pdf and html output. One of the design goals for pandoc-fignos and friends is to equally well support both output formats (and others as possible).
I'm a bit worried that this is getting away from what pandoc-fignos does (cross-referencing). Would it be better to have a separate filter for subfigures?
from pandoc-fignos.
I'll think of something and reply later.
from pandoc-fignos.
Hi @tomduck, just curious if you've had any further thoughts on this. I, too, have been using pandoc-crossref
for this, but it is not as ideal as pandoc-fignos
for a number of reasons.
from pandoc-fignos.
Hi @slochower. I'm just getting going on pandoc-fignos again after a long absence. Let me update pandoc-fignos for the new pandoc releases and get back to you. As noted in my earlier comment, I would need some help with a spec for the markdown and also in determining what the latex and html behaviours should be like.
from pandoc-fignos.
would need some help with a spec for the markdown
I'm certainly no expert, but the easiest, most fluid, and most natural syntax would be to treat two consecutive figures as two subfigures inside of a single figure. I'm sure there lots of issues to be uncovered with this, but that's where I'd start.
![Caption 1](figure1.png){#fig:subfigure1}
![Caption 2](figure2.png){#fig:subfigure2}
Citations, like +@fig:subfigure1
might render as fig. 1a.
determining what the latex
As a naive user, I would probably expect something similar to subfigure
.
and html behaviours should be like.
I'm guessing it would be to put the subfigures into a <div>
but I'm not sure.
from pandoc-fignos.
While this feature does not exist, is there a manual workaround? I can create a single figure with subfigures a
and b
for example. However, I don't find a way to avoid whitespace when referring to it:
With a figure tagged #fig:one
, +@fig:one a
renders to fig. 1 a
. +@fig:onea
does not render of course.
EDIT: The solution are curly braces. {@fig:one}a
will render to fig. 1a
.
from pandoc-fignos.
Thanks, @timtroendle. I'm glad that you found the solution. It hadn't occurred to me that the new facilities available in pandoc-fignos enabled references to hand-coded subfigures like this. I will look into updating the pandoc-fignos documentation with your idea.
from pandoc-fignos.
I just wrote the workaround suggested by @timtroendle into the pandoc-fignos documentation. Check it out: demo4.md and demo4.pdf. It is even possible to reference subfigures directly.
Some commentary: It is challenging to provide syntax support for subfigures directly in pandoc-fignos because of the difficulty of making it flexible enough for LaTeX users while providing support in other output formats. This indirect approach provides complete flexibility for LaTeX/pdf. It may be possible to provide specialized indirect support for other output formats as well. Users will have to let me know if that is needed.
from pandoc-fignos.
References to subfigure references are now supported for html/epub as well. Subfigures for html/epub are implemented using pandoc's fenced divs. Check it out: demo5.md and demo5.html.
I think that this Issue can be closed. If problems are found with subfigure references, please feel welcome to create a new Issue.
Cheers,
Tom
from pandoc-fignos.
Related Issues (20)
- Auto-generated caption names want to be bold, when converting from markdown to word.
- Installation of Fignos for windows
- Error producing PDF related to no-prefix-figure-caption HOT 1
- Changing figure caption name with babel in LaTeX
- RuntimeError: Cannot understand pandocversion=3.0.1 HOT 9
- No caption numbers in docx output HOT 4
- "Bad reference" - syntax doesn't work on recent pandoc releases HOT 1
- TypeError in pandocxnos.core.process_refs with Pandoc 2.11 HOT 4
- Pandoc HTML5 Video, Media Fragments HOT 3
- Please clarify documentation for `pandoc-fignos` and `pandoc-eqnos` when a pandoc defaults file is used
- ! LaTeX Error: Environment fignos:no-prefix-figure-caption undefined. HOT 3
- Feature Request: new caption separator for respecting some language typo rules
- Label and sizing HOT 3
- Error when filtering with 'python -m pandoc_fignos json'
- Hardwire figure numbers in LaTeX
- Using a figure caption as referenced label
- Feature Request: `--fail-if-warnings`
- Issues when converting "*.tex" to "*.html"
- \theHfigure undefined
- Figure reference links on epub files are wrong HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pandoc-fignos.