Use ams math style in Jupiter notebook - python-3.x

I am learning how to do equation numbering using ams math in local Jupyter notebook. As per the documentation, it says to make changes in _config.yml file. But I am not sure where to find it on my Mac. If it helps, I have the file jupyter_notebook_config.py in ~/.jupyter directory. But they don't look the same.
Can I kindly get some help here (example'll be appreciated), how to work with _config.yml file. thanks in advance.

The documentation you linked to is for a project called jupyter-book. If you're using that, then, as #MattDMo said, follow the example from the tutorial and add the _config.yml in the folder that contains your book.
If you're using a regular Jupyter Notebook, you can disregard that and just write the LaTeX in a Markdown cell, where it will be rendered (by MathJax rather than MyST), without any extra config.

Related

Github isn't displaying my embedded images in my Jupiter Notebook

I uploaded a Jupyter notebook to GitHub with some screenshots that I embedded into markdown cells using the following format:
![Step1](Images/Step1.png)
However, when trying to view the notebook on GitHub, none of the embedded images appear. Is there something I can do to mend this?
I do not want users to have to run a Python code block to display the image. They are screenshots of different steps in a "getting started" guide I made, so I want them to appear in Markdown cells.
This is just a shot in the dark, but does your relative filepath need to point to the root directory? Like this:
![Step1](./Images/Step1.png)
That's my best guess.
If the images are posted on Github, open the image in a new tab, and copy the URL like so (Put in the actual link; I just added ellipses to redact the repository name):
![Step1](https://raw.githubusercontent.com/ ... /main/images/Step1.png)

Adding internal links (TOC) to long .py script?

I am working on a 3D Slicer module and it's getting quite long. I was wondering if there is a way to add a table of contents at the top that provides internal links to parts of the .py script.
I have read through the Sphinx docs and haven't found any other similar packages.

No class names in Uml diagram generated by pycharm

I was generating uml by using pycharm, but when i tried to do it, user classes has no title, even though when refactoring it is showing actual class names.
how can i resolve this?
open the class folder as the project.
I am using the most up to date version of the software PyCharm 2017.2.3. I have found a solution by creating a new file using PyCharm, then copying and pasting my code in to it.
The problem occurs with files that are created using Python Idle 3.6.1 Shell.
Might not be the case for you, but what worked for me was renaming the file I was trying to create a diagram from to one that does not include a whitespace character
(Pycharm version: 2017.3.2)

Tabcompletion and docview while editing rc.lua

I saw that there is a lua plugin for eclipse and there is a docpage on the awesome main page api_doc and all the .lua files in /usr/share/awesome/lib.
So I thought it must be possible to create a Library or Execution Environment so that one has tabcompletion and docview.
So I tried making my own Execution Environment:
wrote the standard .rockspec file
downloaded the documentation made an ofline version of it and put it in docs/ folder
ziped the files and folders in /usr/share/awesome/lib
ziped all up
tried it out ... and it failed.
When I try to view a documentaion for a .lua file I get "Note: This element has no attached documentation."
Questions: Am I totaly wrong in my doing (because I have the feeling I am)? Is there any way to edit the rc.lua with tabcompletion and docview?
Koneki will probably take a while to setup, but it's definitly worth it. Going for the".doclua"(by using version 1.2) would certainly make it, but I doubt that using a script to generate the information you need, would work out on the long run.
Most likely, you'll probably pass a bit of time to define what kind of object you're dealing with every time you come across one. The right to do, would be to actually take the time to see if the object/module/inner type inherit from an another object, so can actually have more completion feature as you keep using autocomplete to go from one object to another by pressing "dot"+ctrl_space.
In an ideal world, one person could probably make it right and share to other, so they can enjoy a full featured autocomplete editor.
Found solution for eclipse.
First off the idea of setting up an Execution environment was the wrong one.
So the whole thing about downloading the doc although.
For more information on that visit eclipse Wiki for LUA Development Tool.
The right thing to do is to add a source folder which contains the /usr/share/awesome/lib directory.
The bad news is that my comment from above was totally right, which means one has to configure each .lib file in /usr/share/awesome/lib to meet the requirements of the Documentation Language described here.
Than editing the rc.lua (which one can add to the project in eclipse) works with tabcompletion and doc view.
Since the Documentation Language used in the lib files is similar to the one used by "LUA Development Tool" one has not to change many things. Maybe there are even scripts for that.

Convert Google Docs to Jekyll Markdown

How can I convert a Google Docs, which contains images and tables, into a Markdown file which can be published as a post using Jekyll?
Is it possible to first export the Google Docs into a PDF and then convert the PDF to Markdown? What will happen to the images and tables in that case?
May 2018 Update
The script originally suggested in this answer appears to no longer work and has not been updated for 5 years.
An alternative solution (which is based on the old script) can be found at https://github.com/evbacher/gd2md-html
I tried it out, it works pretty well.
Previous Answer
You can use a Google Script to do the conversion for you!
This one will let you convert to .md and it will email you the converted file. I've tested it and works fine. It works with basic tables, and if you have images in the doc, it will attach them to the email.
Instructions for installing are on the same link, in the GitHub description, but I pasted it here for ease of access:
Add the script:
Open your Google Drive document (http://drive.google.com)
Tools ->
Script Manager > New
Select "Blank Project", then paste this code in
and save.
Clear the myFunction() default empty function and paste the
contents of converttomarkdown.gapps into the code editor
File -> Save
Run the script:
Tools > Script Manager
Select "ConvertToMarkdown" function.
Click Run
button (First run will require you to authorize it. Authorize and run
again)
Converted doc with images attached will be emailed to you.
Subject will be "[MARKDOWN_MAKER]...".
Good luck!
You can export as HTML. Jekyll can serve static HTML files.
Btw, "standard" markdown doesn't have tables. There are implementation that have it, but I'm afraid you'll have to convert them by hand to the right format, which will be implementation dependent. I don't know about Jekyll, maybe it's easiest to just use HTML tables within the markdown text.
You could create a new theme based on the HTML export. The export should contain the stylesheet embedded in a <style> tag within the HTML document. It's not really easy to create new themes, but doable. Or, if you just want the content and don't mind using whatever Jekyll theme you already have, then you can cut out the stylesheet part and keep the html only.
Another option would be to change how files are delimited in Excel on your computer. This guide can help you do that (http://www.howtogeek.com/howto/21456/export-or-save-excel-files-with-pipe-or-other-delimiters-instead-of-commas/)
Then every time you copy and paste from excel to a markdown file/jekyll you automatically have the pipes. All you will need to do is add some dashes to separate your topline..
Google Docs -> docx to Markdown -> md
I myself looked far and wide but I believe the best way to do this is by using Pandoc.
Works for all platforms (check their incredible website ) , what you are looking for is the following command on your cmd or PowerShell (Windows) :
pandoc input_filename.docx -s -o output.md
Pro Tip:
Pandoc comes with a little trick to store up even all of the images in your document to your custom folder and then adding the image tags in the markdown by using relative referencing to those images at the correct places. The amazing line of code is:
pandoc --extract-media ./your_custom_folder input_filename.docx -o output_filename.md

Resources