Extra vertical bar when rendering subscript using inline Latex in iPython Notebook - latex

So, I'm trying to get the hang of using inline Latex in iPython Notebook, and I get a funny rendering of even the simplest of code to just add a subscript:
code in my markdown cell: The slope $J_1$
renders like this:
I notice that when I first open the notebook, as the page is loading, the subscript displays properly (no vertical bar) but only briefly, but when the page is fully loaded, the rendered result changes and shows the vertical bar. The font appears to change in that process as well.
I've also downloaded other people's notebooks that use inline Latex, which look fine when viewed with the Jupyter nbViewer online;
(for example, http://nbviewer.jupyter.org/github/rszeto/umich-eecs545-lectures/blob/master/lecture02_linear-algebra-optimization/Lecture%202%20-%20Linear%20Algebra%20and%20Optimization.ipynb renders fine, but if I download the notebook and look at it with my local Jupyter viewer, I see the same vertical bar thing happening for subscripts in the Latex bits of the notebook)
I'm running iPython ver 4.0.1, viewing the notebook using Chrome (Version 48.0.2564.109 m) running on Win 7.
Is there a fix to render things properly? I don't see the vertical bar problem when I open the notebook using Internet Explorer.

Related

No instant preview anymore for tikz pictures in LyX; reset previews?

I'm inserting figures into my LyX document by adding a graphics float, then an instant preview window inside the float, and a tex code window inside of that preview window. Here I put my tikz code.
It has been working fine until I changed the code of one figure. Since then, all figures are not anymore shown as previews in LyX. I undid the changes, deleted the LyX temp folders, but previews are not showing up. Compiling the document, however, works just fine.
When I slightly modify the tikz code of a figure, e.g. by adding a % at the and of any line, this figure can be previewed again. I'd rather not add a % to every figure in the document - is there any way to reset all previews in the LyX document without deleting the tikz code?

How to include cursor with page screenshot captured via Electron's capturePage API?

I’m attempting to capture a screenshot of a webview via calling its webContents’ capturePage method. I had assumed that a cursor would be included with the screenshot, but it’s not.
Any ideas on how best to achieve including a cursor with the screenshot taken via a capturePage call?
TL;DR: webContents.capturePage () won't include the cursor because the screenshot is not made on an OS-level.
Electron takes the screenshot directly after Chromium has rendered it, which is also why the rect property to the function cannot be bigger than the window's inner width and height, i.e. the window decoration, such as titlebars, etc., cannot be included in the screenshot.
What Electron does is to take the binary image data which is output to the graphics processor of your computer (and thus to your monitor), and writes it to a PNG or JPEG file.
Including OS-specific elements such as cursors or window decorations would involve a platform-specific approach (as there is no unified API to take screenshots throughout Linux, Windows and Mac OS), which creates (possibly) more dependencies and more noise. The rendering done by the Chromium engine is platform-agnostic and thus the way easier approach.

Strange text in matplotlib window under Docker

I'm running matplotlib in a Docker container on my MacBook. When I use plt.show(), it pops open the window on my screen and the figure I've created is just fine, but the text at the lower-left is gibberish (see example, below). How can I get it to show the usual x,y position of the cursor?
Some additional details:
It's a Centos 7 base docker image with our code layered on top. To keep the size down, we don't install the kitchen sink. Perhaps a package or two is missing?
The effect is observed no matter what I plot.
This is using matplotlib 2.0.2 installed via Conda.
The default backend (according to matplotlib.get_backend()) is apparently Qt5Agg.
I get a reasonable result if I use the TkAgg backend.
Qt5 is coming from Conda.

MathJax fraction rendering issue with zoomed page

I'm rendering the following line in a markdown cell in an IPython notebook (OS 10.8.2, Google Chrome browser):
$$\frac{d}{dx}g(x) = f(x)$$
At the normal zoom level, it looks like this
I'm trying to use this in a webcast and want to apply zoom to the screen
Blockquote
. At the zoom level I want, the fraction rendering gets ugly.
Is there a way to control this?
Does not seem to be an IPython issue, I can reproduce it here :
http://util.io/mathjax
with {\partial \over \partial x}g(x)
Is it just to have the math bigeer or the all page ? You can try to change the zoom factor of equation in mathjax option/right click. Notebook server does not yet expose configuration for that though.
This is a bug in Chrome, but there is a work-around in MathJax v2.1. I suspect you are using an earlier version, so if you update that, it should resolve your problem.
The issue only exists in Google Chrome. It renders properly in Safari:

Generating simple plots within LaTeX

I want to draw a couple of simple bar plots to include in a LaTeX document.
For some reason (unless im missing something), there doesn't appear to be a simple way to generate bar plots in LaTeX.
I could of course generate them in Excel and save them as PDF, but I'd rather have the flexibility of doing them dynamically in LaTeX.
I looked into TikZ, but it seems nobody on the interwebs is using it for a measly barchart (which is what I need it for), and the code below generates a barplot without any axis:
\begin{tikzpicture}[scale=2]
\draw[ycomb, color=gray,line width=0.5cm]
plot coordinates{(1,1) (2,2) (3,3)};
\end{tikzpicture}
What do you use? Am I doing something horribly wrong?
I'd say you want pgfplots: this is built on top of Tikz as a proper plot-drawing interface.
I do not know if you're familiar with gnuplot, that can generate bar plots. There is a "TikZ terminal" (something that outputs TikZ-code) for gnuplot, however, as far as i know, you have to compile it yourself in order to get it working.
I think there's also another "LaTeX terminal" generating pstricks (?) code or something similar.
Can I point you towards Asymptote (Wiki, Gallery). You can make professional looking graphs offline from LaTex processing, but being LaTeX aware. It is a full blown C-ish language for vector graphics and function graphing. The output eventually is encapsulated postscript (eps) which can be displayed directly into LaTeX documents.

Resources