I am using ng2-pdf-viewer. pdf is not loading in viewer until I scroll the page slightly.
First time only vertical and horizontal scroll of pdf display, once I scroll the pdf then pdf get visible.
Here is the code:
<pdf-viewer src="Testing.pdf" [render-text]="true" [show-all]="true" style="display:block;"></pdf-viewer>
what is wrong in the implementation?
It makes me really annoying that the code cell in the Jupyterlab often scrolls down so that I cannot scroll down to the cell that I want:
So is there a way to stop or shut-off this scrolling within code cell?
Thanks,
I am so used to the Jupyter Notebook on the browser, that I feel VSCode's Jupyter Notebook cells are so wide. I was wondering if there is any way that I can reduce the width of the cell. Simply, how to get additional padding on both sides.
My Current VSCode's Jupyter Notebook
Jupyter Notebook in the browser
To make the cell width adjustable, View > Appearance > Centered layout.
I have a long Sympy expression that I'd like to get printed with a horizontal scrollbar beneath it. Is it possible to do so in Jupyter? I'm able to toggle vertical scrolling but I want it to be horizontally scrollable instead. The problem with vertical scrolling is that the output of sympy.pretty_print() gets badly distorted in my case. The output also looks ugly and the user has to scroll through the whole output unnecessarily.
Something similar to the np.set_printoptions(linewidth=some_large_number) and/or np.set_printoptions(threshold=some_large_number) approach can be useful but doesn't fix the problem if Jupyter's output window is itself too narrow.
The quickest solution I ended up with is inserting this line somewhere at the top of your notebook:
from IPython.display import display, HTML
display(HTML("<style>pre { white-space: pre !important; }</style>"))
If you want to change this setting for all of your notebooks, you'll need to mess around with the custom.css config file for Jupyter as discussed here.
I wasted too much time figuring this out. Hopefully I can help some of you figure it out quicker!
Iterating on Eric's response slightly, here's a self-contained version that only creates horizontally-scrolling outputs when you want it to, rather than enabling it notebook-wide:
from IPython.display import display, HTML
from pprint import pformat
def boxprint(*args):
for arg in args:
display(HTML('<pre style="white-space: pre !important;">{}</pre>'.format(pformat(arg))))
As written by Eric, changing the white-space property to pre prevents automatic wrapping of output cells, and thus forces an horizontal scrollbar for all wide outputs of the current notebook.
Unfortunately, changing this property also prevents automatic wrapping when editing input cells, which is particularly annoying when editing markdown cells. Even worse: this behavior is not limited to the current notebook, but happens on all open tabs when using JupyterLab, for instance.
The workaround I propose, is to define a function to switch between the standard behavior white-space: pre-wrap and the scrollbar behavior white-space:pre. This simple function does the job:
def hscroll(activate=True):
"""activate/deactivate horizontal scrolling for wide output cells"""
from IPython.display import display, HTML
style = ('pre-wrap','pre')[activate] # select white-space style
display(HTML("<style>pre {white-space: %s !important}</style>" % style))
On hovering right below
out[]:
in notebook you see "scroll output" . On clicking anywhere in that area you get your output scrollable both horizontally and vertically.
I recently started using Atom and try to make it as nice to work with as possible.
However I couldn't figure out how to change the height of the bottom window (a name for it would already help).
My goal is to have my console etc. as minimalistic as possible.
E.g.:
Atom's bottom window shown here with an output example from Atom-Runner
How do I only show the atom-runner's output and not the grey rest of the window on top of it?
How can I get rid of unnecessary labels like "Atom Runner: data.py"?
I found that you can change quite a bit within the styles.less file with commands like:
atom-workspace {
height: calc(...);
}
But that didn't really help me.
However I couldn't figure out how to change the height of the bottom window (a name for it would already help).
atom-runner displays its results in a bottom panel. There are a few different types of containers in the Atom window:
Panes are the content in the middle of the editor. Panes can hold as many items as you want, which are usually associated with a specific file (see TextEditors)
Docks are the expandable areas just outside the panes (the tree-view and github packages use docks). They can have multiple items and will create tabs for them.
Panels are the spaces on the edge of the Atom window. You can't hide them without disabling the whole package.
How do I only show the atom-runner's output and not the grey rest of the window on top of it?
The "grey rest of the window" is the bottom dock. You can hide it by clicking on the semicircle with the down arrow.
How can I get rid of unnecessary labels like "Atom Runner: data.py"?
I disagree that it's unnecessary, and you might some day find that you need to know what file you ran. However, if you want to do this, you can add the following to your styles.less:
.atom-runner h1 {
display: none;
}