[OS X TeX] utf8 problem and one TeXShop bug

Chabot Denis chabotd at globetrotter.net
Tue Apr 17 04:21:27 CEST 2007


Hi,

More and more I'm using

\usepackage[utf8]{inputenc}

instead of
\usepackage[latin1]{inputenc}

because I often combine output from R (open source stats package that  
prefers utf8 on mac) with LaTeX.

I had a document that compiled well when it was set to iso latin 1,  
but fails after I converted all the components to uft8 (no BOM) with  
TextWrangler.

To be precise, one table fails.

I have made a short document for the list.

%&program=pdflatex

\documentclass[12pt]{article}
\usepackage{geometry} % see geometry.pdf on how to lay out the page.  
There's lots.
\usepackage[T1]{fontenc}
\usepackage[full]{textcomp}
\usepackage{txfonts}  % au lieu de lmodern, pour avoir Times Roman
%\usepackage{lmodern}
%\usepackage[latin1]{inputenc}
\usepackage[utf8]{inputenc}
\usepackage[french,english]{babel}
\usepackage{array}   % me permet de faire des colonnes "p" justifiées  
à gauche dans Tab.x
\usepackage{booktabs} % ``Proper'' table layout

\title{}
\author{}
\date{} % delete this line to display the current date

%%% BEGIN DOCUMENT
\begin{document}

\begin{table}[htbp]
   \centering
    \caption{Nombre d'espèces de crustacés, de polychètes ou de  
mollusques à deux stations de l'estuaire du Saint-Laurent.}
   \label{tab:2stations}

\footnotesize

  \begin{tabular}[t]{@{} >{\raggedright}p{3.5cm} *{3}{c} > 
{\raggedright}p{4.8cm} @{} }
     \toprule
Emplacement &  \multicolumn{1}{c}{Crustacea} & \multicolumn{1}{c} 
{Polychaeta} &   \multicolumn{1}{c}{Mollusca} &    \multicolumn{1}{c} 
{Sources} \tabularnewline \midrule
Estuaire, sta. 408 : 22 m; 48°28'45''N, 68°37'41''O & 58 & nd &
40 & Éch. traîneau Hessler-Sanders no. 111S : Huberdeau (1982).  
\tabularnewline \addlinespace
Estuaire, sta. 487 : 90 m; 48°45'24''N, 68°49'36''O &       81 
\textsuperscript{a} &       39\textsuperscript{b} &        9 
\textsuperscript{c} & \textsuperscript{a}amphipodes gammaridiens  
seulement : Besner:1976); \textsuperscript{b}Massad (1979);  
\textsuperscript{c}Robert (1974). \tabularnewline \bottomrule
   \end{tabular}
\end{table}

\normalsize

\end{document}


This file is formatted as utf8. I do not give all the console output  
to save space, but the last few lines go like this.

!Package inputenc Error: Unicode char\u8: not set up for use with LaTeX.

See the inputenc package documentation for explanation.
Type H <return> for immediate help.
...
I.32 Estuaire, sta. 408:22
                     m; 48°28'45"N, 68°37'41"O & 58 & nd &
?

If I save this file as iso latin 1 and use the appropriate inputenc  
line in the preamble, it compiles fine (see enclosed pdf).

I thought unicode was an improvement on iso latin 1!

My second subject: a couple of months ago I reported a TeXShop bug on  
the development web site. I tried the latest version today (still  
2.10beta8, but dated 07-02-12) and the bug is not fixed. It goes like  
this: if you set the encoding to utf8 in Preferences, then you select  
File-Open, set encoding to iso latin 1, the file opens with the  
warning that "This file was opened with MacOSRoman encoding. The file  
could not be oepned with Unicode (UTF-8) encoding because it was not  
saved with that encoding. If you wish to open in another encoding,  
close the window and open again."

But if you close the window, open (while selecting iso latin 1) you  
get the same message. Essentially one can only open files in the  
encoding set in Preferences or in MacOSRoman.

Changing the encoding in Preferences to Iso Latin 1 allows me to open  
that file, but then opening another file while selecting utf8 in the  
open dialog box fails to open an utf8 file.

I'm working on a PPC mac (PowerBook G4) with OS X 10.4.9.

Bye for now,

Denis







------------------------- Helpful Info -------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/
List Reminders & Etiquette: http://www.esm.psu.edu/mac-tex/list/





More information about the macostex-archives mailing list