I am writing my thesis, and when I do copy to LaTeX from Mathematica, it changes the equation variables and also it rearranges the structure of the original equation.
How can I override that ??
New information and further reading : http://pages.uoregon.edu/noeckel/computernotes/Mathematica/EquationEditing.html
Its really annoying especially when I have to get the exact same form.
EXAMPLE:
TeXForm[HoldForm[E^(-I k( (\[Xi]/Subscript[z, 1]+u/Subscript[z, 2]) x+ (\[Eta]/Subscript[z, 1]+v/Subscript[z, 2]) y))]]
\exp \left(-i
k\left(\left(\frac{\xi
}{z_1}+\frac{u}{z_2}\right)
x+\left(\frac{\eta
}{z_1}+\frac{v}{z_2}\right)
y\right)\right)
Thanks
Answer
Perhaps something like this could help?
SetAttributes[copyAsLatex, HoldFirst];
copyAsLatex[sth_] := CopyToClipboard[ToString[HoldForm[sth] /.
x_ /y_ :> Divide[x, y], TeXForm]]
So
copyAsLatex[
U[x, y] =
Subscript[E, 0]/(4 \[Pi]) E^(I k Subscript[z, 1])/
Subscript[z,
1] E^(I k/(2 Subscript[z, 1]) ((\[Xi] - x)^2 + (\[Eta] - y)^2))]
copies the following to the clipboard
(* U(x,y)=\frac{e_0}{4 \pi } \frac{e^{i k z_1}}{z_1} e^{i \frac{k}{2 z_1} \left((\xi -x)^2+(\eta -y)^2\right)} *)
Comments
Post a Comment