Group Abstract Group Abstract

Message Boards Message Boards

0
|
4K Views
|
6 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Failed to import LaTeX file into Mathematica

Posted 3 years ago

On Ubuntu 20.04.3 LTS, I try to import the following LaTeX file into Mathematica:

$ realpath MS.tex 
/home/werner/Downloads/2108.06678/MS.tex

In Mathematica, I use the following command:

A = Import["/home/werner/Downloads/2108.06678/MS.tex", "Notebook"]
NotebookPut[A]

But the following error is triggered:

enter image description here

Any hints for fixing this problem will be highly appreciated.

Regards, HZ

POSTED BY: Hongyi Zhao
6 Replies
Posted 3 years ago

I see. Thank you for your advice and help.

POSTED BY: Hongyi Zhao

There must be something offending in your file MS.tex. If it is really important to you, you may try to track down the problem by removing parts of the TeX file and see what happens.

POSTED BY: Gianluca Gorni
Posted 3 years ago

Indeed, I retested using the following example file:

$ realpath example.tex 
/home/werner/test/example.tex

$ cat example.tex 
\documentclass{article}
\begin{document}

The well known Pythagorean theorem \(x^2 + y^2 = z^2\) was 
proved to be invalid for other exponents. 
Meaning the next equation has no integer solutions:

\[ x^n + y^n = z^n \]

\end{document}

The results show that all the methods discussed here are vaild:

NotebookPut@Import["/home/werner/test/example.tex", "TeX"]

or

NotebookPut@Import["/home/werner/test/example.tex", "LaTeX"]

or

A = Import["/home/werner/test/example.tex", "TeX"]
NotebookPut[A]

or

A = Import["/home/werner/test/example.tex", "LaTeX"]
NotebookPut[A]

See the following screenshot for more details: example.tex

POSTED BY: Hongyi Zhao

Does it fail for that particular TeX file only? Have you tried with a minimal TeX file?

POSTED BY: Gianluca Gorni
Posted 3 years ago

Still failed, as shown below:

enter image description here

POSTED BY: Hongyi Zhao

You may try

NotebookPut@Import["/home/werner/Downloads/2108.06678/MS.tex", "TeX"]
POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard