0
$\begingroup$

I have a LaTex file, and import it this way:

tex=Import["texfile.tex"];

Now according to Help, this returns a notebook expression:

Notebook[{Cell[
   TextData[{"Question  Define the potential temperature ", 
     Cell[BoxData[FormBox["\[Theta]", TraditionalForm]], 
      "InlineFormula"], ". "}], "Section"]}, 
 StyleDefinitions -> "Article/LaTeX-Article.nb"]

But what do I do with that? I want it displayed as text. Help refers to Notebook but that is of no help really.

$\endgroup$
3
  • 1
    $\begingroup$ You can use it with CreateDocument, or you can pick it to parts and do something with the cells separately. $\endgroup$
    – Szabolcs
    Feb 9 '16 at 21:04
  • $\begingroup$ Isn't there some simple way to convert it to text, like Print[tex]? I do not want to write tons of code just to import latex, it would be almost faster to rewrite it then. Also I want to use it for part of a document (imagine first part is more easier to write in Latex the other in Mathematica (as it contains some calculations as well) so CreateDocument probably is not the best option. $\endgroup$
    – leosenko
    Feb 9 '16 at 21:22
  • $\begingroup$ Have you tried CreateDocument? I do not understand your comment. It will give you the text in a readable, copyable, editable form. $\endgroup$
    – Szabolcs
    Feb 9 '16 at 22:02
4
$\begingroup$
NotebookWrite[SelectedNotebook[], Import["ExampleData/test.tex"]]

Mathematica graphics

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.