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

[ENH]: Allow a custom documentclass when using the pgf backend. #28119

Open
voidstarstar opened this issue Apr 22, 2024 · 0 comments · May be fixed by #28167
Open

[ENH]: Allow a custom documentclass when using the pgf backend. #28119

voidstarstar opened this issue Apr 22, 2024 · 0 comments · May be fixed by #28167

Comments

@voidstarstar
Copy link

voidstarstar commented Apr 22, 2024

Problem

In general, the process of producing a quality pgf file is confusing and not very intuitive to me. As a user, my ultimate goal is to be able to generate a pgf file that can be inputted into my own custom LaTeX document such that this final rendered plot looks identical to how matplotlib renders it internally. This internal rendering is what decides the position of labels, ticks, etc. so it is important that there is perfect consistency between this first internal rendering and my second final rendering. Achieving this consistency is very difficult when using a custom documentclass. From what I understand, there's no way to set what documentclass is used for the internal rendering as it appears to be hard coded as article. When using a complicated documentclass, it can become nearly impossible to track down every package, etc. that is used.

Related:
#28112
#26892
#26893
#26791
#14637

Proposed solution

Is there any reason why this documentclass can't be provided by the user? I would suggest the following:
When saving a pgf, simply allow the user to specify an optional pgf.documentclass rcParam and use article as the default. (I assume this needs to be done separately from the pgf.preamble rcParam since it looks like matplotlib inserts other LaTeX commands between the documentclass and user provided preamble, but I may be wrong.)

@voidstarstar voidstarstar changed the title [ENH]: [ENH]: Allow a custom documentclass when using the pgf backend. Apr 22, 2024
@voidstarstar voidstarstar linked a pull request May 4, 2024 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant