Search code examples
pythontexnbconvert

Jupter notebook to tex to pdf without cell content


I am not entirely sure whether this is the right forum (tag) for this question, so my apologies if it is wrong. The problem I face is the following:

I am creating a report that I will be genreating for a number of customers. In it I have a number of statitics about product, visualizations, tables etc. those are created using connections of BigQuery in GCP and using python. In the best of worlds i would tag all computation and data retreival cells with at tag hide-input, use jupyter nbconvet and create a pdf-report. Unfortunately, this does not work due to limitations in my environemnt.

However, I can convert my notebook to *.tex and then convet that file to a pdf-files. But, in this case, all cells are visible.

Does anyone know how to hide content of a tex-file during the conversion to pdf?


Solution

  • Did you try the \iffalse command? This command is commonly used to create a block of code that LaTeX will ignore.

    \iffalse
    \begin{pythoncode}
    # Python code here or the content you want to hide after generating your report or whatever you want to hide!
    \end{pythoncode}
    \fi