How to display symbolic equation using jupyter notebook? - latex

I used to use ipython notebook for displaying equations while using simpy module. As can be seen from the figure below it is neat and elegant.
It seems I have made some updates and I no more have ipython notebook; every time I run it, it switches back to Jupyter (I guess that is a new name after 4). Unfortunately, printing equation doesn't work as it used to yet I can type latex as Markdown text(see figure below). Am I missing something?

So finally it is working thanks to this reddit post. I just needed to update sympy module.
pip install -U sympy

Related

Do I need to install all these 3 libs or just one? OpenCV

Have read many SOF questions about OPENCV, they all tell me what each of them is.
When I see so many different but similar names, I feel great confusion.
I thought I need to just install opencv-python, but then out of sudden, I found there is another one which looks correct to me as well, py-opencv.... Gosh which one is the correct?!!!
So my question is:
In a newly created conda environment, I'd like to add open-cv to use in my Python Jupyter Notebook. Do I need to install all of them or just one?
Them: opencv, Python-OpenCV(opencv-python), py-opencv, libopencv
One: py-opencv or opencv-python

After I've updated Latex, why I still get an error?

I am using MacTex on my Mac and try to us Texmaker as my editor.
However, when I type \usepackage{algorithms} in Texmaker, it always warn me that algorithms.sty is not found. I also tried this in Texshop, the error was the same.
I firstly checked TexLive Utility to make sure algorithms package is installed. It gives an yes. Then I tried to copy algorithms.sty from /usr/local/texlive/2015/texmf-dist/tex/latex/algorithms folder to /usr/local/texlive/2015/texmf-dist/tex/latex/base folder and execute texhash to update. Still not working and get the same error.
Can someone help me with this? Any help is appreciated.
algorithms is actually a bundle that provides two separate *packages":
algorithm
Provides the algorithm float and float-associated accessories.
algorithmic
A environment that provides a layout of algorithm pseudo-code.
So, to use algorithms, you need either or both of
\usepackage{algorithm}
\usepackage{algorithmic}

How can I generate doxygen documentation of opencv3.0 from its code

I have the source code of opencv3.0 and I want to use doxygen to generate HTML documentation for it (I know that the online documentation is available, I want generate it myself). But when I run doxygen on main folder of opencv I get nothing(just one page).
Where the documentation comments of opencv are written?
Are the documentation inside the code or they are written separately?
Maybe this can help you. I followed this instruction and got the offline document succcessfully.
http://docs.opencv.org/master/d4/db1/tutorial_documentation.html#gsc.tab=0
I had the same problem and I finally figured it out
Let's talk about Doxygen
Doxygen can read the comments of code and generate into html format with functions,
and if you want to visualize the function call, doxygen combines graphviz for you already
Doxygen GUI - Doxywizard
I prefer using Doxygen GUI (it's name is doxywizard), because it's more intuitive and instructive.
If your OS is Ubuntu 16.04, the installation is simple:
Sudo apt-get install doxygen-gui
The best thing is, every choice in expert dialog can show its description (that's why I say instructive)
Just in case you don't use something you don't want.
Doxywizard documentation
Doxywizard usage
Short Tutorial YouTube video
Personal Opinion
In my personal perspective, the OpenCV official documentation list everything
But the detail of what I want
Such as the source code of certain function, ex. UMat, the OpenCL supported version of Mat
That's a little bit pitty.

Texments package not working on Ubuntu

I am trying to use the Texments Latex package on Ubuntu to do syntax highlighting.
Texments is a wrapper around Pygments.
I installed Texments and followed the steps to add the style file to the path.
But when I try to compile the .tex file, I get the error.
!Undefined Control Sequence
and then it prints out a bunch of wierd characters and places the ? prompt.
Anybody facing this error? What is the resolution?
If there is any other better way to provide syntax highlighting of source code I would be glad to accept it.
I know there is something called "listings" but frankly, i did not find the colors so good in it.
Thanks,
Perhaps you could give minted a try … it basically does the same as texments but has more features and is a little more robust in the face of errors.
Furthermore, as the maintainer of minted I’m always glad of error reports. ;-)
Texments uses a special control sequence for pdftex to allow shell escapes, needed to call the pygmentize binary. You need to call it with pdflatex, and you need to pass pdflatex the -shell-escape switch. Cf. the texments documentation.

Using GNU Readline; how can I add ncurses in the same program?

The title is a bit more specific than my actual goal:
I have a command-line program which uses GNU Readline, primarily for command history (i.e. retrieving previous commands using up-arrow) and some other niceties. Right now the program's output appears interspersed with the user's input, which sometimes is OK but the output is asynchronous (it comes via a network connection in response to the input commands), and that gets annoying sometimes (e.g. if lines are output when the user is typing new input).
I'd like to add a feature to this program: a separate "window" for the output. I thought about using ncurses for this. But it appears from the ncurses FAQ that the two libraries are not easy to use together.
I might consider using Editline or tecla instead of Readline, but it's not clear to me if either of those will solve my problem. I'd also consider using something other than ncurses, including a library which provides both kinds of functionality (text-mode windows and command history), but I don't know what might be best.
Oh, and support for colored text might get bonus points. I suspect I may be able to do that with Readline, so maybe it's a separate concern, but if a solution to my problem also makes it easy to add a bit of color to the output, so much the better.
I'm using Ubuntu Hardy (Linux 2.6).
I've now put together a simple example program on GitHub: https://github.com/ulfalizer/readline-and-ncurses.
It supports seamless and efficient terminal resizing and multibyte/combining/wide characters. The code has helpful comments.
Screenshot below:
I have done some searching, and it seems like you are out of luck.
For ncurses alternatives there are SLang, Newt and Turbo
Vision. Slang is much more than just screen handling and thus more
complex, but maybe it can be used for your purpose?. Newt uses the screen
handling and is much simpler, but too simple and single-threaded-mode
for your purpose I think.
Turbo vision is the text mode graphics library from Borland, used by
all their tools in the late 80s/early 90s. Borland released the source
code when the market for that kind of thing diminished, and there is
now a port for linux (side note, this project seems to have written
its own turbo vision implementation). That port is not dead (there have
been some cvs updates this year which compiled fine (the older releases
did not)), but none of the TV examples I found were up to date and I
did only got a few of them to compile before giving up on the rest.
This is a bit of a shame, because TV was a lovely environment to use.
TV is btw C++ (and I assume you are using C?).
For an alternative to readline, there is libkinput, which maybe works
together with ncurses (it says it can use ncurses' terminfo. but I am
not sure if that means that it can co-exists together with ncurses usage)?
Maybe one option is to run readline "externally" to your ncurses program
using rlwrap?
This had me banging my head for a few hours, so just to save people Googling some pain:
If you're using ncurses' builtin SIGWINCH handler with KEY_RESIZE, be aware that readline sets the LINES and COLUMNS environment variables by default. These override any dynamic size calculation (usually with ioctl() TIOCGWINSZ) that ncurses would otherwise do, meaning you'll keep getting the initial terminal size even after resizing the terminal.
This can be prevented by setting rl_change_environment to 0 before initializing readline.
Update:
Here's some additional information I gleaned from the readline sources:
readline's SIGWINCH handling code (which is used if rl_catch_sigwinch is 1) does update LINES and COLUMNS, which seems like it should be sufficient for ncurses. However, when using the alternate readline interface (which makes most sense when combining readline with ncurses), the signal handlers (including the one for SIGWINCH) will only be installed for the duration of each rl_callback_read_char() call, meaning any terminal resize between two calls to rl_callback_read_char() will not be seen by readline.
So it turns out that gdb uses both readline and ncurses. If you're interested in doing this, I recommend that you check out their implementation: http://sourceware.org/git/?p=gdb.git;a=blob;f=gdb/tui/tui-io.c
I've achieved what you've described in a program of mine:
http://dpc.ucore.info/lab:xmppconsole
The following is the file handling io:
http://github.com/dpc/xmppconsole/blob/master/src/io.c
I'm not sure which version you tried. As of today(2012.09.14) It is very simple, We just need to hook our custom function to following function pointers.
rl_getch_function
rl_redisplay_function
rl_completion_display_matches_hook
I did something reasonable here.

Resources