The Mathematica engine has a tesseract call by TextRecognize, but for use on a pdf containing Mathematica code results are poor. I wanted to compare it with the latest tesseract and the full parameter range. Unfortunately tesseract does not accept pdf files. So I have written a test notebook to generate a pdf, extract its text and its image, export the image as jpg and compare recognition results by TextRecognize and tesseract. The results are very similar in quality. I suggest to switch to character bounding box recognition and single character recognition from a standard character set at least for equ, lat, ell, eng. This notebook is for the interested part of the community.
The windows installer of the latest version of tesseract can be downloaded from the UB Mannheim repository
https://github.com/UB-Mannheim/tesseract/wiki
In the download applet chose all languages in question. Don’t forget english, equation, latin and greek in order to recognize a maximum of characters.
You may use tesseract without any additional setting of the path variable using the console in the tesseract start menu folder and typing. For a good environment setting consult the installation hints with respect to environment variables. In Windows 10 and later you reach the environment variable setting via a search for “env” in the “Start” symbol.
In the tesseract console type
tesseract inpath\infile.jpg outpath\outfilebasis -l eng l- lat -l ell -l equ
The output file gets the .txt extension automatically. Don’t forget to put strings in “ ” if they contain spaces. The order of language package names matters, put the natural language first

SaveAs this Section as a pdf to the Desktop folder

SaveAs this Section to “Environment[“Userprofile”]<>”\\Desktop\\AngMom.pdf” by a right click onto the Cell bracket.
Analogous to the translation group, the exponential function of the angular momentum projection in the direction of a unit vector
n
·
L
of the angular momentum vector operator generates a rotation of the coordinate functions and thus the arguments of all functions around the axis
n
as rotation in the angle variable φ modulo 2 π, since s the differential operator
n
·
L
in spherical coordinates is the tangent vector to the parallels with common axis
n
. This is immediately clear when considering the effect of rotations on the angular momentum components . Under the action of the orientation - preserving transformations of the O (3), the group SO (3) with determinant 1, by multiplying the angular momentum vector by the angular momentum matrix from the left, the angular momentum vector becomes a scale - invariant vector of monomials of the form x
∂
y
rotated like a vector on the unit sphere . So, one can may view the angular momentum vector with axis (x, y, z) as a result of the rotation of
L
3
with axis (0, 0, 1) onto axis (x, y, z).
In[]:=
AngularMomentum["Cartesian","Cartesian"]={(-y
∂
z
#+z
∂
y
#&),(-z
∂
x
#+x
∂
z
#&),(-x
∂
y
#+y
∂
x
#&)};
In[]:=
AngularMomentum["Spherical","Cartesian"]=Through[AngularMomentum["Cartesian","Cartesian"][f[ϕ[x,y],θ[z]]]]//.ϕ[_]ϕ,θ[_]θ,θ'[z]-1Sin[θ],Derivative[1,0][f][__]
f
ϕ
,Derivative[0,1][f][__]
f
θ
,
(1,0)
ϕ
[__]D[ArcTan[y,x],x],
(0,1)
ϕ
[__]D[ArcTan[y,x],y],xSin[θ]Cos[ϕ],ySin[θ]Sin[ϕ],zCos[θ]//FullSimplify
Out[]=
Sin[ϕ]
f
θ
-Cos[ϕ]Cot[θ]
f
ϕ
,-Cos[ϕ]
f
θ
+Cot[θ]Sin[ϕ]
f
ϕ
,
f
ϕ


Change .pdf to .jpg

tesseract cannot handle pdfs
A pdf file may contain both, the text file and the page image files. Look which the elements are present.
In[]:=
Import[pdf=Environment["Userprofile"]<>"\\Desktop\\AngMom.pdf",{"Elements"}]
Out[]=
{AttachmentCount,AttachmentData,AttachmentDetails,AttachmentList,AttachmentNames,Author,ContentsGraph,ContentsStartPage,CreationDate,Creator,EmbeddedImageCount,EmbeddedImages,FormattedText,FormFieldRules,HighlightedText,Hyperlinks,Keywords,MetaInformation,ModificationDate,PageCount,PageFormattedText,PageGraphics,PageImages,PagePlaintext,PagePositionedText,Plaintext,Producer,RawAttachmentList,Subject,Summary,TextAnnotations,Title,URLs,Version}
Except 2d-typesetting the text part of the pdf is fine.
In[]:=
text0=Import[pdf,"PageFormattedText"]
Out[]=
Analogous to the translation group, the exponential function of the angular momentum projection in the direction of a unit vector n · L of the angular momentum vector operator generates a rotation of the coordinate functions and thus the arguments of all functions around the axis n as rotation in the angle variable φ modulo 2 π, since s the differential operator n · L in spherical coordinates is the tangent vector to the parallels with common axis n . This is immediately clear when considering the effect of rotations on the angular momentum components . Under the action of the orientation - preserving transformations of the O (3), the group SO (3) with determinant 1, by multiplying the angular momentum vector by the angular momentum matrix from the left, the angular momentum vector becomes a scale - invariant vector of monomials of the form x ∂y rotated like a vector on the unit sphere . So, one can may view the angular momentum vector with axis (x, y, z) as a result of the rotation of L3 with axis (0, 0, 1) onto axis (x, y, z). In[ ]:= AngularMomentum["Cartesian", "Cartesian"] = {(- y ∂z# +  z ∂y# &), (- z ∂x# +  x ∂z# &), (- x ∂y# +  y ∂x# &)};In[ ]:= AngularMomentum["Spherical", "Cartesian"] =Through[AngularMomentum["Cartesian", "Cartesian"][f[ϕ[x, y], θ[z]]]] //.ϕ[_]  ϕ, θ[_]  θ, θ'[z]  -1 / Sin[θ], Derivative[1, 0][f][__]  fϕ, Derivative[0, 1][f][__]  fθ,ϕ(1,0)[__]  D[ArcTan[y, x], x], ϕ(0,1)[__]  D[ArcTan[y, x], y], x  Sin[θ] Cos[ϕ], y  Sin[θ] Sin[ϕ], z  Cos[θ] //FullSimplifyOu t[ ]= { (Sin[ϕ] fθ - Cos[ϕ] Cot[θ] fϕ), - (Cos[ϕ] fθ + Cot[θ] Sin[ϕ] fϕ),  fϕ}
Extract the image and save its as jpg
In[]:=
Export[Environment["Userprofile"]<>"\\Desktop\\AngMom.jpg",Import[pdf,{"PageImages",1}]]
Define a call of tesseract simply with three string arguments. If the call exits with a zero, import the text file generated.
In[]:=
tesseract[in_,out_,opt___]:=​​With[{path=Environment["Userprofile"]<>"\\Desktop\\"},​​If[0==Run["\"C:\\Program Files\\Tesseract-OCR\\tesseract.exe\""<>" "<>path<>in<>" "<>path<>out<>" "<>opt],​​Import[path<>out<>".txt"]]]
In[]:=
text1=tesseract["AngMom.jpg","angmomnew","-l equ -l eng"]
Out[]=
Analogous to the translation group, the exponential function of the angular momentum projection in the direction of a unit vector 7 - T of theangular momentum vector operator generates a rotation of the coordinate functions and thus the arguments of all functions around the axis 7as rotation in the angle variable g modulo 2 7, since s the differential operator 77 - T in spherical coordinates is the tangent vector to the parallelswith common axis 77 . This is immediately clear when considering the effect of rotations on the angular momentum components . Under theaction of the orientation - preserving transformations of the O (3), the group SO (3) with determinant 1, by multiplying the angular momentumvector by the angular momentum matrix from the left, the angular momentum vector becomes a scale - invariant vector of monomials of the formx, rotated like a vector on the unit sphere . So, one can may view the angular momentum vector with axis (x, y, z) as a result of the rotation of L;​with axis (0, 0, 1) onto axis (x, y, z).AngularMomentum["Cartesian", "Cartesian"] = {(-iy0,# + 220,78), (-2 20% + AxO,78), (-AXOye + LY O,7B)}5​AngularMomentum["Spherical", "Cartesian"] =Through [AngularMomentum[ "Cartesian", "Cartesian"] [f[9[x, y], @[2Z]]]] //-{¢[_] #4, @[_] , @'[z] + -1/Sin[e], Derivative[1, 0] [f][__] » fy, Derivative[®, 1] [f][__]» foso%) [__} = DfArctanty, x], x], ¢°% [__] » D[ArcTan[y, x], y], x Sin[e] Cos[$], y + Sin[e] Sin[¢], z+ Cose]} //Fullsimplify​{i (Sin[9] fy - Cos [@] Cot [9] fs), -i (Cos[¢] Cot [6] Sin[] fy), i fy}
In[]:=
text2=TextRecognize[Import[Environment["Userprofile"]<>"\\Desktop\\AngMom.jpg"],Language->{"English","Equation"}]
Out[]=
Analogous to the translation group, the exponential function of the angular momentum projection in the direction of a unit vector 7 - T of theangular momentum vector operator generates a rotation of the coordinate functions and thus the arguments of all functions around the axis 7as rotation in the angle variable g modulo 2 7, since s the differential operator 77 - T in spherical coordinates is the tangent vector to the parallelswith common axis 77 . This is immediately clear when considering the effect of rotations on the angular momentum components . Under theaction of the orientation - preserving transformations of the O (3), the group SO (3) with determinant 1, by multiplying the angular momentumvector by the angular momentum matrix from the left, the angular momentum vector becomes a scale - invariant vector of monomials of the formx, rotated like a vector on the unit sphere . So, one can may view the angular momentum vector with axis (x, y, z) as a result of the rotation of L;with axis (0,0, 1) onto axis (x, y, z).​AngularMomentum["Cartesian", "Cartesian"] = {(-ay0,# + 220,28), (-AZOx# + AXO,78), (-AXOye + LY OH _B)}5​AngularMomentum["Spherical", "Cartesian"] =Through [AngularMomentum[ "Cartesian", "Cartesian"] [f[9[x, y], @[2Z]]]] //-{¢[_] 4, @[_] », @'[z] + -1/Sin[e], Derivative [1, 0] [f][__] » f,, Derivative[@, 1] [f][__]» foso%) [__} = D[ArcTanty, x], x], °° [__] » D[ArcTan[y, x], y], x Sin[@] Cos[$], y > Sin[e] Sin[¢], z + Cos[e]} //Fullsimplify​{i (Sin[9] fy - Cos [@] Cot [6] Fs), -i (Cos[¢] Cot [6] Sin[@] fy), i fy}
You may compare results per text lines.
Conclusion: The results are similar, good for text and miserable for code.
There is work in progress.