-
Notifications
You must be signed in to change notification settings - Fork 320
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
force left-align for code in layout #6062
Conversation
@dragonstyle Could you review this and back port to v1.3 as required? |
As there is no ticket opened about the related issue, I am posting here. Mainly for possible future reference about the context of this problem. Adapting the CSS does indeed fix the issue, however I was curious about why this was needed. I noticed that our HTML structure is quite different if we have only one figures, or using subfigure. If we ```{r}
#| label: fig-slot
#| fig-cap: "The Big One"
plot(pressure)
``` it creates a It gives something like <div class="cell">
<div class="sourceCode cell-code" id="cb1">
(...)
</div>
<div class="cell-output-display">
<div id="fig-slot" class="quarto-figure quarto-figure-center anchored">
<figure class="figure">
(...)
</figure>
(...)
</div>
</div>
</div> However, when using sub figure, it is quite different ```{r}
#| label: fig-slot
#| fig-cap: "The Big One"
#| fig-subcap: ["First", "Second"]
plot(cars)
plot(pressure)
``` the code block is inside the <div class="quarto-figure">
<figure class="figure">
<div class="sourceCode cell-code" id="cb1">
(...)
</div>
<div class="cell-output-display">
<div id="fig-slot-1" class="quarto-figure quarto-figure-center anchored">
<figure class="figure"> (...) </figure>
(...)
</div>
</div>
<div class="cell-output-display">
<div id="fig-slot-2" class="quarto-figure quarto-figure-center anchored">
<figure class="figure"> (...) </figure>
(...)
</div>
</div>
<figcaption class="figure-caption">Figure 1: The Big One</figcaption>
</figure>
(...)
</div> It seems to the way we create subfigure from the beginning - so I believe this is expected that way ? To me it was really not obvious and quite puzzling to not have the |
@cderv I agree that we should try to make the output HTML more uniform. The underlying source of the problem is that we have a large number of different code paths and possible configurations. This is not uniform, but consider the following possibilities:
The crossref work I'm doing has a side effect of simplifying our Lua data structures as they're being processed. From there we'll be able to clean up the formatting and hopefully the output. Some of it is already happening. But we should probably defer this discussion to the point where we have a better foundation. |
Understood - This is awesome to know that the crossref works will make our foundation better for all this ! Thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tinkered with printing text and warnings and only could find the annotations case that was still escaping alignment...
… to beat the mermaid centering div setting
Fixes the rendering for the following repro case: