# Transitioning to Mathematica Documents from $\LaTeX$

There is no doubt that Mathematica can produce well formatted documents. For example An elementary introduction to the Wolfram Language was written in Mathematica. With v.11's new addition of spell-checking and the somewhat dated nature of TeXForm, one could consider switching from $\LaTeX$ to solely using Mathematica. Having never produced a document (e.g. paper, book, etc) in Mathematica my question goes out to who are experienced in doing so.

1. Is it wise / advantageous to use Mathematica for document formatting (i.e. are there any significant advantageous of $\LaTeX$ to Mathematica, and

2. What is/are the best resource(s) for making such a transition.

• its not wise if you wish to publish your content, printing and export options are not good (generated pdf and html content looks terrible) – M.R. Oct 16 '16 at 19:20
• If your document is going to utilize the computational interactivity of Mathematica, then that's the way to go. But if it is a static document, it's going to be hard to beat LaTex. – bill s Oct 17 '16 at 1:25
• You may be interested in this alternative: Highlighting Mathematica code in $\LaTeX$ document. I think @halirutan's answer says it all. – Jens Oct 20 '16 at 4:15

Since no one dares an answer, let me make some statements that you probably won't like since you seem keen to switch to Mathematica. I don't think this is a good idea. It is just not the right tool for this.

My background is academic, I'm using Mathematica on a daily basis and I love it. For writing I'm using LaTeX for manuscripts and persistent documents, Word for small things like lists, short protocols, Markdown for things I don't need to share with the Windows world and Adobe Indesign when I need fine-control of positioning boxes and when the outcome is for instance a poster or a magazine. My toolbox is therefore rather large and I'm choosing my tools with regard of (1) content, (2) audience and (3) possible collaborators. I hope I can give somewhat objective reasons that this

There is no doubt that Mathematica can produce well formatted documents

might be right in some sense, but is in general not the case when you want to create high quality documents like books or articles. Additionally, there are other things you should certainly think about.

## Layout and Beauty

One strength of both, LaTeX and Mathematica is that one can type formulas. Nevertheless, the question and a somewhat personal opinion is whether you really think if this

comes aesthetically even close to this LaTeX output

For me it doesn't and I want to make clear, that I'm not angry with Mathematica because it is not a typesetting system like LaTeX. The far greater advantage of a typesetting system is, that it really calculates how the characters a placed on the page to ensure a very pleasing and evenly bright page of text. There are many descriptions why and how LaTeX is so good at this but let me partially quote from here.

LaTeX has a large set of metrics that it evaluates against when generating your document. It experiments with various permutations of parameters and determines the one which gives the "nicest" output.

It can take the time to do this because it isn't interactive. Word processors don't have the computational resources available (yet) to carry out the equivalent calculations and still remain interactive. Also, many people forget that typesetting is actually a professional skill - people train for years to learn how to layout publications.

I won't go into detail any more, but from the aesthetic point Mathematica cannot compete with LaTeX or Indesign as it is strictly speaking rather a word processor. I admit, that people have different views on what is beautiful and therefore let me give some hopefully hard facts you should consider before you switch from LaTeX to Mathematica for creating articles and publications.

## Why you shouldn't switch to Mathematica

### LaTeX has a clear separation of content and style

Well, this is one of the old arguments and was discussed far too often. Still, it is true:

When producing your LaTeX document, you are concentrating on the content itself. You introduce structure explicitly by telling LaTeX when a new section begins, for example, but you don't then faff around trying to decide how the section headers should look. That's done later.

I know that you can achieve the same when you force yourself to use Mathematica stylesheets consistently, but ask yourself: are you willing to resist the urge to center this formula and edit the stylesheet instead?

### File-size and scalability

With Mathematica you will be forced to include images directly in the document. I have seen (and created) a lot of notebooks with graphical content and the performance drops fast as soon as you include some large images. Non of my documents came close to being a book-chapter or section and I don't want to imagine what would have happened to the editing experience.

Additionally, as soon as you include an image, your nice text-notebook expression becomes cluttered with pixel-data. While it might be possible rescue a broken notebook (and this happens!), I would not like to do this when you have to manually edit a 5MB file that contains cell expressions with image data.

In LaTeX, the image never touches your document since you only include the file. Even better, I usually create a low-res and a high-res version of my images and for the final version a easily switch all of my images with one command.

Therefore, the question is what happens if you write a document larger than 30 pages with various content. From MS Word we know that many poor Phd students faced disasters when their thesis breaks some days before they wanted to hand them in. I don't have such a large experience with big Mathematica documents, but LaTeX has proven to be mature for many many years in various different areas.

### LaTeX is plain text that can be versioned

You LaTeX document contains only the text you are writing while notebooks are Mathematica expressions (although text too). Beside that you can edit your LaTeX file with any editor or collaborate with any colleague, there is another clear advantage: versioning. I'm putting most of my LaTeX documents under version control (e.g. git) and with this, you can track in detail when and where you made changes.

Were you ever forced to create a difference document for a journal editor, where you clearly mark what you changed since the last commit? Well I was and with latexdiff it was done in a few minutes. I only had to checkout two different versions from git and in one LaTeX run I had a highlighted document where all alterations were marked.

### Bibliography

In science, references are half of the work. LaTeX creates the bibliography completely automatically and with JabRef I can easily organize and manage a large database of references. It lets me insert cites of others with a single click directly into my LaTeX editor.

I know that something similar is possible with Mathematica too, but if the workflow is really as convenient as I have it now, I'm not sure of.

Additionally, with LaTeX you can change the layout of the citation and bibliography in an instant and especially in science, journals are often picky about such details.

### Additional features of LaTeX packages

Beside the normal text and formula content, LaTeX has a rich database of packages. For instance the siunitx package makes typesetting of numbers with units easy and they look stunning. What about typesetting complex chemical formulas?

## Final note

My personal opinion is: I'm using Mathematica to create diagrams, plots and other visualizations but for the typesetting I would always rely on LaTeX mostly because I think the final quality of the document is extremely good. Additionally, LaTeX text files don't crash and I never lost or had to restore a document. The same is not true for Mathematica and I'm not willing to try this on an important article. Finally, collaborating with non-Mathematica-users is not easily possible.

I suggest you just try it with an at least moderately large document whether the writing, the editing and the final product really works the way you want it.

What is/are the best resource(s) for making such a transition.

None that I'm aware of except the very rich Mathematica documentation about e.g.

• A very nice post totally agree on the points made: using Mathematica to produce printable documents is just painful. One might be able to get nice formatted documents in the Mathematica notebooks but getting them to good quality PDFs will be very hard work. I think even the visualization methods of Mathematica work best when used in the notebooks: exporting plots with good quality in the right size is again painful. LaTeX is just way superior because it is made for typesetting and is highly flexible. – N0va Oct 20 '16 at 1:15
• equation references are also very clunky to enter. ... – Jens Oct 20 '16 at 4:17
• Feel free to edit my answer. I thought I don't dive into the whole label, reference, caption, etc topic which is extremely convenient in latex. – halirutan Oct 20 '16 at 4:19
• @halirutan thank you for your answer. I was not inclined to switch, it just came to mind given the co-dependincies I have with both LaTeX and Mathematica. I also have a similar toolbox, using LaTeX for typesetting, vector graphics for fine tuning, etc. I think the formula comparison is slightly misleading as Mathematica has scripted characters for variables, which were not used. But otherwise thank you for your cadency :) – SumNeuron Oct 20 '16 at 8:10