4Misc_Start4Platform@ ROGIhh>   ((((RtC+winspoolEPSON Stylus D68 SeriesUSB001EPSON Stylus D68 Series< 4dhhA4 297 x 210 mmEPSON Stylus D68 SeriesDLLName32=E_FUICAAE.DLLP TS_URLTSupportURL PSOLVER4  hhL hh q**** q****d2 ROGIhh>   ((((RtC+winspoolEPSON Stylus D68 SeriesUSB001EPSON Stylus D68 Series< 4dhhA4 297 x 210 mmEPSON Stylus D68 SeriesDLLName32=E_FUICAAE.DLLP TS_URLTSupportURL PSOLVER4  hhL hh q**** q****d2 ROGIhh 8   ((((RtC+winspoolEPSON Stylus D68 SeriesUSB001EPSON Stylus D68 Series< 4dhhA4 297 x 210 mmEPSON Stylus D68 SeriesDLLName32=E_FUICAAE.DLLP TS_URLTSupportURL PSOLVER4  hhL hh q**** q****d2  ROGIhh>   ((((RtC+winspoolEPSON Stylus D68 SeriesUSB001EPSON Stylus D68 Series< 4dhhA4 297 x 210 mmEPSON Stylus D68 SeriesDLLName32=E_FUICAAE.DLLP TS_URLTSupportURL PSOLVER4  hhL hh q**** q****d2^Graph*@@wwwwww?wwwwww?k0WDashSettings#  !Normal@ Arial<HHHH$$Normal@ Arial<HHHH$$444444 m Normal@ Arial<HHHH$$4 4 4 4 4 4 homeWOd0vtD:Wolfgang:Projects:Gedaddel:Latex stuff:iLaTeX:D:Wolfgang:Projects:Gedaddel:Latex stuff:iLaTeXfP&,|( @ |`|]|m|@|L!( @ `V8Աg^22LaTeXdirWOd0vtD:Wolfgang:Projects:Gedaddel:Latex stuff:iLaTeX:D:Wolfgang:Projects:Gedaddel:Latex stuff:iLaTeXfP&,|( @ |`|]|m|@|L!( @ `V8Աg^22LatexInIgor\Td0vtD:Wolfgang:Projects:Gedaddel:Latex stuff:LatexInIgor:D:Wolfgang:Projects:Gedaddel:Latex stuff:LatexInIgor&,|( @ |`|]|m|@|L!( @ `V8Աl^22,RecentWindowsAdvanced 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_EndXOPState_StartData Browser onsGizmofGraph2:weibull (Graph2)PeakFunctions2lp Browserpanel)GetInputStategor Shortcuts.ihfGBLoadWaveQSurface PlotteriLaTeX 2010kData Browserroot4XOPState_End\>Pj>>!kdummy?.@0@2@8@B@F_PW55DBtxt????W6134181205129141181671931721510 ޸W55DBcol????PCGPCGPCGPCGPCGPCGPCGPCG@F@F@FPCG@F@F@FPCG@F@F@FPCGPCGPCGl>оDBrad?55?Gz?)\(?> ףp=??{Gz?(\?HL lWLbeparameter????Wmusigmagamma zywave0?LOa4@9@?lWweibull?SaSaގ?]b? >F?}H>?_ⱕ?zȔ?4ߓ?o5%?6glT?t2?i U?%vd?&tȦV? 齋?& 1?!=?IA?ܰ/ޅ?An ?NW D?]P;z ?0]?\?aw}?!b z{?(ty?4H@w?٭F v?+]t?-bF s?Tq?5?}Up? 8ɏ4n?'.oA>0>u>! >M#{>}g.9>?Bč>t*>@V"1J>ws>~ $>n`>0ɼ>#Ka>M~>>a>l>e5oK>ԹN""> 8qV>N:8>PPc>9yHi'>l+> [[E0>Lڐ>i8B> u>|Zm>B5t&ĥ>,>&>>%oҖK>g{>ݧ48>%Z>$>E[>2Y >')>IqM>^G&|>;Z+ɛy>˃u>{c#r>I0Wp>v Ml>"~h> 0e>U2Rb>*e˫_>˳gq[[>r[{W>Y aT>%>Q> SJON>:(J>@d}F>LxE\C>Ή~E@> Ai4<>!qȺ8>'5>ܥ*2>y~v//>V*> $&>t#>; >b\>[>m>>w!>tǏM$^ >L{ǭ> Packages7s!x*W iLaTeXs7s!8>Pj>>labelsONbeQuiet?cleanUp?baseResb@aaLevel@LaTeXruns@lastResb@LaTeXcommandSymbol@texFileNameSymbol=D:Wolfgang:Projects:Gedaddel:Latex stuff:iLaTeX:iLaTeXtmp.texNotebookFileymbol=D:Wolfgang:Projects:Gedaddel:Latex stuff:iLaTeX:iLaTeXtmp.ifnf99LaTeXenvironments8????'(raw)[display]{refs}$math$verb+chem+ &xضLaTeXPNG_depth?==@@@0A@@@??@`8W99LaTeXcommands8????)$^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]cirxs`WLaTeXcmdPos2?99AhBWLaTeXcmdPar1?99@@@@@@@@@@@@@@@ PSFontInfo7s! W8X WTTtoPS W ????.@VArialArial NarrowBook AntiquaBookman Old StyleCentury GothicCentury SchoolbookCourier NewMonotype CorsivaMonotype SortsSymbolTimes New RomanHelveticaHelvetica-NarrowPalatinoBookmanAvantGardeNewCenturySchlbkCourierZapfChanceryZapfDingbatsSymbolTimes.<NYiw}DvW7TTPSFNames 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 &6cRWPSSymbolNames W????0@VSymbolZapfDingbats *F)d0TMW????(iLaTeXtmp.ifnNotebook0Notebook0:iLaTeXtmp.ifn++,11$Normal < BHHHH$$FZ<\M#B#H#######(FIf 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) OVW6 --t1lib enables PostScript Type1 fonts (default on) instead of gsftopk (only if T1lib font library was present at compile time, FreeType has precendence) ?FGother 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?! #$(ELlp 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@   $&tzfR$tV,\section figurecaption indentedHH indented+HH figurecaption+ figurecaption+ Normal+  Normal+  r5  ``M!;RR``d(zPNG  IHDR5=Xh$PLTE...AAArrr888TTT(:#tRNS@f#IDAT(}бN0HO;d*BY%kRh. R@r9MPqٟ6έCt ŧ{xK*L/)]ӺL"nNlTe6;mT:0b o{cgo'7 -5;{Ѩ=ZSQ ; Wk} 4D.Zlh3DbZ߷-),;d"C΀0g\-\ӥ5Κ pS`XINh^~o)IENDB`d,FPNG  IHDR;9h$PLTE...AAATTTrrr888aPtRNS@fHIDAT(?KA6[-l Y04́E4Bl9H Iu\$4Ee^ h{of᠞`h1vnp^V89b> r+3 EcTW+c=Ht,\CV[cu%ֹq& t$k~̽Mx;~ʈ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