I had a fresh install of miniconda, sympy, spyder, qtconsole, matplotlib, and tried out sympy under spyder. However, the output of anything from the console freezes the kernel, making the session irresponsive:
Notice the red square at the upper right corner, indicating evaluating never stops. If I turn off pretty_print, the output can appear:
I have latex installed and work fine. I tried playing with init_printing but nothing works unless I turn off pretty_print. I do need the output to be readable. I uninstalled and reinstalled but no luck. How do I fix the output problem for pretty_print? The system is windows 10, and everything is default latest version as of 7/10/2021.
I ran into the same problem, and I got around it by explicitly calling init_printing(use_latex='mathjax'). As the doc below indicates, by default use_latex=None and sympy should be able to find a latex rendering option automatically, but it seems to fail to do so and somehow gets stuck.
use_latex : string, boolean, or None, default=None
If True, use default LaTeX rendering in GUI interfaces (png and
mathjax);
if False, do not use LaTeX rendering;
if None, make a guess based on the environment;
if 'png', enable latex rendering with an external latex compiler,
falling back to matplotlib if external compilation fails;
if 'matplotlib', enable LaTeX rendering with matplotlib;
if 'mathjax', enable LaTeX text generation, for example MathJax
rendering in IPython notebook or text rendering in LaTeX documents;
if 'svg', enable LaTeX rendering with an external latex compiler,
no fallback
Related
I am trying to embed LaTeX formulas inside Markdown cell in a locally running Gorilla worksheet. For example, the following Markdown text should render an inline formula and a standalone formula:
This is an inline formula, ##\sin(x)##, and this is on its own line:
$$\int_0^{2\pi}\sin^2(x) \textrm{d}x$$
However, when I run Gorilla locally (using lein gorilla) what I see is the raw code. Markdown itself is rendered absolutely fine. On the other hand, when pushing the worksheet to GitHub and using an online viewer LaTeX formulas are rendered as expected.
Gorilla's documentation is saying the following, which I'm not sure I fully understand:
Note: currently you will need to be online in order for LaTeX to render properly.
What I thought is that it means that I have to have a network connection while trying to render LaTeX, but, if this is indeed the meaning, than I do not understand why it is not working. Another meaning I could think about is that currently LaTeX can only be rendered with the online viewer, but this interpretation dose not make much sense to me.
Any ideas? Thanks to any one pointing me to the right direction!
With some help I have found the solution to this problem—I was using an outdated version of lein-gorilla plugin. With version 0.5.3 LaTeX is rendered just fine[1]. The exact plugins line in project.clj should be similar to
:plugins [[org.clojars.benfb/lein-gorilla "0.5.3"]]
Also, it seems I was not aware that I could use the app-gorilla template for creating gorilla projects (I was using lein new app and then manually edited project.clj to add the plugins line). The command
$ lein new gorilla-app <project-name>
generates a project.clj file with the right version of the lein-gorilla plugin already in the file.
I guess this is the right way for creating gorilla apps, and that it ensures that the plugin will always be up to date.
[1] Some very specific LaTeX formulas seems to have rendering problems, but it needs some more testing and maybe a separate question.
I am running Jupyter with a Python 2.7 kernel and I was able to get
nbconvert to run on both the command line (ipython nbconvert --to pdf file.ipynb) as well as through the jupyter browser interface.
For some reason, however, my file only prints 4 out of the 8 total pages I see on the browser. I can convert an html preview (generated by Juypter) file, and then use an online converter at pdfcrowd.com to get the full pdf files printed.
However, the online converter is lacking in latex capability.
When I installed nbconvert, I did not manually install MikTex latex for windows, as I already had it successfuly installed for Rstudio and Sweave.
I didn't want to mess with the installation.
I printed a few longer files (greater than 4 pages), without latex and a few that had latex and printed the first couple of pages fine. But that last few pages always seem to get cut off from the pdf output.
Does anyone know if that might be causing it to limit the print output, or any other ideas why?
Also, I do notice the command line prompt where jupyter is launched has a few messages...
1.599 [\text{feature_matrix}
] =
?
! Emergency stop.
<inserted text>
1.599 [\text{feature_matrix}
] =
Output written on notebook.pdf (r pages)
[NbConvertApp] PDF successfully created
I ran another file and saw the output showed
!you can't use 'macro parameter character #,' in restricted horizontal mode.
...ata points }}{\mbox{# totatl data points}}
?
! Emergency stop
Look like it is somehow choking on using the latex character #
then halting publishing. But it at least publishes all the pages prior to the error and emergency stop.
While not a solution, I manually changed the latex symbol # to number and
the entire file printed. I wonder if this is a problem with my version of latex maybe?
halted pdf job
$$\mbox{accuracy} = \frac{\mbox{# correctly classified data points}}{\mbox{# total data points}}$$
passed pdf job
$$\mbox{accuracy} = \frac{\mbox{number correctly classified data points}}{\mbox{number total data points}}$$
edit: if it help anyone, I used the suggestion here, to use a backslash escape character before the #, to solve the issue; so it looks like it is a latex issue, if that helps anyone.
I want to use Latex to create greek symbols in plot labels. However any attempt to set e.g.
rcParams['text.usetex'] = True
or any other version of this I could find, results in a screen full of errors even for plots in which labels aren't even used. If I set it back to False everything is fine. I know I should "post my attempt" but I emphasize that every example on this forum and any other webpage I can find that claims to achieve the objective fails.
The final error on the pages of errors is that type1cm.sty is not found. Using tex Live utility I see I have it installed.
Would appreciate help for novices here as I am not exactly computer savvy.
In response to below - I am using a Mac OSX version 10.9.5. The usual program I use for my Tex stuff is TexShop version 3.18.
Since it would appear that the iPython notebook is having problems with finding the type1cm.sty file, I would assume there is some method to tell it how to find it.
I'm using eclipse for coding C++ and Java. When declaration or definition is shown, background is black. It happens only in C++ srouce file. I dont have this problem while editing Java source files.
I have installed Eclipse Color Theme. I'm not able to find where i can set background color of this window. I have been searching in General/Appearance/Colors and Fonts and C/C++/Editor/Syntax Coloring without result.
Switching to a clean workspace might help but I found the curprit if you want to manually edit it. Look in:
[my workspace]/org.eclipse.core.runtime/.settings/org.eclipse.cdt.ui.prefs
for
sourceHoverBackgroundColor.SystemDefault=false
and make it "true". Restart Eclipse. Of course this assumes that your system default background colour is not black.
I had this problem because I installed this plugin. I tried out the themes but when I decided on the original and swapped back to it the tool tips were broken in this fashion. Unfortunately the only way I managed to fix it was by "reinstalling" eclipse.
I have been using emacs for a while for mainly python programming, and have started C++ coding with it. When I open a c++ file, it opens without problems with c++-mode. The background and foreground colors are normal for the theme I have with color-theme, but keywords and strings are not colored differently. Below is the code in my .emacs to initialize color-theme.
(add-to-list 'load-path "D:\\emacs\\color-theme-6.6.0")
(require 'color-theme)
(color-theme-initialize)
(setq color-theme-is-global t)
(color-theme-hober)
I have not put in any code for c++. Any ideas?
Edit: I tried turning off color-theme to see if at least then there would be some coloring, and there was not, even after ensuring font-lock-mode was on. Also, this is GNU Emacs 23.1.1
Place the cursor over a keyword and do M-x describe-face. The face should be identified as font-lock-keyword-face and the description of the face given. At that point it should be easier to determine whether the keyword has the wrong face, or the face just has a default appearance. You could also double-check that font-lock-mode is on with describe-mode.
I finally got syntax highlighting by removing a folder called site-lisp from the folder d:/emacs. My Emacs installation is in d:/emacs/emacs-23.1, and somehow it was reading from these files. So, removing this folder forced Emacs to use the correct ones, I think.
(font-lock-mode) should help (with non negative argument to make sure it's turned on)
Generally this should work straight out of the box on a standard install - to verify start emacs with the "-q" option to avoid loading stuff from your init file. I have verified this with a quick install (on XP Pro) of the official 23.2 binaries. Here's the output: (apparently can't post images due to low reputation - the link is img444.imageshack.us/img444/2680/46117077.png).
If this displays code as you expect, then there's an issue with your init file - I suggest using the standard approach of commenting everything out and selectively adding things back in, until you come across the offending line(s).