[OS X TeX] Texshop, bibtex and utf-8

Herbert Schulz herbs at wideopenwest.com
Mon Nov 16 09:01:32 EST 2015


> On Nov 16, 2015, at 7:45 AM, Martin Bergren <martin.berggren at cs.umu.se> wrote:
> 
>> 
>> On 16 Nov 2015, at 14:25 , Herbert Schulz <herbs at wideopenwest.com> wrote:
>> 
>>> On Nov 16, 2015, at 7:11 AM, Martin Bergren <martin.berggren at cs.umu.se> wrote:
>>> 
>>> I just noticed that when creating my bibliography  within Texshop, it gracefully handles utf-8 characters like ü and ö in the .bib file although Bibtex is 7 bits!  How does that magic work? (Bibtex is set as the engine in the preferences.a)  When running bibtex from the command line or from Texstudio I seem to get the ü:s and the like mangled.
>>> 
>>> 
>>> 
>>> 
>>> Martin Berggren
>> 
>> Howdy,
>> 
>> Hmmm... very interesting.
>> 
>> When you say ``creating my bibliography within TeXShop'' do you mean creating the .bib file or going through the (pdf/xe)latex processes running bibtex in-between or are you using one of the latexmk engines, (pdf/xe)latexmk?
> 
> I mean typesetting from within Texshop with a .bib-file created elsewhere, typically with Bibdesk.
> 
>> Could you make a minimal example along with a correspondingly minimal .bib file so I can play with it?
> 
> Attached.
> 
>> 
>> If you happen to be using one of the latexmk engines and you are using the biblatex package (which defaults to biber use unless specified to be bibtex) that engine will override the use of bibtex and use biber instead.
>> 
> 
> I’m using default stuff, I think, with bibtex and not biblatex.
> 
> I’ve attached a minimal example. When being more careful, I noticed that the terminal commands 
> 
> pdflatex umlauttest
> bibtex umlauttest
> pdflatex umlauttest
> 
> actually also works fine! Why is that? When googling the issue, everybody seem to say that bibtex cannot handle anything else but 7 bits.
> 
> When I typeset from within Texshop it also works fine, but Texstudio complains when it tries to run bibtex.
> 
> Cheers,
> 
> 
> Martin Berggren

Howdy,

I tried it out with one of my files and it does seem to work fine in both TeXShop and when processed in Terminal. My knowledge of UTF-8 encoding is minimal but it just may be that those accented characters are simply passed through bibtex without processing (will the sorting be right?) because they can be considered valid ASCII characters when the top bit is masked off.

I can only speculate about why TeXstudio doesn't like it. It may test and see that the file is saved as UTF-8 and `knows' that bibtex may not like that. Pure speculation on my part.

By the way, you may be interested in using the pdflatexmk engine in TeXShop. It's one of many engines based on the use of the latexmk perl program supplied with TeXShop; it's the only one that's active by default though---look in ~/Library/TeXShop/Engines/Inactive/Latexmk for mor information and other engines. It will automatically do all the work of typesetting the document, running bibtex, etc. Just put the line

% !TEX TS-program = pdflatexmk

near the top of your source file and use Typeset->Typeset (Cmd-T) to have TeXShop use that engine to typeset your document. If you don't like that just remove the line!

Good Luck,

Herb Schulz
(herbs at wideopenwest dot com)









More information about the MacOSX-TeX mailing list