-
Notifications
You must be signed in to change notification settings - Fork 99
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 cambridge latex style #56
Conversation
The latex function is ready for review. @astonzhang |
(1) add automatic QR code generation footnote; (2) change code and text font style; (3) reduce the figure size, and fix some style issues.
Besides, please sync changes (e.g., different background colors for input code cells and output code cells) from the master branch with updated environment (e.g., |
d2lbook/build.py
Outdated
@@ -356,6 +388,9 @@ def linkcheck(self): | |||
@_once | |||
def pdf(self): | |||
self.rst() | |||
if self.config.pdf['style'] is not None: |
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.
not equal to 'Default'
?
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.
changed to == 'cambridge'
latex_url = | ||
|
||
# Specify the latex style. We now support "cambridge" and the defaut sphinx style. | ||
style = |
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.
Can you set the default value here?So users don't need to specify style = Default if they use default style.
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.
they actually do not need to put a default there. it can be empty.
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.
Agreed that leaving it empty without any arbitrary default string is better
d2lbook/sphinx.py
Outdated
@@ -5,14 +5,17 @@ | |||
|
|||
__all__ = ['prepare_sphinx_env'] | |||
|
|||
def prepare_sphinx_env(config): | |||
env = SphinxEnv(config) | |||
def prepare_sphinx_env(config, style): |
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.
remove style
argument? See
Line 327 in cc9d457
prepare_sphinx_env(self.config) |
d2lbook/sphinx.py
Outdated
def prepare_sphinx_env(config): | ||
env = SphinxEnv(config) | ||
def prepare_sphinx_env(config, style): | ||
env = SphinxEnv(config, style) |
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.
remove style
argument
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.
done.
Thanks for adding this new feature! |
add Cambridge latex style.
We can use the following command to invoke the Cambridge latex:
d2lbook build pdf --style cambridge