[OS X TeX] tex files and mdimport

Norm Gall gall at spookyhill.net
Thu Nov 17 19:25:08 CET 2005


On 17-Nov-05, at 9:47 AM, Richard Koch wrote:

> Folks,
>
> I'm hoping that Adam Maxwell or someone else will take the lead on  
> this
> one and produce an importer that we all endorse.
> When that happens (or at least when the project is truly underway)  
> I'll
> happily revise TeXShop to support it. Adam wrote me explaining
> what I'd need to do to make TeXShop work with his importer.
> I don't want to do that until it is clear that most of the front end
> makers support the same importer.
>

I don't know what Adam said to you, but if the importer has the right  
info in it, (AFAIK) TeXShop will not have to be modified at all.

All files with a .tex extension will be imported.

My LaTeX importer provides this information:

[gall at ludwig Desktop] $ mdimport -d3 foo.tex
2005-11-17 11:22:45.087 mdimport[23727] Attributes of file '/Users/ 
gall/Desktop/foo.tex' before import: {
     "_kMDItemImporterCrashed" = <null>;
     "com_apple_metadata_modtime" = 153944531;
     kMDItemContentCreationDate = 2005-11-17 11:22:11 -0700;
     kMDItemContentModificationDate = 2005-11-17 11:22:11 -0700;
     kMDItemContentType = "net.spookyhill.latex";
     kMDItemContentTypeTree = (
         "net.spookyhill.latex",
         "public.text",
         "public.data",
         "public.item",
         "public.content"
     );
     kMDItemDisplayName = {"" = "foo.tex"; };
     kMDItemKind = {"" = "LaTeX Source File"; };
}
2005-11-17 11:22:45.089 mdimport[23727] Import '/Users/gall/Desktop/ 
foo.tex' type 'net.spookyhill.latex' using 'file://localhost/ 
Applications/Emacs.app/Contents/Library/Spotlight/LaTeX.mdimporter/'
2005-11-17 11:22:45.091 mdimport[23727] Sending attributes of '/Users/ 
gall/Desktop/foo.tex' to server.  Attributes: '{
     "_kMDItemImporterCrashed" = <null>;
     "com_apple_metadata_modtime" = 153944531;
     kMDItemAuthors = ("Norman Gall");
     kMDItemContentCreationDate = 2005-11-17 11:22:11 -0700;
     kMDItemContentModificationDate = 2005-11-17 11:22:11 -0700;
     kMDItemContentType = "net.spookyhill.latex";
     kMDItemContentTypeTree = (
         "net.spookyhill.latex",
         "public.text",
         "public.data",
         "public.item",
         "public.content"
     );
     kMDItemDisplayName = {"" = "foo.tex"; };
     kMDItemKind = {"" = "LaTeX Source File"; };
     kMDItemTextContent = "\\documentclass[11pt]{article}\n\n\ 
\usepackage[T1]{fontenc}\n\\usepackage{lmodern}\n\\usepackage{spacing} 
\n\\usepackage{titling}\n\\usepackage{graphicx}\n\\usepackage 
[authoryear,sort]{natbib}\n\\bibpunct[: ]{(}{)}{,}{a}{}{,}\n\n\ 
\citestyle{authoryear}\n\n\\textwidth = 6.5 in\n\\textheight = 9 in\n\ 
\oddsidemargin = 0.0 in\n\\evensidemargin = 0.0 in\n\\topmargin = 0.0  
in\n\\headheight = 0.0 in\n\\headsep = 0.0 in\n\\parskip = 0.2in\n\ 
\parindent = 0.0in\n\n\\pretitle{\\begin{flushleft}\\LARGE\\sffamily} 
\n\\title{Brief Article\\thanks{thanks}}\n\\posttitle{\\end 
{flushleft}}\n\n\\preauthor{\\begin{flushleft}\\large\\sffamily}\n\ 
\author{Norman Gall}\n\\postauthor{\\par \\textsl{Department of  
Philosophy}\\\\\n\t\t\t\\textsl{University of Calgary}\\\\ 
\n                        \\texttt{ngall at ucalgary.ca}\\end{flushleft}} 
\n\n\\predate{\\begin{flushleft}\\sffamily}\n\\date{\\today}\n\ 
\postdate{\\end{flushleft}\\rmfamily\\vspace*{.25in}\\hrule\\vspace*{. 
15in}}\n\n\\setlength{\\droptitle}{-50pt}\n\n\\begin{document}\n\ 
\maketitle\n\n\\spacing{1.5} This is a citation \\cite[][]{1}. This  
is another\ncitation from another book \\citet[][]{14}.\n\n\\spacing 
{1}\n\\bibliographystyle{apalike}\n\\bibliography{modelArticle.bib}\n\ 
\end{document}\n";
     kMDItemTitle = "Brief Article\\thanks{thanks}";
}'
[gall at ludwig Desktop] $

I think that this does the job nicely.

> The key goal: one importer for tex.
>

Agreed. All we need is a stable UTI.

ng

> Dick
> koch at math.uoregon.edu
>
> ------------------------- Info --------------------------
> Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
>          & FAQ: http://latex.yauh.de/faq/
> TeX FAQ: http://www.tex.ac.uk/faq
> List Archive: http://tug.org/pipermail/macostex-archives/
>

-- 
There's something the technicians need to learn from the artists.
If it isn't aesthetically pleasing, it's probably wrong.

------------------------- Info --------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
          & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/




More information about the macostex-archives mailing list