On 3-dec-2006, at 20:32, Kevin Ballard wrote:
On Dec 3, 2006, at 2:10 PM, Maarten Sneep wrote:
I scan the whole line where the insertion point is, and open the first one I find. A variation of the command opens all referenced files in the current document. For the graphics you may want to perform some additional trickery (people who use metapost may want the source of the image, rather than the pdf -- and some more name- mangling may be needed).
If you tell me what sort of trickery you'd like, I can try and modify the command to use it.
\include: extension is never included in the tex source, extension is always .tex \input: extension may be omitted, when not present it is assumed to be .tex. Can be anything. \includegraphics: extension may be omitted. Depends on engine what the possibilities are: classic TeX: .eps, perhaps .tif. pdf TeX: .pdf, .jpg, .png, .mps. - if jpg or png are found, open them directly (no likely text-based source available). - for .mps try to open the same basename with extension .mp (metapost), as it is likely the source for the graphic. - if the pdf ends in "-1.pdf", try to open the same basename, without -1 and extension .mp (file-1.pdf -> file.mp) and sroll to beginfig(1) in that file. "1" can be replaced by any number "0" … "255". The tool mptopdf produces this output.
For eps there can be any kind of source, and guessing which one it acutally is is going to be hard. Besides, current developments in luatex point to all future things in TeX being done in pdf (dvi is going the way of the dodo).
Well, TextMate likes to save things as UTF-8. I have an idea, but I don't know if it would actually work quite right. Tell me what you think:
Let TextMate save files as UTF-8. Specify a %!TEX encoding = enc- name. The Typeset command could then pass the file through iconv to convert to the desired encoding, and save it temporarily on disc as .filename.converted.tex, and then pass the -jobname switch to pdflatex to tell it to use the original filename as the name for the job.
That might work, but as a backup, the option for \usepackage[encoding] {inputenc} should be scanned as well, since that tells TeX what to expect.
Maarten