Message Boards Message Boards

0
|
3063 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Help importing .tex files; Why some .tex files to fail import?

Posted 2 years ago

I found two code to import .tex files:

NotebookWrite[SelectedNotebook[],  
Import["/Volumes/ExternalDocuments/Internet/Downloads/sample.tex"]]

or

NotebookPut[  Import["/Volumes/ExternalDocuments/Internet/Downloads/\
simplestampletext.tex"]]

Any comments which is better or is there another way to import.

I discovered not all .tex files can be imported giving me a rather unhelpful error msg of $Failed How can I test if a .tex file will work? What formatting is always needed to be able to import?

I have gotten the impression WL has an uneasy time with .tex files. I would think by now, WL would have a robost 'it just works' support for .tex files.

Thanks for your help.

POSTED BY: Andrew Meit
2 Replies
Posted 2 years ago

Here are attached various .tex files some import others fail. Disappointed, yet again, the doc center is incomplete what .tex files will or will not work. Supporting .tex well, I think, would be a high concern; or at least give better guidance.

POSTED BY: Andrew Meit
Posted 2 years ago

From the documentation:

NotebookWrite[notebook,data] writes data into a notebook at the current selection, setting the current selection to be just after the data written.

and

NotebookPut[expr] creates a notebook corresponding to expr and makes it the currently selected notebook in the front end.

So, "better" depends on whether you want to generate a new notebook or whether you want to augment an existing notebook.

As for limitations around importing TeX data, I really don't know, but I would be wary of dependencies on custom packages. There are different derivatives of TeX (LaTeX being probably the most common), so I wouldn't be surprised if Mathematica stumbles for some particular dialects.

If a message was generated along with the $Failed output, that might give you a clue. You might include TeX files that failed to import, and maybe someone here has enough expertise in both TeX and Mathematica to help, but that might also be stretching the purview of this community.

POSTED BY: Eric Rimbey
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract