Using an ipython laptop for engineering computing

I am a civil engineer, and I need to make calculations that basically look like a report with a combination of text, tables, mathematical expressions, etc. ... These calculations are very repeated so when I come up with a beam for example, in addition to the number , The result is the same.

At the moment, I am trying to do the calculations, and then write them down either manually or in an open office document. To perform some repetitive calculations, I sometimes use the Ipython laptop along with some python modules I wrote.

Now it would be very neat to use my calculations in the Ipytrhon laptop directly to get the result. The output may be a PDF document.

So the appearance of nbconvert really interested me, I still need to work a little bit on understanding the templating bit.

So, to get there, I need:

  • For my module functions to output some kind of latex - I have to be fine with this
  • Format the output of nbconvert as I want. I found this Writes IPython Notebook in HTML or PDF Table of Contents and this Suppress Code in NBConvert? IPython Can anyone point out more comprehensive tutorials? Is there a way to selectively show or hide some code blocks from input? Something like this in the input cell would be fantastic:

    /hide Boring code //hide Interesting python code I want to show 
  • Find a way to insert PDF Number of pages Sometimes I will need to insert other things, such as drawing or even something by hand, and it would be nice to be able to write a small function like insertmypdf (pathtomy / Document.pdf). So when I execute nbconvert, it automatically inserts the pages.

Am I dreaming? If you could point me in the right direction, I will be grateful. Ideally, all the time when I spend reprintable things that I counted, they could be replaced by

 ipython nbconvert --to=latex --template=latex_template.tplx --post=pdf file.ipynb 
+6
source share
1 answer

Can anyone point out more comprehensive tutorials?

You may accuse me (among other things) of not writing them, but since the API is still slowly changing, we are reluctant to write documents that will soon become obsolete, but I wrote some things in the past that may give you some ideas . The Damian Avila blog can also be a good resource, because it uses its own templates to hide / show code cells and wrote about it in some of its posts. I also saw this one , but have not yet fully read it.

Is there a way to selectively show or hide some code blocks from the input?

Either using cell-level metadata or a markup language, yes, but templates require special code, you will probably find out by reading the links above while you immerse yourself in the nbconvert architecture. But it will not be one liner.

3) will be more complicated, but I suppose you can do it with custom filters in the markdown cell

You, although feedback on the process, are always welcome.

+5
source

All Articles