The answer has gradually been accumulating in the question. The question title was edited from "latest" to "2013", but perhaps that person didn't notice that the discussion was still active in January this year. I thought it was time to move the points accumulated so far into an answer. Then as new points become available I'll add them here. I will commit to keeping this thread up to date. Next year I'll change it to 2015 and so on, adding anything new and removing anything redundant.
What have I tried already?
docx2tex: This is remarkable in some ways and sorely lacking in others. I was not a low end user of word, I used styles to structure my documents in a consistent manner. It gets all the text out and separates headings but with zero formatting. It gets all the graphics out, but I had to do a batch convert to pdf using GraphicConverter before I could use them. All my MathType equations were converted to graphics. Various other problems that I won't go into yet.
On the plus side, if I do end up having to start from scratch, at least it produces a good starting point, with none the less a lot of work remaining to do.
MathType: Has a feature for converting equations to LaTeX, but it's very clunky. It uses a very limited set of maths environments. There are masses of layers of unnecessary brackets. And you're doing them one at a time.
MathParser: MathType produces MathML output as well. I thought that if I converted MathType to MathML first, then the result might convert more nicely using MathParser, but I've downloaded the Java applet and all I get is blank output.
writer2latex: A suggestion from drat. I downloaded OpenOffice and installed the writer2latex extension. When it imports the Word file it imports the MathType equations as graphics. It's good at exporting the heading and body styles but bad at exporting the graphics.
word2tex: A suggestion from Harish Kumar. I downloaded the 30 day trial and I have to say, in comparison to what I've looked at so far, this is stunning. If anyone wants to try it, go to Chikrii Softlab. Download the 30 day trial. It only does 1 table, 1 image and 7 equations but does all headings and body text. Put together a tex file from a sub set of what you want to translate that maximises this to put it to the test. It will count a complex equation with several lines in it as 1 equation.
At some point, if I can't eventually find a suitable solution, I will consider buying this one. It's not cheap. At $45 for an individual academic license it begs the question if you are an academic who later uses it to sell a text book, do you technically owe them the other $44 dollars?
pgfplots
expects a different input format, namely a table of the form
X Y Z
. . .
. . .
. . .
in which the matrix data is serialized into a long stream. It resembles matlab's matrix(:)
syntax.
Consequently, you can export you data by means of
data = [ X(:) Y(:) Z(:) ]
save -ascii P.dat data
% save P.dat data -ASCII
size(Z)
data =
-1.00000 4.00000 3.00000
-1.00000 4.25000 3.25000
-1.00000 4.50000 3.50000
-1.00000 4.75000 3.75000
-1.00000 5.00000 4.00000
0.00000 4.00000 4.00000
0.00000 4.25000 4.25000
0.00000 4.50000 4.50000
0.00000 4.75000 4.75000
0.00000 5.00000 5.00000
1.00000 4.00000 5.00000
1.00000 4.25000 5.25000
1.00000 4.50000 5.50000
1.00000 4.75000 5.75000
1.00000 5.00000 6.00000
ans =
5 3
and use
\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.9}
\begin{document}
\begin{tikzpicture}
\begin{axis}[colorbar,view={-60}{30}, colormap/jet,shader=interp]
\addplot3[surf,mesh/rows=5,mesh/ordering=y varies] table {
-1.00000000e+00 4.00000000e+00 3.00000000e+00
-1.00000000e+00 4.25000000e+00 3.25000000e+00
-1.00000000e+00 4.50000000e+00 3.50000000e+00
-1.00000000e+00 4.75000000e+00 3.75000000e+00
-1.00000000e+00 5.00000000e+00 4.00000000e+00
0.00000000e+00 4.00000000e+00 4.00000000e+00
0.00000000e+00 4.25000000e+00 4.25000000e+00
0.00000000e+00 4.50000000e+00 4.50000000e+00
0.00000000e+00 4.75000000e+00 4.75000000e+00
0.00000000e+00 5.00000000e+00 5.00000000e+00
1.00000000e+00 4.00000000e+00 5.00000000e+00
1.00000000e+00 4.25000000e+00 5.25000000e+00
1.00000000e+00 4.50000000e+00 5.50000000e+00
1.00000000e+00 4.75000000e+00 5.75000000e+00
1.00000000e+00 5.00000000e+00 6.00000000e+00
};
\end{axis}
\end{tikzpicture}
\end{document}
where the data table is the contents of P.dat
(could have been imported using \addplot3[...] table {P.dat};
as well). The key is that we need to tell pgfplots
how to read the file: we need to say at least one of the matrix dimensions (mesh/rows=5
here) and we need to say how it is linearized (mesh/ordering=y varies
in our case because that's how the matrix is lineared by means of data(:)
). The outcome is
The view argument is imprecise (I suppose it is of less importance here).
For the sake of completeness (the original question in Spectrum colormap for multiple curves was about line plots), I also show how to use patch type=line
here in order to show each scanline as a line plot with individual color:
\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.9}
\begin{document}
\begin{tikzpicture}
\begin{axis}[colorbar,view={-60}{30}, colormap/jet,shader=interp]
\addplot3[
mesh,
mesh/rows=5,mesh/ordering=y varies,
patch type=line,
point meta=x,
]
table {
-1.00000000e+00 4.00000000e+00 3.00000000e+00
-1.00000000e+00 4.25000000e+00 3.25000000e+00
-1.00000000e+00 4.50000000e+00 3.50000000e+00
-1.00000000e+00 4.75000000e+00 3.75000000e+00
-1.00000000e+00 5.00000000e+00 4.00000000e+00
0.00000000e+00 4.00000000e+00 4.00000000e+00
0.00000000e+00 4.25000000e+00 4.25000000e+00
0.00000000e+00 4.50000000e+00 4.50000000e+00
0.00000000e+00 4.75000000e+00 4.75000000e+00
0.00000000e+00 5.00000000e+00 5.00000000e+00
1.00000000e+00 4.00000000e+00 5.00000000e+00
1.00000000e+00 4.25000000e+00 5.25000000e+00
1.00000000e+00 4.50000000e+00 5.50000000e+00
1.00000000e+00 4.75000000e+00 5.75000000e+00
1.00000000e+00 5.00000000e+00 6.00000000e+00
};
\end{axis}
\end{tikzpicture}
\end{document}
Here, point meta
plays the role of "color data". In this case, color data is from the x
column that is: each scanline has the same color. If you want to have scan lines along y
, you would need to transpose X
, Y
, and Z
before exporting them to pgfplots
.
Best Answer
This answer is probably long past being needed but for any future users who are looking to do this. I've used PerlTeX to get the values from the .xlsx file and found a very simple solution. All that will have to be called in the LaTeX document is a simple
\getValue{B7}
or whatever cell you want to access.Things that need to be installed;
Okay, once you've done that you can simply add the function within your LaTeX docuemnt
You'll need to compile the document with perltex but that's not too hard. I've set up a simple batch file that does it all for me.
Here is the code anyway if you guys need it. Feel free to message or comment if you need any help, or I've not provided the right information. I just thought I'd get all this down before I forget to contribute to this thread that has helped me.