Giter VIP home page Giter VIP logo

Comments (10)

tomduck avatar tomduck commented on August 21, 2024 1

A few notes:

  1. The TeX approach recommended above uses the subcaption package, which is recommended over other options.

  2. A stacked layout using subcaption is discussed here.

  3. 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.

  4. 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.

tomduck avatar tomduck commented on August 21, 2024

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.

gepcel avatar gepcel commented on August 21, 2024

I'll think of something and reply later.

from pandoc-fignos.

slochower avatar slochower commented on August 21, 2024

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.

tomduck avatar tomduck commented on August 21, 2024

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.

slochower avatar slochower commented on August 21, 2024

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.

timtroendle avatar timtroendle commented on August 21, 2024

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.

tomduck avatar tomduck commented on August 21, 2024

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.

tomduck avatar tomduck commented on August 21, 2024

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.

tomduck avatar tomduck commented on August 21, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.