[texshop] Suffix .tex
Bruno Voisin
bvoisin at icloud.com
Wed Nov 20 15:39:08 CET 2024
> On 20 Nov 2024, at 14:17, Friedrich Vosberg <post at vatolin.de> wrote:
>
> I think anywhere in TeXShop is a switch or checkbox for enabling suffix .tex to be added on each name of a file saved as a TeX document. But I can not find it.
>
> Would some of you, please, so kind and hold a torch for me to find it?
TeXShop adds the .tex extension automatically to every file it saves, unless you have selected something else in the File Format pull-down menu of the Save dialog:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot 2024-11-20 at 15.14.20.png
Type: image/png
Size: 263175 bytes
Desc: not available
URL: <https://tug.org/pipermail/texshop/attachments/20241120/49b68187/attachment-0002.png>
-------------- next part --------------
By default this extension hidden, as can be seen (and changed) by selecting the file in the Finder and going to File > Get Info in the menu bar (or typing Command-I):
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot 2024-11-20 at 15.17.56.png
Type: image/png
Size: 108720 bytes
Desc: not available
URL: <https://tug.org/pipermail/texshop/attachments/20241120/49b68187/attachment-0003.png>
-------------- next part --------------
Alternatively, this can be changed in Terminal by deleting the com.apple.FinderInfo extended attribute, as in
xattr -d com.apple.FinderInfo Test.tex
This makes the extension visible.
The above is Cocoa code, from Mac OS X (ie, originating from NeXt). There's also a deprecated Carbon way, namely code dating back to the Mac OS Classic days of the last millenium. To check whether an extension is hidden, you can use say
GetFileInfo -ae Test.tex
which returns "0" if the extension is visible and "1" if it is hidden. Then,
SetFile -a E Test.tex
hides the extension and
SetFile -a e Test.tex
makes it visible.
xattr is part of macOS, whereas GetFileInfo and SetFile come with Xcode or the Command Line Tools. See also
https://superuser.com/questions/399899/show-hide-extension-of-a-file-through-os-x-command-line
Finally, I don't know whether TeXShop can be set to make the extension visible by default when saving a file.
Hope this helps,
Bruno Voisin
More information about the texshop
mailing list.