Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include cell outputs in the latex build. #1065

Open
rodrigogiraoserrao opened this issue Oct 30, 2020 · 7 comments
Open

Include cell outputs in the latex build. #1065

rodrigogiraoserrao opened this issue Oct 30, 2020 · 7 comments
Labels
enhancement New feature or request

Comments

@rodrigogiraoserrao
Copy link
Contributor

Is your feature request related to a problem? Please describe.

When I generate a .tex file, the code outputs are not added to the file, only code inputs. In #810 @mmcky has mentioned that this is being worked on.

I suspect it's because the metadata of the cells are different, but "code outputs" from code that errors seem to be getting included in the .tex file while regular outputs don't.

Describe the solution you'd like

I would like code outputs to be included in the .tex file as well.

Additional context

Two code cells whose outputs were not included:

Screenshot_1

And a code cell whose output was an error and was included:

Screenshot_2


I would be up for helping on this, but I am not sure who is working on this.

@choldgraf
Copy link
Collaborator

Hmmm, that's weird - I feel like this wasn't an issue before, maybe it is a regression? @mmcky do your latex builds not work for quantecon anymore?

@rodrigogiraoserrao
Copy link
Contributor Author

rodrigogiraoserrao commented Oct 31, 2020

The quantecon example uses the Python kernel, does it not? I don't. And we've seen that Jupyter Book sometimes handles different kernels in different ways. Cf. #1043

@choldgraf
Copy link
Collaborator

ahhh interesting...can you paste the MIME bundle of an output that is not being included? (e.g. each cell in the JSON has an outputs list that contains each output from running the cell. That's the thing that we're parsing and deciding what to do, I bet that's where the problem is

@mmcky
Copy link
Contributor

mmcky commented Nov 2, 2020

hey @RojerGS and @choldgraf. Outputs do typically get included (as the pdf artifact on quantecon-mini-example shows). The style needs to be improved to make in and out clear but that is something we are working on for the LaTeX theme support.

@RojerGS if you're able to share the MIME bundle details / kernel information / minimal example that would be helpful.

@rodrigogiraoserrao
Copy link
Contributor Author

@mmcky you can find a MWE in the same repo I used for issue 1043 (repo link). That repo is nice because it has a short python and a short APL notebook, so you can compare both outputs.

The cell above that got included (with the RANK ERROR) has the following json in the .ipynb file:

  {
   "cell_type": "code",
   "execution_count": 310,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "RANK ERROR\n",
      "Frame[4] f[1 r;1 c]←2 2⍴⎕UCS 9484 9488 9492 9496\n",
      "\n"
     ]
    }
   ],
   "source": [
    "Frame 'We are not out of the wood'"
   ]
  }

One of the cells included in the screenshot above whose output was not included follows:

  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<span style=\"white-space:pre; font-family: monospace\">1\n",
       "</span>"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "AMHM times"
   ]
  }

I trust this was the info you were requesting? Feel free to ask for more clarifications if needed.

@rodrigogiraoserrao
Copy link
Contributor Author

The APL kernel I am using is the Dyalog Jupyter kernel available on GH.

Inside the Jupyter interface, using the menu to go to Help > About shows little info about the kernel:

Current Kernel Information:

Dyalog APL kernel

@mmcky
Copy link
Contributor

mmcky commented Nov 12, 2020

@RojerGS ok I know why this is happening. It looks like the mime type of that missing output is html which isn't a mime type that the current LaTeX builder knows how to parse so isn't listed in the current nb_render_priority list of options. Is there a way to alter the output from Dyalog to return a different markup type? If we added text/html to this list it would add the actual html source to the LaTeX document.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants