4Misc_Starté4Platformé·@ õÁROGIhhžþžþ> ÇþÇþæ ­ ÜÄ Ä Ä Ä ((((RtCØ+winspoolEPSON Stylus D68 SeriesUSB001EPSON Stylus D68 Seriesœ<›€ š 4dhhA4 297 x 210 mmEPSON Stylus D68 SeriesDLLName32=E_FUICAAE.DLLÿÿ´€P TS_URLTSupportURL PSOLVER4š  hhL hh  q****  q****dÿ2 õÁROGIhhžþžþ> ÇþÇþæ ­ ÜÄ Ä Ä Ä ((((RtCØ+winspoolEPSON Stylus D68 SeriesUSB001EPSON Stylus D68 Seriesœ<›€ š 4dhhA4 297 x 210 mmEPSON Stylus D68 SeriesDLLName32=E_FUICAAE.DLLÿÿ´€P TS_URLTSupportURL PSOLVER4š  hhL hh  q****  q****dÿ2 õÁROGIhh˜þ˜þ 8 ÁþÁþà ¡ Ðì ì ì ì ((((RtCØ+winspoolEPSON Stylus D68 SeriesUSB001EPSON Stylus D68 Seriesœ<›€ š 4dhhA4 297 x 210 mmEPSON Stylus D68 SeriesDLLName32=E_FUICAAE.DLLÿÿ´€P TS_URLTSupportURL PSOLVER4š  hhL hh  q****  q****dÿ2 õÁ ROGIhhžþžþ> ÇþÇþæ ­ ÜÄ Ä Ä Ä ((((RtCØ+winspoolEPSON Stylus D68 SeriesUSB001EPSON Stylus D68 Seriesœ<›€ š 4dhhA4 297 x 210 mmEPSON Stylus D68 SeriesDLLName32=E_FUICAAE.DLLÿÿ´€P TS_URLTSupportURL PSOLVER4š  hhL hh  q****  q****dÿ2^Graph*@@wwwwwwï?wwwwwwï?k0WDashSettings#úÿ  !¼ˆâöüNormalÿÿÿÿ@ ÿArialÿÿÿÿÿÿ<ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿHHHH$$¼ˆâöüNormalÿÿÿÿ@ ÿArialÿÿÿÿÿÿ<ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿHHHH$$444444¼ˆ m õ¦üNormalÿÿÿÿ@ ÿArialÿÿÿÿÿÿ<ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿHHHH$$4 4 4 4 4 4 ‹homeWOdþÿÿÿ0‰vtD:Wolfgang:Projects:Gedaddel:Latex stuff:iLaTeX:D:Wolfgang:Projects:Gedaddel:Latex stuff:iLaTeXfP´ç¬ç„ç&,’|(è Äæ@èç é‘|`’|ÿÿÿÿ]’|m‚|@‚| ëþÿÿÿLé!(è @ Àíðýðýðýðýøûý¾ë`£V‰8éäÔ±‡gé^²‡ô„2¥ô„2¥¹æ‡‹LaTeXdirWOdþÿÿÿ0‰vtD:Wolfgang:Projects:Gedaddel:Latex stuff:iLaTeX:D:Wolfgang:Projects:Gedaddel:Latex stuff:iLaTeXfP´ç¬ç„ç&,’|(è Äæ@èç é‘|`’|ÿÿÿÿ]’|m‚|@‚| ëþÿÿÿLé!(è @ Àíðýðýðýðýøûý¾ë`£V‰8éäÔ±‡gé^²‡ô„2¥ô„2¥¹æ‡�LatexInIgor\Tdþÿÿÿ0‰vtD:Wolfgang:Projects:Gedaddel:Latex stuff:LatexInIgor:D:Wolfgang:Projects:Gedaddel:Latex stuff:LatexInIgor´ç¬ç„ç&,’|(è Äæ@èç é‘|`’|ÿÿÿÿ]’|m‚|@‚| ëþÿÿÿLé!(è @ Àíðýðýðýðýøûý¾ë`£V‰8éäÔ±‡lé^²‡ô„2¥ô„2¥¹æ‡,RecentWindowsøAdvanced Topics.ihfGetting Started.ihfGraph2:weibull (Graph2)Graphics.ihfHelp BrowserIgor Reference.ihfIgor Shortcuts.ihfiLaTeX.ipfiLaTeXpanel (LaTeXpanel)Notebook0:iLaTeXtmp.ifn (Notebook0)Programming.ihfTable0:parameter,wave0 (Table0) 4Misc_EndéôXOPState_StartÀéData Browserí onsGizmofGraph2:weibull (Graph2)PeakFunctions2lp Browserpanel)GetInputStategor Shortcuts.ihfGBLoadWaveQSurface PlotteriLaTeX 2010kÿÿÅData Browser‘root4XOPState_Endé\>–PÀjÝÉ>Ûóº>!ðØ¾®k¸ ¿dummyð?�Á.@0@2@8@B@àÿÿÿïF_P¨‘Wê5¹Åê5¹ÅDBtxtðØð?ð?ð?ð?ˆ‘W6134181205129141181671931721510 øÙÞ¸À–Wê5¹Åê5¹ÅDBcolðØð?ð?ð?ð?PCGPCGPCGPCGPCGPCGPCGPCG@F@F@FPCG@F@F@FPCG@F@F@FPCGPCGPCGξl>оDBradð?ê5¹Åê5¹Åà?®GázÞ?)\�Âõ(Ô?> ×£p=Ò?š™™™™™©?{®Gáz”?ö(\�ÂõØ?˜üHL ¨lWçLŽÇbeŽÇparameterðØð?ð?ð?ð?à–Wmusigmagamma ¦–zy¾wave0ð?îLŽÇOaŽÇ4@9@ø?ÖÆÛÈlWweibullÉð?SaŽÇSaŽÇàÿÿÿàÿÿÿàÿÿÿàÿÿÿàÿÿÿàÿÿÿàÿÿÿàÿÿÿàÿÿÿàÿÿÿàÿÿÿàÿÿÿàÿÿÿàÿÿÿàÿÿÿàÿÿÿàÿÿÿàÿÿÿàÿÿÿàÿÿÿõÞŽ™?ï³ø]b˜? �€>F€—?œ}H>š–?µ¥Á_ⱕ?ÒzŽŒ¥È”?¶Ô4ôÓß“?o5%•ø’?6glTî’?t®ŒÄ2‘?ªi ÑÞU�?%vdÐûŽ?&tȦãV�?òÅ È齋?&Òâ ©1Š?¾!=¿²ˆ?ÓáI¥A‡?ܰ/‹²Þ…?Aön Š„?NW¤ Dƒ?]P;·z ‚?„0Ü]ã€?Í\‘?¿�°a¼w}?!¿¬b z{?ÿ(ËÕt—y?³4H›@Ïw?Ù­õF­ v?´â+]éŠt?-b¬F s?˜°†þT¦q?5?}´Up? ×8É�4n?'.ß<æk?àòïS޾i?<¬i椻g?‰F. ¦Ûe?Ø[cÁd?úÊ*€+}b?êÁB(û`?Òºn *_?ÑSèÄA’\?·(.@É+Z?O_á^–óW?L©Õ½æU?�F&*qT?–� DR?–Ý2»ó¨P?ãË'I˜]N?€Î² ‹¦K?Ã!hi(I?*¿!'ßF?“q€‡¾ÆD?[#1޶ÛB?¦Ž—A?”sÊX??MýYîoÄA�‚ú>æù0á�÷>Þúu�½íô>! ðõ“ò>�Mç#{ð>}gðõ.9í>?”BÄ�äé>±t*íæ>@áV"1Jä>w¡êsËñá>~ $±¸ß>ºnãÑ`Ü>0¹ôɼØ>‰#ÓKaÓÕ>M~ûùË>Ó>aŠÂõÐ>lÚäçßÍ>e5ÿoàKÊ>Ô¹‹N""Ç>’ 8qÉVÄ>ÝN:‹8ßÁ>P±íPîc¿>9yHi'�»>l§”Ã+¸> ê[[E0µ>ÁÿL•Ú�²>�é÷i8B°>‰ ëu¬>|Zñmå¨>ŸB5t&Ä¥>¾,Úð£>¦Æ&œ >ñ•Ñòþœ>Ì%oÒ–K™>�Žg{–>·Ý§ì48“>ºï¿%Z½�>¥±÷ÚÙ$�>«³ÏE[‰>2‡Y¥¶ †>’'€Ýù)ƒ>IqüM¯¥€>�^G&è|>;Z+É›y>ï˃£“Áu>Ž{c#Ür>¹¤I0Wp>év£ Ml>"“€ò~h>öµ ”þ0e>ÚU2ÉRb>*eæ§Ë«_>˳g‡q[[>ré[î{žW>Y•± ®aT>�î%>”Q> SJÐON>ç:ð(�J>@dÊÀ}F>“LxE\C>½Î‰~E¨@> Ai‡4¦<>!qȺ 8>ÿ¤µëü'5>Ü¥¿êÆ*2>y~v†//>V¶ãùÀ*> î$Ûð&>Úã£Ùt©#>á;ü× >b¥¾\Ø>ï[�ó¯>éó”åm>�”¾…É>w!ü�ÅÝ>tÇ�M$^ >þL{Ç­ƒ> Packages·7�ès!x*W iLaTeXs·7�ès!8·Å>–PÀjÝÉ>Ûóº>labelsONbeQuietð?cleanUpð?baseResÀb@aaLevel@LaTeXruns@lastResÀb@LaTeXcommandSymbolÀî@texFileNameSymbolÀî=D:Wolfgang:Projects:Gedaddel:Latex stuff:iLaTeX:iLaTeXtmp.texNotebookFileymbolÀî=D:Wolfgang:Projects:Gedaddel:Latex stuff:iLaTeX:iLaTeXtmp.ifn¾ìäfø¶9ŽÇ9ŽÇLaTeXenvironments8·ð?ð?ð?ð?'·(raw)[display]{refs}$math$§verb§+chem+ &ƶxÙضLaTeXPNG_depthð?=ŽÇ=ŽÇ€@€@ @0A€@À@ @€?€?€@`Âè8€W9ŽÇ9ŽÇLaTeXcommands8·ð?ð?ð?ð?)˜À$^i$\LaTeX\LaTeX\verb§\sqrt{2}+1=\frac{1}{\sqrt{2}-1}§$\sqrt2+1=\frac1{\sqrt2-1}$\LaTeX\begin{equation} \label{eq:weibull} f_W(x;\,\alpha,\gamma) = -\frac{\partial e^{-x^\gamma/\alpha}}{\partial x} = \frac{\gamma}{\alpha}\,x^{\gamma-1}\,\exp\left(\frac{x^\gamma}{\alpha}\right) \qquad \alpha, \gamma > 0,\;x \geq 0 \end{equation}\eqref{eq:weibull}graphstables\begin{figure} \centering \includegraphics{graph2} \caption{ \label{fig:weibull=graph2} Weibull distribution.} \end{figure} \clearpage\begin{figure} \centering \includegraphics{table0} \caption{ \label{fig:weibull=table0} Parameter table.} \end{figure} \clearpage\LaTeX\ref{fig:weibull=graph2}\ref{fig:weibull=table0} 6QWK]ciðrx�¨Æ¶×s`WLaTeXcmdPos2ð?9ŽÇ9ŽÇÐAhBWLaTeXcmdPar1ð?9ŽÇ9ŽÇ@@@@@@@€@€@€@ @ @À@À@À@ PSFontInfo·7�ès!È WеÎ8XÈ W€ð“ÁTTtoPSÈ W ð?ð?ð?ð?.à@VArialArial NarrowBook AntiquaBookman Old StyleCentury GothicCentury SchoolbookCourier NewMonotype CorsivaMonotype SortsSymbolTimes New RomanHelveticaHelvetica-NarrowPalatinoBookmanAvantGardeNewCenturySchlbkCourierZapfChanceryZapfDingbatsSymbolTimes.<NYiw}Œ•¥­´¾ÎÕáíóø’­Dv܈W€ð“Á7TTPSFNamesÈ W ð?ð?ð?ð?/¨ WHelveticaHelvetica-NarrowPalatinoBookmanAvantGardeNewCenturySchlbkCourierZapfChanceryZapfDingbatsSymbolTimesHelveticaHelvetica-NarrowPalatino-RomanBookman-LightAvantGarde-BookNewCenturySchlbk-RomanCourierZapfChancery-MediumItalicZapfDingbatsSymbolTimes-RomanHelvetica-BoldHelvetica-Narrow-BoldPalatino-BoldBookman-DemiAvantGarde-DemiNewCenturySchlbk-BoldCourier-BoldZapfChancery-MediumItalicZapfDingbatsSymbolTimes-BoldHelvetica-ObliqueHelvetica-Narrow-ObliquePalatino-ItalicBookman-LightItalicAvantGarde-BookObliqueNewCenturySchlbk-ItalicCourier-ObliqueZapfChancery-MediumItalicZapfDingbatsSymbolTimes-ItalicHelvetica-BoldObliqueHelvetica-Narrow-BoldObliquePalatino-BoldItalicBookman-DemiItalicAvantGarde-DemiObliqueNewCenturySchlbk-BoldItalicCourier-BoldObliqueZapfChancery-MediumItalicZapfDingbatsSymbolTimes-BoldItalic !(2BIUaglu…“ ¯ÅÌåñ÷%2>Mbn‡“™£´ÌÛî*COUav’¥·Íèû &6šc‰R¨W€ð“ÁPSSymbolNamesÈ Wð?ð?ð?ð?0@VSymbolZapfDingbats *F)d0TMW????¬(iLaTeXtmp.ifnNotebook0Notebook0:iLaTeXtmp.ifn+Ù÷+Ù÷,11$NormalÿÿÔ ÿîÿÿÿÿÿÿÿÿ< ÈBHHHH$$–°FÐZ<\ÛM#B�#H×#×#×#×#×#×#×#Á˜(F�If you have * on your Windows system,  lets you use it in Notebooks ÿÿ ÿÿ ÿÿ ÿÿþÿ ÿÿ ÿÿ' ÿÿ( ÿÿm$*i.e. latex.exe, dvipng.exe, metafont, preview-latex (all in, e.g., the MiKTeX distribution) and ghostscript ÿÿÿÿÿÿÿÿPWith the tiny @+^i\LaTeX+@ package, you can use @(\LaTeX)@ to write mathematical formulae in an Igor Notebook. For example, you can write something like @§\sqrt{2}+1=\frac{1}{\sqrt{2}-1}§@ and then hit a button to make this look like a real formula (here:@$\sqrt2+1=\frac1{\sqrt2-1}$@). You can also use @(\LaTeX)@ to number equations, Ò@[{eq:weibull} f_W(x;\,\alpha,\gamma) = -\frac{\partial e^{-x^\gamma/\alpha}}{\partial x} = \frac{\gamma}{\alpha}\,x^{\gamma-1}\,\exp\left(\frac{x^\gamma}{\alpha}\right) \qquad \alpha, \gamma > 0,\;x \geq 0 ]@  and then reference these in your documentation (e.g., "Eq. @{eq:weibull}@ is the Weibull distribution"). Igor @+graphs+@ and @+tables+@ can be included as EPS figures in the notebook with a simple command, and automatically labelled with a neat caption you define: b@[{fig:weibull=graph2} Weibull distribution.]@ @[{fig:weibull=table0} Parameter table.]@ P As with equations, you can refer to these figures by an internal name you define rather than the number, while you use @(\LaTeX)@ to keep track of their proper numbering. "Fig. @{fig:weibull=graph2}@ shows the Weibull distribution for a specific parameter set while Fig. @{fig:weibull=table0}@ shows the corresponding parameter table." ^"To see the commands behind this, press the "preview mode OFF" button --- happy experimenting! ÿÿÿÿQ Currently, edit this notebook or save this experiment only with preview mode OFF ÿÿ ÿÿ=provided LaTeX and extended environments (enclosed in @...@) ÿÿJ$ ( ... ) raw LaTeX commands, no space between "@" and "(" or ")" and "@"! ÿÿÿÿÿÿÿÿÿÿÿÿÿÿO$ $ ... $ inline math, the size of the symbols is smaller than for display math ÿÿÿÿÿÿÿÿÿÿÿÿÿÿW$ [ ... ] display math, same size as equations, but no numbering; LaTeX code => \[...\] ÿÿÿÿÿÿÿÿÿÿÿÿÿÿô$ [{eq:label} ... ] numbered equations, the label (conventionally eq:XXX) can be referenced in the text (see [equation] references); do not use spaces up to the "}" symbol ! LaTeX code => \begin{equation} \label{eq:label} ... \end{equation} ÿÿÿÿÿÿ%ÿÿÿÿÿÿÿÿ$ [{fig:label=graphX} ... ] figures from Igor, use the name of an open graph window instead of graphX; Igor first saves an EPS version of the graph, then replaces what you typed with => \begin{figure} \includegraphics{graphX} \caption{ \label{fig:label} ... } \end{figure} ÿÿÿÿÿÿ+ÿÿÿÿÿÿÿÿ& can also handle tables and layouts! Z$ {...} references, renders as "1" if not an equation reference; => \ref{...} (no spaces!) ÿÿÿÿÿÿÿÿÿÿÿÿÿÿZ$ {eq:...} equation references, yields "(1)" (requires amsmath package); => \eqref{eq:...} ÿÿÿÿÿÿÿÿÿÿÿÿÿÿY$ § ... § verbatim environment, verbatim text may not contain the "§" sign; => \verb§...§ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ[$ + ... + chemical formulae, text w. sub-/superscripts; C_{60} => C$_{60}$ (no {} nesting!) ÿÿÿÿÿÿÿÿÿÿÿÿÿÿp----------------------------------------- development notes follow -------------------------------------------- ÿÿÿÿ wish list ÿÿR use color dvipng allows that in principle (but then we need a tex color package) G use text size to adjust LaTeX size (but more fonts will be generated) T provide interface to adjust resolution, anti-aliasing, picture format (EPS or PNG) known problems ÿÿY$ EPS figures dvipng is confused by Igor's EPS code (or missing some ghostscript input??): ÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿH6 dvipng warning: No GhostScript pngalpha output, opaque image inclusion ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿF6 dvipng warning: Unable to load graph0.eps, image will be left blank ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿZ [pngalpha is the name of a GhostScript output device (32-bit color + transparent bkgnd)] [$ solved: SavePICT/C=2 (CMYK color scheme), problem is only with default C=1 (RGB) [why???] ÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿ0things to try out from the DVIPNG documentation ÿÿR -o tex2png%d names output files tex2png1.png, tex2png2.png etc. (on win: % => %%) E --follow enables "follow mode" for faster processing... to be tested b --bdpi 300 set Metafont base resolution, both horizontal and vertical; used together with --mode ?$ --mode XYZ set Metafont device name to XYZ (cf. /tex/modes.mf) 0ÿÿÿÿÿÿ=ÿÿÿÿÿÿÿÿ7 -M turns off automatic pk font generation with mktexpk /ÿÿÿÿÿÿ¥6 --freetype enables PostScript Type1 and TrueType fonts (default on) instead of gsftopk (only if FreeType2 font library was present at compile time, overrides T1lib) OÿÿÿÿÿÿVÿÿÿÿÿÿWÿÿÿÿÿÿÿÿš6 --t1lib enables PostScript Type1 fonts (default on) instead of gsftopk (only if T1lib font library was present at compile time, FreeType has precendence) ?ÿÿÿÿÿÿFÿÿÿÿÿÿGÿÿÿÿÿÿÿÿother things to try ... ÿÿD use SavePICT and LoadPICT via the Clipboard (to avoid EPS creation) �� SavePICT/WIN=Graph0 as "Clipboard" and LoadPICT "Clipboard" pictName, then Notebook $nb, picture={pictName} -- just to tweak resolution, or why should we?! ÿÿÿÿÿÿ#ÿÿÿÿÿÿ$ÿÿÿÿÿÿÿÿ(ÿÿÿÿÿÿEÿÿÿÿÿÿÿÿLÿÿÿÿÿÿlÿÿÿÿÿÿpÿÿÿÿÿÿÿÿµ use userdata via GetWindow / SetWindow for unnamed or GetUserData / SetUserData for named user data -- to bookkeep latex formulae and work around missing Notebook actions in IP5 ...Z 6Î$ü tÊ@ ª Ä  Ž  Š ¨ æ –ž$¬Î&tÎözþ€àf®Rº$tV,\¦ÚsectionÿÿÔ ÿfigurecaptionÿÿÿÿÔ ÿindentedÿÿHÔH ÿindented+ÿÿHÔH ÿfigurecaption+ÿÿÔ ÿfigurecaption+ÿÿÔ ÿNormal+ÿÿÔ  ÿNormal+ÿÿÔ ÿ rÛíÿ5  ``M!êÿ;RR``d(zö™‰PNG  IHDR5Â=Xh$PLTEÿÿÿ...AAArrrŽŽŽ888ÆÆÆTTTªªªâââ(:#†tRNS@æØf#IDAT(}бNÃ0àH¬ØOÀ;°d*BYº‰%kè≱R¥¶¨‹h¤.Éí’¥ R€@órÜ9MËPqÓÙŸïÎ6¶Î­ çCƒ‚¶´tŽ’åý ‘ŧ{®ÜÀxK*L/)]ÓºL‘"ú�ò†¨nøÛËNÆlñT£eŸ6;––m›ñTà:Ý0±‰b  oç™{áÇcgo¾'7 -5�;{ÍéѨ=ZSÐQ ±;š¢š ºWk}�ñÁ 4D¯.Z»�l‚©éæ�h3DbZ£ã„ß·ž-Þ)í¡üê,;˜d"†¬÷øC¾Î€æ•0¤ÝÍgùœû\-ë\Ó¥5Κ ¢æÛpåŸà·SåÉ`ÿXI“Nhì^~�oç–)¿IEND®B`‚d,F¾‰PNG  IHDR;Œ9ùh$PLTEÿÿÿ...AAATTTrrrŽŽŽÆÆÆâââ888ªªª†aPtRNS@æØfHIDAT(…�?KAÄî6[û-l ˆ¦Y04Í�EÀ4Bìl¶°ˆ¤9H Iu …\š«$Ù4�EïËeÞ^þ hœæ–÷{of˜á žÒ`h1vnŠp^V8²Ú9 ŸbÜ>Ÿâ ør³•ë�»+œÜù˜¨3 EõÊcTWÀ+ƒØc=Ht,‘\CVßò[c¯u%Ö¹àq& €ût$k�Úã~©Äãã̽MxöÑ<šzœ+úzsZ¡–Ó�©¥æF½4Ùm‡™ƒnº¡Ìf ÙcÅËk±óš›a…#iNs‹°³L¶¸õlG½úGœ×Ð5[Ìÿeƒë >;~ʈ’²™0 // use (nb,0) -- wrong help for WinRecreation end Function SetLaTeXNotebook(nb, status) string nb variable status SetWindow $nb, userdata(iLaTeX)=Num2Str(status) end Function IsLaTeXNotebook(nb) string nb if (IsFormattedNotebook(nb)) return 0 endif string statusStr=GetUserData(nb, "", "iLaTeX") if (StrLen(statusStr) == 0) statusStr = "0" endif return Str2Num(statusStr) end // 2 --- about LaTeX formulae in Notebooks Function/S SwitchToLaTeXFolder() string dfSav= GetDataFolder(1) NewDataFolder/O/S root:Packages NewDataFolder/O/S iLaTeX return dfSav end constant kMaxLaTeXcmds=1000 Function GetLaTeXcommands(nb) string nb string dfSav=SwitchToLaTeXFolder() String/G LaTeXcommandSymbol="@" Variable/G LaTeXruns=1 Make/T/O/N=6 LaTeXenvironments={"(raw)","[display]","{refs}","$math$","§verb§","+chem+"} Make/T/O/N=(kMaxLaTeXcmds) LaTeXcommands; LaTeXcommands="" Make/O/N=(kMaxLaTeXcmds) LaTeXcmdPar1=0,LaTeXcmdPos1=0,LaTeXcmdPar2=0,LaTeXcmdPos2=0 WAVE/T cmdList=LaTeXcommands, envList=LaTeXenvironments WAVE par1=LaTeXcmdPar1, pos1=LaTeXcmdPos1,par2=LaTeXcmdPar2, pos2=LaTeXcmdPos2 SVAR sym=LaTeXcommandSymbol NVAR runs=LaTeXruns SetDataFolder dfSav string env, envName, token1, token2 variable k, n for (k=0, n=0; k0) Redimension/N=(n) cmdList, par1, pos1, par2, pos2 Sort {par1, pos1}, cmdList, par1, pos1, par2, pos2 else KillWaves/Z cmdList, par1, pos1, par2, pos2 endif return n end function/S LaTeXenvRAW(s) string s return s end function/S LaTeXenvDISPLAY(s) string s variable n = StrSearch(s,"{",0) if (n<0) // non-numbered equation (displaymath) return "\["+s+"\]" endif variable n1 = StrSearch(s,"}",n) string braces = s[n+1,n1-1], content = s[n1+1,strlen(s)-1] variable type = ItemsInList(braces,"=") if (type==1) // numbered equation (equation environment) return "\begin{equation} \label{"+braces+"} "+content+" \end{equation}" else // figure environment string aGraph = StringFromList(1,braces,"="), result if( StrLen(WinList(aGraph, ";", "WIN:7")) == 0 ) printf "\"%s\" is neither graph, table, nor layout. LaTeX command \"%s\" was ignored.\r", aGraph, s return "GRAPH ERROR! - see history" else // save the graph as an eps figure, construct return string SavePICT/C=2/E=-3/EF=2/O/P=LaTeXdir/S/WIN=$aGraph // should remember what was created here, in order to be able to clean it up... // if (V_Flag) // print "saving "+aGraph+" failed. Sob." // endif result = "\begin{figure} \centering \includegraphics{"+aGraph+"} \caption{ \label{" return result+braces+"} "+content+"} \end{figure} \clearpage" endif endif end function/S LaTeXenvREFS(s) string s if ( !CmpStr("eq",LowerStr(StringFromList(0,s,":"))) ) return "\eqref{"+s+"}" else return "\\ref{"+s+"}" endif end function/S LaTeXenvMATH(s) string s return "$"+s+"$" end function/S LaTeXenvVERB(s) string s return "\verb§"+s+"§" end function/S LaTeXenvCHEM(s) string s string ch, ch1, result="" variable n, n1, nmax=strlen(s)-1 for(n=0; n<=nmax; n+=1) ch=s[n] if ( !CmpStr(ch,"_") || !CmpStr(ch, "^") ) if ( !CmpStr(s[n+1], "{")) n1=strsearch(s, "}", n+1) // nesting not taken care of !!! if (n1<0) n1=nmax endif else n1=n+1 endif result += "$"+s[n,n1]+"$" n=n1 else result+=ch endif endfor return result end Function CreateLaTeXPreviewFile(nb, fileName) string nb, fileName SetPath("LaTeXdir","where should I put my LaTeX files?") variable numCmds=GetLaTeXcommands(nb) if(numCmds == 0) abort "no commands found..." endif wave/T commands = root:Packages:iLaTeX:LaTeXcommands variable refNum Open/P=LaTeXdir refNum as fileName+".tex" String/G root:Packages:iLaTeX:texFileName=S_fileName variable labelsON=NumVarOrDefault("root:Packages:iLaTeX:labelsON", 0) string header=""//"\\nonstopmode\r\n" header+="\documentclass{amsart}\r\n" header+="\usepackage{graphicx}\r\n" if (labelsON) header+="\usepackage[active, floats, showlabels]{preview}\r\n" else header+="\usepackage[active, floats]{preview}\r\n" endif // header+="\usepackage{hyperref}\r\n" // header+="\usepackage[pdftex]{graphicx}\r\n" // header+="\usepackage[pdftex]{hyperref}\r\n" header+="\pagestyle{empty}\r\n" header+="\\thispagestyle{empty}\r\n" header+="\begin{document}\r\n" FBinWrite refNum, header string command="\begin{preview}"+ReplaceString("\r",commands[0],"\r\n")+"\end{preview}" FBinWrite refNum, command variable n for (n=1; n=0) command = "\r\n\\newpage\r\n"+ReplaceString("\r",commands[n],"\r\n") else command = "\r\n\\newpage\r\n\begin{preview}"+ReplaceString("\r",commands[n],"\r\n")+"\end{preview}" endif FBinWrite refNum, command endfor string trailer= "\r\n\end{document}" FBinWrite refNum, trailer Close refNum end Function SetPath(pathName, msg) string pathName, msg PathInfo home // *** workaround -- now, user will never see a path dialog ! NewPath/Q/O $pathName, S_path // PathInfo $pathName // if (V_Flag==0) // NewPath/Q/M=(msg) $pathName // endif end function/S Mac2WinPath(pathStr) string pathStr return ReplaceString("\\", ReplaceString(":", pathStr, "\\"), ":\\", 0, 1) end Function CreatePNGs4Preview(fileName) string fileName tex2png(fileName, "transparent") end Function tex2png(fileName, background) string fileName, background string dfSav=SwitchToLaTeXFolder() NVAR cleanUp, beQuiet, resolution=baseRes, quality=aaLevel, runs=LaTeXruns, lastRes SetDataFolder dfSav string batchFileName="iLaTeX.bat", logExt=".dvipng.log", logFileName=fileName+logExt // make sure fileName is enclosed in quotes --- ???? if (!cmpstr(fileName[0],"\"")) fileName="\""+fileName endif if (!cmpstr(fileName[strlen(fileName)-1],"\"")) fileName+="\"" endif // collect options for dvipng // variable defRes=300, defQual=3 // this seems to be false string qualStr="", resStr="", bgStr sprintf bgStr, " -bg%s", background // if (resolution != defRes) sprintf resStr, " -D%g", resolution // endif // if (quality != defQual) sprintf qualStr, " -Q%g", quality // endif // compose latex and dvipng commands string cmd="@echo off\r\n?~d0\r\ncd ?~p0\r\n" // must use ? here and later substitute since % is special character for sprintf if (beQuiet) sprintf cmd, "%slatex.exe -quiet \"%s\" > nul\r\n", cmd, fileName if (runs==2) sprintf cmd, "%slatex.exe -quiet \"%s\" > nul\r\n", cmd, fileName // cross references, otherwise no output! endif if (lastRes!=resolution) sprintf cmd, "%sdvipng.exe -q -Ttight%s%s%s \"%s\" > %s\r\n", cmd, bgStr, resStr, qualStr, fileName, logFileName sprintf cmd, "%slatex.exe -quiet \"%s\" > nul\r\n", cmd, fileName endif sprintf cmd, "%sdvipng.exe --follow --depth -Ttight%s%s%s \"%s\" > \"%s\" 2>&1", cmd, bgStr, resStr, qualStr, fileName, logFileName // "command > logfile 2>&1" means "pipe output of command to logfile, and error messages (2) as well" else sprintf cmd, "%slatex.exe \"%s\"\r\n", cmd, fileName if (runs==2) sprintf cmd, "%slatex.exe \"%s\"\r\n", cmd, fileName // cross references, otherwise no output! endif if (lastRes!=resolution) sprintf cmd, "%sdvipng.exe -d-1 -Ttight%s%s%s \"%s\"\r\n", cmd, bgStr, resStr, qualStr, fileName sprintf cmd, "%slatex.exe \"%s\"\r\n", cmd, fileName endif sprintf cmd, "%sdvipng.exe -d-1 --follow --depth -Ttight%s%s%s \"%s\" > \"%s\"\r\npause", cmd, bgStr, resStr, qualStr, fileName, logFileName endif lastRes=resolution cmd = ReplaceString("?", cmd, "%") // substitution // output to file SetPath("LaTeXdir","where should I put ze LaTeX files?") variable refNum Open/P=LaTeXdir refNum as batchFileName FBinWrite refNum, cmd Close refNum // and Execute PathInfo LaTeXdir string WinCmd = "\""+Mac2WinPath(S_Path)+batchFileName+"\"" ExecuteScriptText/B/W=10 WinCmd // ExecuteScriptText/B WinCmd // this is a method to tell whether // (a) batch file was run at all (log file exists) // (b) output was generated by latex (dvi file exists) // (c) dvipng was run at all (dvipng logfile exists) // (d) dvipng was successful (PNG file(s) exist(s)) variable n string fname for ( n = 0; n < 4; n += 1 ) fname = filename+StringFromList(n,".log;.dvi;"+logExt+";1.png") Open/Z/R/P=LaTeXdir refNum as fname if (!V_Flag) // was opened, close and proceed Close refNum else // not opened, quit the loop break endif endfor switch(n) case 0: abort "iLaTeX was unable to run latex.exe (file \""+fname+"\" not found)\rPlease check your LaTeX installation. You can get it at\rhttp://www.miktex.org/" case 1: abort "latex.exe did not compile your code (file \""+fname+"\" not found)\rThe .log file should tell you what went wrong" case 2: abort "iLaTeX was unable to run dvipng.exe (file \""+fname+"\" not found)\rPlease check that you have dvipng.exe. You can get it at\rhttp://sourceforge.net/" case 3: abort "dvipng.exe did not render any images (file \""+fname+"\" not found)\rMaybe the .dvi file is empty. Try to view it with YAP..." endswitch // read depth info from log file dfSav=SwitchToLaTeXFolder() Make/O/N=(kMaxLaTeXcmds) LaTeXPNG_depth Wave depth=LaTeXPNG_depth SetDataFolder dfSav variable len, start, pageNo=0 string infoStr // need safeguard for non-existing file? done (see above) Open/P=LaTeXdir/R refNum as logFileName FReadLine refNum, infoStr // skip first line do FReadLine/T="]" refNum, infoStr len = strlen(infoStr) start = strsearch(infoStr, "[", 0) if (len <= 3 || start < 0) Close refNum break endif infoStr = infoStr[start+1, len-2] start = strsearch(infoStr, " depth=", 0) if (start>0) pageNo=str2num(infoStr[0,start]) depth[pageNo-1] = NumberByKey("depth", infoStr, "=", " ") // else // printf "suspicious entry in log file for page %g: [%s]\r", pageNo, infoStr endif while (1) Redimension/N=(pageNo) depth // CleanUp if (cleanUp) DeleteFile/Z/P=LaTeXdir fileName+".aux" DeleteFile/Z/P=LaTeXdir fileName+".dvi" DeleteFile/Z/P=LaTeXdir fileName+".log" DeleteFile/Z/P=LaTeXdir batchFileName DeleteFile/Z/P=LaTeXdir logFileName DeleteFile/Z/P=LaTeXdir fileName+".tex" endif end Function PastePNGs(nb, fileName) string nb, fileName string dfSav=SwitchToLaTeXFolder() wave/T commands = LaTeXcommands WAVE par1=LaTeXcmdPar1, pos1=LaTeXcmdPos1,par2=LaTeXcmdPar2, pos2=LaTeXcmdPos2 wave depth=LaTeXPNG_depth NVAR cleanUp,baseRes SetDataFolder dfSav string fileNameStr = fileName+"1.png", pictName variable n, h=10000/baseRes, v=h // 100% size do // wait for first image to be ready LoadPICT/P=LaTeXdir/Q/Z fileNameStr // Z means: don't load, just check existence Sleep/B/T 30 while (V_Flag==0) for (n=numpnts(commands); n>0; n-=1) fileNameStr = fileName+num2str(n)+".png" pictName="TEXPNG"+num2str(n) LoadPICT/P=LaTeXdir/Q/Z fileNameStr // Z means: don't load, just check existence if (V_Flag==0) print fileNameStr+" not found on disk -- skipped."// skipped else LoadPICT/O/P=LaTeXdir/Q fileNameStr, $pictName Notebook $nb, selection={(par1[n-1], pos1[n-1]), (par2[n-1], pos2[n-1])} // select all of command Notebook $nb, vOffset = 0.75*h/100*depth[n-1] Notebook $nb, scaling={h,v}, picture={$pictName, -5, 1} KillPICTs $pictName if (cleanUp) DeleteFile/P=LaTeXdir/Z fileNameStr endif endif endfor end function LaTeXPanelCheckProc(ctrlName,checked) : CheckBoxControl string ctrlName variable checked string dfSav=SwitchToLaTeXFolder() if( !CmpStr(ctrlName, "check_labelsON") ) string S_lblON="root:Packages:iLaTeX:labelsON" if ( exists(S_lblON)==2 ) NVAR lblsON = $S_lblON lblsON = checked else Variable/G $(S_lblON)=checked endif endif if( !CmpStr(ctrlName, "check_cleanUp") ) string S_cleanUp="root:Packages:iLaTeX:cleanUp" if ( exists(S_cleanUp)==2 ) NVAR cleanUp = $S_cleanUp cleanUp = checked else Variable/G $(S_cleanUp)=checked endif endif if( !CmpStr(ctrlName, "check_beQuiet") ) string S_beQuiet="root:Packages:iLaTeX:beQuiet" if ( exists(S_beQuiet)==2 ) NVAR beQuiet = $S_beQuiet beQuiet = checked else Variable/G $(S_beQuiet)=checked endif endif SetDataFolder dfSav end // Platform=WindowsNT, IGORVersion=6.121, architecture=Intel Silent 101 // use | as bitwise or -- not comment. NewPath/Z LaTeXdir "D:Wolfgang:Projects:Gedaddel:Latex stuff:iLaTeX:" NewPath/Z LatexInIgor "::LatexInIgor:" DefaultFont "Arial" OpenProc/W=(354.75,154.25,854.25,449)/J=30942/V=0 "iLaTeX.ipf" MoveWindow/P 288,109.25,933.75,500.75 MoveWindow/C 5.25,482,501.75,540.5 Graph2() Table0() LaTeXpanel() OpenNotebook/N=Notebook0/W=(5.25,43.25,503.25,473)/J=20368 "iLaTeXtmp.ifn" Window LaTeXpanel() : Panel PauseUpdate; Silent 1 // building window... NewPanel /K=1 /W=(681,59,893,131) as "iLaTeXpanel" ModifyPanel cbRGB=(0,26112,39168) Button preview_button,pos={4,5},size={102,20},proc=LaTeXButtonProc,title="preview mode ON" Button preview_button,fColor=(51456,44032,58880) Button LaTeX_button,pos={6,79},size={100,20},proc=LaTeXButtonProc,title="build LaTeX file" Button PDF_button,pos={114,79},size={100,20},proc=LaTeXButtonProc,title="build PDF file" CheckBox check_labelsON,pos={118,51},size={75,14},proc=LaTeXPanelCheckProc,title="\\K(65535,65535,0)Show labels" CheckBox check_labelsON,value= 0 CheckBox check_cleanUp,pos={118,29},size={84,14},proc=LaTeXPanelCheckProc,title="\\K(65535,65535,0)Clean up after" CheckBox check_cleanUp,value= 1 CheckBox check_beQuiet,pos={118,7},size={73,14},proc=LaTeXPanelCheckProc,title="\\K(65535,65535,0)Do it quietly" CheckBox check_beQuiet,value= 1 SetVariable setResolution,pos={5,29},size={100,16},title="resolution" SetVariable setResolution,labelBack=(51456,44032,58880),format="%g dpi" SetVariable setResolution,limits={50,1200,0},value= root:Packages:iLaTeX:baseRes SetVariable setAntiAlias,pos={5,50},size={100,16},title="anti-alias level" SetVariable setAntiAlias,labelBack=(51456,44032,58880) SetVariable setAntiAlias,limits={1,9,1},value= root:Packages:iLaTeX:aaLevel EndMacro Window Table0() : Table PauseUpdate; Silent 1 // building window... Edit/W=(511.5,264.5,655.5,359) parameter,wave0 ModifyTable format(Point)=1,width(Point)=0,width(parameter)=58,width(wave0)=38 EndMacro Window Graph2() : Graph PauseUpdate; Silent 1 // building window... Display /W=(511.5,126.5,703.5,236) weibull Label left "f\\BW\\M(x) * \\e" Label bottom "x" Legend/C/N=text0/J/S=3/H={0,2,4}/B=2/A=RB/X=4.69/Y=69.82/E=2 "f\\BW\\M = Weibull(x, wave0)" EndMacro ¥#pragma rtGlobals=1 // Use modern global access method. Window Graph0() : Graph PauseUpdate; Silent 1 // building window... Display /W=(510.75,128.75,720.75,270.5) dummy ModifyGraph margin(top)=12,margin(right)=13,wbRGB=(65280,59904,48896),gbRGB=(65280,48896,55552) ModifyGraph mode=5 ModifyGraph lSize=2 ModifyGraph rgb=(0,0,39168) ModifyGraph hbFill=2 ModifyGraph gaps=0 ModifyGraph usePlusRGB=1 ModifyGraph useNegRGB=1 ModifyGraph plusRGB=(32768,65280,49152) ModifyGraph negRGB=(32768,65280,32768) ModifyGraph mirror=2 ModifyGraph nticks(left)=3 ModifyGraph font(bottom)="Fixedsys" ModifyGraph fSize=12 ModifyGraph lblMargin(bottom)=15 ModifyGraph standoff=0 ModifyGraph axOffset(bottom)=1.13333 ModifyGraph axThick(left)=2.5,axThick(bottom)=1.5 Label left "\\f01my salary (k$)" Label bottom "\\f02# months on the job" SetAxis/A/N=1/E=1 left SetAxis/N=1/E=1 bottom 0,5.05 TextBox/N=text0/S=3/H={0,2,4}/B=2/A=MB/X=77.72/Y=-103.64 "DRAG ME! \r\\Z08\\F'Arial Narrow'Why so many colors, styles etc.? It's an EPS " AppendText "format test: make the graph window as narrow\ras this annotation, then preview again... U C ?" EndMacro