Whereas
- Mathematica allows us to dump an entire notebook into a readable LaTeX file. However, the formatting of that file is not optimal.
- There are many posts on how to "beautify" a single Mathematica equation into LaTeX. But, this procedure can not be manually implemented for a notebook containing over 100 in/out.
So my question is whether there is a LaTeX style sheet which can take the .tex
file dumped by Mathematica and display it in a more appealing way.
Following is a sample of the generated code:
%% AMS-LaTeX Created by Wolfram Mathematica 9.0 : www.wolfram.com
\documentclass{article}
\usepackage{amsmath, amssymb, graphics, setspace}
\newcommand{\mathsym}[1]{{}}
\newcommand{\unicode}[1]{{}}
\begin{document}
\section*{Define the load (omitting the d$\theta $) { } { } { } { } { } { } { } { } { } { } { } { } { } { } { } { } { } }
\begin{doublespace}
\noindent\(\pmb{\text{dP}'=w R;}\)
\end{doublespace}
\section*{Primary Structure; Externally Applied load { } { } { } { } { } { } { } { } { } { } { } { } { } { } { } { } { } { } }
\subsection*{\textup{ Determine horizontal reaction at B by taking moment with respect to Z (CCW +ve)}}
\begin{doublespace}
\noindent\(\pmb{\text{x1}=R \text{Cos}[\alpha ]; \text{x2}=R \text{Cos}[\theta ]; \text{y0}=R(1-\text{Sin}[\alpha ]);}\)
\end{doublespace}
\begin{doublespace}
\noindent\(\pmb{\text{SigMZ}= -\text{BX} \text{y0}+\int _{\alpha }^{\pi /2}(\text{x1}-\text{x2}) \text{dP}' d\theta }\)
\end{doublespace}
\begin{doublespace}
\noindent\(\frac{1}{2} R^2 w ((\pi -2 \alpha ) \text{Cos}[\alpha ]+2 (-1+\text{Sin}[\alpha ]))-\text{BX} R (1-\text{Sin}[\alpha ])\)
\end{doublespace}
\begin{doublespace}
\noindent\(\pmb{\text{Sol1}=\text{Solve}[\text{SigMZ}\text{==}0, \text{BX}]; \text{BX}= \text{BX}\text{/.}\text{Sol1}[[1]]}\)
\end{doublespace}
\begin{doublespace}
\noindent\(-\frac{R w (-2+\pi \text{Cos}[\alpha ]-2 \alpha \text{Cos}[\alpha ]+2 \text{Sin}[\alpha ])}{2 (-1+\text{Sin}[\alpha ])}\)
\end{doublespace}
\subsection*{\textup{ Determine vertical reaction by taking summation of forces in the y direction}}
\begin{doublespace}
\noindent\(\pmb{\text{BY}=\int _{\alpha }^{\pi /2} \text{dP}'d\theta }\)
\end{doublespace}
\begin{doublespace}
\noindent\(R w \left(\frac{\pi }{2}-\alpha \right)\)
\end{doublespace}
\begin{doublespace}
\noindent\(\pmb{\text{CX}=\text{BX}}\)
\end{doublespace}
\begin{doublespace}
\noindent\(-\frac{R w (-2+\pi \text{Cos}[\alpha ]-2 \alpha \text{Cos}[\alpha ]+2 \text{Sin}[\alpha ])}{2 (-1+\text{Sin}[\alpha ])}\)
\end{doublespace}
\end{document}
:)
Can you give us a short example of the kind of document Mathematica outputs? Depending on how Mathematica handles it, this could be easy. Otherwise, there's always the preprocessing option.\cos\alpha
and surely not\text{Cos}[\alpha]
.:-(
\text{Cos}[\alpha]
is in fact reasonable. They're trying to replicate what's displayed in a Mathematica notebook, where cosine in the default output style (calledStandardForm
in Mathematica jargon) isCos[α]
. If you ask Mathematica to display inTraditionalForm
, then the LaTeX output forCos[x]//TraditionalForm
will be\noindent\(\cos (x)\)
, which is more TeXish.