-
Notifications
You must be signed in to change notification settings - Fork 48
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
Add ability to set latex text size #82
base: master
Are you sure you want to change the base?
Conversation
Hi @leogoldman and thanks. (Sorry, while writing I closed the PR by mistake) I'm a bit conflicted concerning this PR, for three reasons:
I think we can take two alternative directions:
And thinking about it, the best way to go is probably to do both, whereas I want to think about it a bit more, feel free to share your opinion. |
Hi @toobaz, I think you're right, that ultimately there should be a set_font_size function, which in the case of latex would use add_custom_latex_code. I've started setting that up (changed the method I added before to a more general add_custom_latex_code method) and added a method set_font_size which changes the custom_latex_code attribute if it's input is a string. More generally, I think if you give a string size (scriptsize, small, etc.), it should just input that in the case of latex. Otherwise, I think the font size input should always be numeric (I don't want to think about string sizes as a latex user I certainly don't want html users to have to consider them). That raises the question of specifying a font size (e.g. 12pt), or a scaling factor, or a percentage. I think that a percentage makes the most sense, as font-size=X% in html seems appropriate and in general I think it's intuitive. For Latex, we could leave it at accepting just strings or add a scaling parameter that basically applies the mapping in the page you linked to, assuming that the document font size is 11pt or something. Maybe we could set that as a broader parameter (I'm thinking like rcParams in matplotlib), or maybe this is all just too much to adjust the font size, and we could just specify that numeric latex font sizes aren't guaranteed accurate. I also added a little bit so that if a numeric font size is given, it does scale in case of an html table (although it doesn't affect the title). Let me know if you have any thoughts! |
Added ability to set latex font size. Default is to not add a size specification (which is equivalent to the current output). If user specifies a latex font size, asserts that font size is string and valid latex font size.
I'm less familiar with HTML, so I'm not exactly sure the right way to create an equivalent, but I'm happy to implement something similar for setting the width percentage in the table style tag if that would help.