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

Style admonitions with tcolorbox in LaTeXWriter #1932

Merged
merged 10 commits into from
Sep 20, 2022

Conversation

odow
Copy link
Collaborator

@odow odow commented Sep 14, 2022

TODOs before merging:

  • NEWS
  • Tests? I'm not really sure how to test this.

Closes #1931

Before

image

After

image

@odow
Copy link
Collaborator Author

odow commented Sep 14, 2022

Ah. Test failures are because I was developing on the latest patch, and then rebased onto master.

src/Writers/LaTeXWriter.jl Outdated Show resolved Hide resolved
assets/latex/documenter.sty Outdated Show resolved Hide resolved
@mortenpi mortenpi added Type: Enhancement Format: LaTeX Related to the LaTeX / PDF output labels Sep 14, 2022
@mortenpi
Copy link
Member

To fix the reference tests, you can run the tests locally with DOCUMENTER_FIXTESTS set (to anything).

mortenpi and others added 3 commits September 15, 2022 11:23
Co-authored-by: Oscar Dowson <odow@users.noreply.github.com>
@odow
Copy link
Collaborator Author

odow commented Sep 14, 2022

Okay, that seems to have done the trick.

@KristofferC
Copy link
Member

Looks nice!

@mortenpi
Copy link
Member

Hmm, it looks like there is some bad interaction with the surrounding elements here, effectively making the admonitions inline elements:

image

You can get the PDF from the PDFs artifact here, and and the relevant markdown is here.

@mortenpi
Copy link
Member

Oh, and this is getting into bikeshedding territory, but what about (1) bold text in the title, and (2) any way to get it vertically centered?

@odow
Copy link
Collaborator Author

odow commented Sep 17, 2022

Oh, nice. I didn't notice the artifacts. I'll admit that I didn't look at the PDF of the showcase, I was just looking at the MOI and JuMP docs.

It looks like this might be some weird behavior with the use of \subparagraph for the Note admonition headers in bold?

Other parts seem normal:

image

image

Bikeshed away. Bold and vertical centering look doable: https://tex.stackexchange.com/questions/482103/tcolorbox-vertically-center-title-box

@odow
Copy link
Collaborator Author

odow commented Sep 18, 2022

It's because paragraph and subparagraph don't create new paragraphs after themselves. I guess we need an explicit \indent. This would affect things other than admonitions, like tables:

\subparagraph{New subparagraph}

\begin{tabular}{| c | c |}
\hline
foo & bar \\
\hline
\end{tabular}

\subparagraph{New subparagraph with indent}\indent

\begin{tabular}{| c | c |}
\hline
foo & bar \\
\hline
\end{tabular}

image

@odow
Copy link
Collaborator Author

odow commented Sep 18, 2022

Okay, this is now:

image

I don't understand the centering of the titles. It looks like some interplay with how we're redefining paragraph spacing etc.

I'd be in favor of merging this as-is, and coming back to it as a second-order thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Format: LaTeX Related to the LaTeX / PDF output Type: Enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Styling of admonitions in LaTeXWriter
3 participants