Closed AakashGfude closed 3 years ago
thanks @AakashGfude if this approach provides enough control over the tex
I am all for it. Nice work.
this approach should also enable the introduction of styles in an easier fashion by injecting different tex
for the environment
. Perhaps we can allow for styling through _config.yml
through an option like jb_latex_code_output_style = "redbox"
as we would want to apply the style on a document wide basis.
thanks @AakashGfude the third
option looks great. It is a huge improvement and I think we should go ahead and make that the default "style".
re padding
I would actually vote without padding
style comment: I would also add a really light background to the output
block. It might be the case that they last code-block output may look like text, unless you think indentation is enough. Minimal is good if they don't look the same (at that edge case).
style comment: I would also add a really light background to the
output
block. It might be the case that the last code-block output may look like text unless you think indentation is enough. Minimal is good if they don't look the same (at that edge case).
@mmcky I had the same feeling. But, I was just copying the style of HTML blocks. There is a light background, but it is too light it seems. I will increase it a bit and see.
Merging #87 (37810a5) into master (8cc0a8a) will increase coverage by
0.93%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## master #87 +/- ##
==========================================
+ Coverage 91.45% 92.39% +0.93%
==========================================
Files 4 4
Lines 316 355 +39
==========================================
+ Hits 289 328 +39
Misses 27 27
Flag | Coverage Δ | |
---|---|---|
pytests | 92.39% <100.00%> (+0.93%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
Impacted Files | Coverage Δ | |
---|---|---|
sphinx_jupyterbook_latex/__init__.py | 95.23% <100.00%> (+0.79%) |
:arrow_up: |
sphinx_jupyterbook_latex/nodes.py | 98.55% <100.00%> (+0.72%) |
:arrow_up: |
sphinx_jupyterbook_latex/transforms.py | 92.20% <100.00%> (+0.49%) |
:arrow_up: |
@mmcky does this look better?
style comment: I would also add a really light background to the
output
block. It might be the case that the last code-block output may look like text unless you think indentation is enough. Minimal is good if they don't look the same (at that edge case).@mmcky I had the same feeling. But, I was just copying the style of HTML blocks. There is a light background, but it is too light it seems. I will increase it a bit and see.
the code-block input
background is great (as before) -- I am referring to the output blocks. If talking about the output
blocks I still can't se a background :-)
style comment: I would also add a really light background to the
output
block. It might be the case that the last code-block output may look like text unless you think indentation is enough. Minimal is good if they don't look the same (at that edge case).@mmcky I had the same feeling. But, I was just copying the style of HTML blocks. There is a light background, but it is too light it seems. I will increase it a bit and see.
the code-block
input
background is great (as before) -- I am referring to the output blocks. If talking about theoutput
blocks I still can't se a background :-)
Ooh damn. I reckon its too light.
@mmcky does this look better?
I think the indentation is probably enough to ensure it looks different to text
that may follow the last cell output.
@AakashGfude it was my screen -- I moved it to my laptop screen and looks a lot darker :-)
I can see it now on the original -- I have a crapy external display. Let's go with your initial settings. Perhaps if we parameterise this we can then let users adjust it if they want?
Yes, I reckon we can't expect the users as well to have a good display. Will need to put it in the preamble then.
@AakashGfude roger that.
Let's open an issue for style
improvements / parameterisation (more generally) and just move this forward as I think it will be great to have.
در پنجشنبه ۲۸ اکتبر ۲۰۲۱ در ۹:۵۵ AakashGC @.***> نوشت:
@.**** commented on this pull request.
In sphinx_jupyterbook_latex/theme/jupyterBook.cls https://github.com/executablebooks/sphinx-jupyterbook-latex/pull/87#discussion_r738055198 :
@@ -49,3 +49,12 @@ \DeclareMathOperator{\argmin}{arg\,min} \DeclareMathOperator{\argmax}{arg\,max} \DeclareMathOperator*{\gt}{>} + +\definecolor{VerbatimOutputColor}{RGB}{232,232,224} + +\makeatletter +\newenvironment{sphinxVerbatimOutput}
@mmcky https://github.com/mmcky it will only change those output blocks, where I have specifically added sphinxverbatimOutput. I have done that in visit_ method of CellOutput. At present, I added this environment wrapper for all CellOutputNode but will filter to do only for ones that have code text outputs and not images for example.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/executablebooks/sphinx-jupyterbook-latex/pull/87#discussion_r738055198, or unsubscribe https://github.com/notifications/unsubscribe-auth/AU3VN7H3FEW7ZOMUKLHY5CLUJDUDXANCNFSM5G3YXOEQ .
-- null
Are these changes relevant for configuring the font size?
I asked that question in https://github.com/orgs/executablebooks/discussions/730
hi @michaelosthege -- this PR was primarily related to creating a visual difference between output blocks and input blocks. This is a nice idea and it would be good to add font-size control. I am wondering though if this should be a global option
that is set in _config.yml
such that ALL code-cell font sizes are adjusted or if control at the code-cell
level is preferred.
cc: @AakashGfude
@mmcky here I have made a new
CellOutput
node instead of overridingvisit_literal_block
which I had suggested as inevitable and we had agreed upon in our chat yesterday.The present approach just wraps around
sphinxVerbatim
and provides styling. This is less invasive and prevents fiddling with existing sphinx nodes.Will change the node name to something more specific, showing this as a proof of concept in the first iteration.
Before image taken from https://github.com/executablebooks/sphinx-jupyterbook-latex/issues/10 (Left: Before, Right: After)
2nd option:
3rd option:
3rd option(with padding):