The fact is, that in official documentation Jupyter - motivating examples stands
Equation numbering and referencing will be available in a future version of the Jupyter notebook.
I know there is a lot of discussion about this topic. There are some people who claim to solve this issue with some workarounds.
But for ordinary user it is hard to understand the workarounds, or how dirty/useful the hacks really are.
So my questions are:
what means the "available in future version"? Does it mean something like "new month/year" or something like "probably never because it is too impossible"?
If any of the workarounds provided on the Internet safe for a human consumption? I mean is it worthy? Because it is possible to use Sphinx or something else for creation of tutorials, it will be more work, but it will be more work that implementing some hacks, installing plug-ins and so on?
Note: For somebody it could seems to be a question requiring opinion based answer, but I am pretty sure it is not. Any advice can help me (or others users) to make a good/bad decision.
I believe that essentially all information relevant to this question can be found in this long Github issue thread.
The conversation there has been ongoing for (at this moment) 3.5 6.5 8 years and is still active. Important highlights:
You can very simply turn on numbering by executing a cell with the following content:
%%javascript
MathJax.Hub.Config({
TeX: { equationNumbers: { autoNumber: "AMS" } }
});
There is an extension for equation numbering.
Developer minrk has suggested that this extension is the right approach and could be merged into master (but the functionality would be turned off by default).
To install the extension via pip:
pip install jupyter_contrib_nbextensions
To install the extensions via Anaconda:
conda install -c conda-forge jupyter_contrib_nbextensions
After using one of the ways to install provided above, enable the extension:
jupyter contrib nbextension install --user
jupyter nbextension enable equation-numbering/main
Here is a working example, to be entered in a markdown cell:
\begin{equation*}
\mathbf{r} \equiv \begin{bmatrix}
y \\
\theta
\end{bmatrix}
\label{eq:vector_ray} \tag{1}
\end{equation*}
Vector **r** is defined by equation $\eqref{eq:vector_ray}$
It's self explanatory but here's some details:
\label : name describing he equation
\tag : the label appearing next to the equationcan be a number or letters
\eqref : reference to the labeled equation
This will be shown as:
Go to your Jupyter Notebook editor (I am using Anaconda right now), Edit menu, the last item 'nbextensions config'. It opens a page where you can see a list of extensions, one of which is "Equation Auto Numbering". Enable it and restart your notebook. You will see that a button appears on the top of your notebook for resetting the numbering of equations. You will need to press that button every now and then.
Related
I am using VSCode for writing Python code in a Jupyter Notebook. The relevant extensions installed are Python, Pylance and Jupyter. The problem occurs when I try to use tab to autocomplete method names for any object. For example, if the suggestion box looks like this:
and I press Tab to accept the suggestion, the object name database is repeated i.e the code looks like dataset.dataset.as_numpy_iterator instead of dataset.as_numpy_iterator. How can I remove this object name duplication? Thanks!
After wasting a lot of time searching for a fix, I tried using the latest Insider's build (instead of the stable build) of VSCode and surprise surprise - it did not have this issue. Moreover, even in the stable build, it occurs only in Jupyter Notebooks and not in standalone .py files. I am posting this as an answer so that other people don't have to waste more time on this!
It looks like provided by some extension you have installed. Such as Tabnine AI, Kite and so on. But I can't reproduce it on both of them.
I can't get to know which extension provides it in your picture, it looks like was cut off in your picture. But it does not provide by the Python extension.
I bumped into the same issue. Simply disabling and re-enabling the Jupyter Keymap extension solved my problem.
Judging from the lack of related search results, this issue seems to occur only under some rare circumstance...
My Original Error:
I am new to python and am using anaconda 4.8.3. When I try to autocomplete after math. or sentence. nothing shows up. I have tried installing both pyreadline and jedi, but both are already installed with anaconda apparently. I have not disabled or enabled anything outside of the normal process of learning to use conda, like setting up shells and feeling out how to use ipython/notebooks.
The Fix that I was able to find:
%config Completer.use_jedi = False
Put this line of code literally anywhere, I recommend making a separate text file for this specifically if you are having this issue, and you just need to run it before coding. You will need to do this every time that you open up the notebook but aside from that it is an easy fix. If you know anyone with this problem please share this with them. So far I have not found anything else that works for me, so if there is a more permanent option I would love to see it.
For ipython version 7.19.0 add the following to your ipython config file. default is at where your other profile files are lurking at
.ipython/profile_default/ipython_config.py
c.Completer.use_jedi=False
Looks like some stability issues are still being worked on.
ref IPython core.completer
I have the following issue:
I have some software that installs a particular version of IronPython to GAC. But I need to install a newer version of IronPython without affecting GAC. Hence the need for somehow using pyenv on windows with IronPython.
I am not from a programming background, more of a brick and mortar background, so please bear with me here.
[pyenv-win][1] doesn't support IronPython yet, and given my background, I have no idea how to modify a GIT repository and then install it (I'm trying to learn all that, but first I need to set this environment up, so that I don't mess things up, its a vicious cycle :P).
I downloaded a copy of the code and I was looking into how it is addressing different python versions.
It seems in [this file][2]
there are variables:
mirror, mirrorEnvPath, listEnv
that point to location of the exe that pyenv-win is using to install and maintain python version
So I somehow need to add an iron python mirror location and another array to the list that reads something like this
ironmirror = "https://github.com/IronLanguages/ironpython2/releases/download"
and add a line to listEnv
Array("ipy-2.7.9", ironmirror&"/ipy-2.7.9/", "IronPython-2.7.9.msi", "x64")_
That's how far I can get. If someone could help me put all this together, that would be nice. I have no idea how to run this modified code from my local hard drive. I would also like to somehow add this functionality to the package on GitHub as well so that others can use the same. Also, I am not sure if I am allowed to look into the code that others have shared and modify it. This is a new world for me. Apologies if that's the case.
Any help is appreciated.
[1]: https://github.com/pyenv-win/pyenv-win
[2]: https://github.com/pyenv-win/pyenv-win/blob/master/pyenv-win/libexec/pyenv-install.vbs
I used this answer to build a requirements.txt file for my Jupyter notebook. I then put both the ipynb and requirements.txt file in a Git repo and published it to Binder. As I understand, this should give me an interactive version of my notebook which I can share with people for them to play around with.
The published Binder can be found here.
Does anyone know why the interactive bit is not showing? Specifically, the sliders.
You need to enable the extension that allows the sliders, namely ipywidgets. There is an example of using ipywidgets presently here among the Binder example template repos. (If that repo gets altered, I was talking about this specific commit.)
Right now the extension gets enabled separately for JupyterLab vs the classic interface. If you just want to have your launches default to the classic interface, you can leave out the JupyterLab-related enabling.
I'm a fan of Sublime Text 3 and would like to get code autocompletion for PyTorch. However, I can't get this working yet. Any suggestions or starting points where I can begin to get this working?
I have searched in the packages repository of Sublime Text but unfortunately there's none.
Note: I have looked at a related question here IDE autocomplete for pytorch but that's only for VS Code.
Not a sublime user, but Jedi autocompletion handles PyTorch suggestions just fine.
Jedi is an autocompletion engine and should work for any Python package, including the ones in virtual environment if you set it up and including PyTorch/Tensorflow.
Anyway, sublime version seems to be missing a few things like results caching, hence you may have to wait a few seconds after issuing torch. (library is quite heavy, that's why you most probably will experience some lag). If you'd like to speed it up, I see no other possibility than changing it manually (vim plugin for jedi I am using has this option implemented, you may check how they've done it here, both jedi plugins seem to be written in Python hence should be tunable/fixable).
Oh, and if something isn't working (or maybe you would like to submit a PR request to jedi team/sublime jedi team), the community around it is quite vibrant and you should get some help (definitely better and more in-depth than here on StackOverflow).