Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Here is a workaround, which allows me to paste latex commands into a computation cell, evaluate and display the results within the notebook.

First, in a separate input cell, load the latex packages that you need to deal with the latex code from the original document, e.g.:

Setup latex to allow copy and paste from latex document, while showing the reference names

latex.extra_macros('') latex.extra_preamble('') latex.add_to_preamble('\usepackage{amsmath}') latex.add_to_preamble('\usepackage{amssymb}') latex.add_to_preamble('\usepackage[natbib=true]{biblatex}') # natbib=true, because the original document uses \citet and \citep latex.add_to_preamble('\addbibresource{/path-to/MyLibrary.bib}') latex.add_to_preamble('\usepackage{hyperref}') latex.add_to_preamble('\usepackage[]{showlabels}') # To display equation labels on the side

Then, in every input cell, I first enter the following code, followed by the copied and pasted latex code:

%hide %latex \renewcommand{\ref}[1] {\url{#1}} % to print names of references

Here is a workaround, which allows me to paste latex commands into a computation cell, evaluate and display the results within the notebook.

First, in a separate input cell, load the latex packages that you need to deal with the latex code from the original document, e.g.:

Setup latex to allow copy and paste from latex document, while showing the reference names

latex.extra_macros('') latex.extra_preamble('') latex.add_to_preamble('\usepackage{amsmath}') latex.add_to_preamble('\usepackage{amssymb}')

latex.extra_macros('')

latex.extra_preamble('') `

latex.add_to_preamble('\usepackage{amsmath}')`

latex.add_to_preamble('\usepackage{amssymb}')`

latex.add_to_preamble('\usepackage[natbib=true]{biblatex}') # natbib=true, because the original document uses \citet and \citep latex.add_to_preamble('\addbibresource{/path-to/MyLibrary.bib}') latex.add_to_preamble('\usepackage{hyperref}') \citep`

latex.add_to_preamble('\addbibresource{/path-to/MyLibrary.bib}')

latex.add_to_preamble('\usepackage{hyperref}')

latex.add_to_preamble('\usepackage[]{showlabels}') # To display equation labels on the side

Then, in every input cell, I first enter the following code, followed by the copied and pasted latex code:

%hide %latex \renewcommand{\ref}[1] {\url{#1}} % to print names of references