uwdata / living-papers

Authoring tools for scholarly communication. Create interactive web pages or formal research papers from markdown source.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

feature request: subfigures

joshuahhh opened this issue · comments

As described at https://www.overleaf.com/learn/latex/How_to_Write_a_Thesis_in_LaTeX_(Part_3)%3A_Figures%2C_Subfigures_and_Tables. Pretty sure I'll want this for my paper. Might hack something in.

I was able to hack in what I need in 59f3f1f. Note that the issues I discuss in #39 arise here, since I'm nesting subfigures inside of figures. (But you can route around them by doing some pre-processing yourself, in the Markdown source.)

Some more info, for posterity:

In addition to 59f3f1f, which hacked in LaTeX support for subfigures, I also did 379c483, which hacked in HTML support (much easier).

Using subfigures, in source, looked like:

::: figure {#notebook_vs_canvas}
:::: {.subfigure style="width: 30%" latex_width=0.3\columnwidth}
![](assets/2022-09-10-16-54-40.png)
::::
:::: {.subfigure style="width: 65%" latex_width=0.65\columnwidth}
![](assets/2022-09-10-16-58-15.png)
::::
| (a) A [Notebook]{.toolname} in which a user builds an arrow graphic for a vector. (b) A [NotebookCanvas]{.toolname} consisting of the same cells, but arranged spatially.
:::

In this example, I just use a normal caption, on the figure. You might instead want to use "subcaptions" on each subfigure, which could be made by using a | line within the subfigure. I used these at one point, so 59f3f1f handles them.