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

Better handle heading alignment in LaTeX output #1006

Closed
wants to merge 3 commits into from

Conversation

rich-iannone
Copy link
Member

@rich-iannone rich-iannone commented Aug 16, 2022

In LaTeX output, very long titles/subtitles will trigger a shift in alignment from centered to left-aligned. This PR makes the alignment explicit, based on the chosen option (from tab_options(heading.align = ...)) or the "center" default.

Fixes: #630

@rich-iannone rich-iannone marked this pull request as ready for review August 17, 2022 15:38
@rich-iannone rich-iannone changed the title Always center the title/subtitle in LaTeX output Better handle heading alignment in LaTeX output Aug 17, 2022
Copy link
Member

@cscheid cscheid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this one is quite right. If no heading_align is present, we should instead not add any \captionsetup at all, so that the latex template defaults take over.

@rich-iannone
Copy link
Member Author

rich-iannone commented Aug 17, 2022

By default there is a heading_align present and its value is "center":

"heading_align", TRUE, "heading", "value", "center",

Before this PR, there was no checking of this property value at all so the default caption justification was always used. I like the idea of the default caption being an option but I'm not sure at this point how to incorporate that option.

@cscheid
Copy link
Member

cscheid commented Aug 17, 2022

But the problem is that if the user hasn't set this explicitly, GT should let the styling be dictated by the LaTeX template. It shouldn't be up to your defaults: it should be up to the user's template. (this is the analogous LaTeX discussion to our HTML styling discussion yesterday.)

I understand that it is the current GT behavior to set these visual attributes. But in formats such as LaTeX (and themed HTML outputs from quarto as well), the environment should provide the appearance defaults.

@rich-iannone
Copy link
Member Author

Ah, that's right, that should apply here as well. I'll do that work in a separate PR and then revisit this one once we can distinguish between user set and unset property values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Longer titles trigger left-alignment of title and subtitle
2 participants