Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
tetex: pdflatex produces low quality PDF when using utf8
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
elvanor
Developer
Developer


Joined: 11 Oct 2004
Posts: 178
Location: France

PostPosted: Tue Mar 06, 2007 12:53 pm    Post subject: tetex: pdflatex produces low quality PDF when using utf8 Reply with quote

Hello there,

I wonder if there is a correct and nice way to make LaTeX work correctly with UTF-8 encoded files. I need to type Russian and French in a single tex file.

I got it working with the following lines:
Code:

\usepackage[utf8]{inputenc}
\usepackage[russian,french]{babel}

\begin{document}

\selectlanguage{russian}

Here is some Russian: руский. (this will probably appear as garbage since the forum is not in utf-8 I think)

\selectlanguage{french}

Voilà du français. (same thing)


However, when compiling using pdflatex on my Gentoo system, the resulting PDF has poor quality: the text is rendered using bitmaps; not vectors (eg, if I zoom in a lot, pixels appear, and it should not be the case).

I was able to compile the exact same file on my Mac OS X box and got a perfectly fine PDF.

So, if there are tetex experts out there, I'd appreciate help. Note that if I only use English/French, the resulting PDF is always OK. It is using russian that makes pdflatex switch to bitmaps. Maybe I am missing some vector fonts for Russian or something?

Elvanor

PS: I tried using the latex-unicode package (with \usepackage[utf8x]{inputenc}) and this did not work at all. Also it would be nice to eliminate the need to type \selectlanguage{russian}, stuff like that. Why can't LaTeX just accepts the fact that the file is encoded in UTF-8 and so figure out correctly how to compile it?
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2977
Location: Germany

PostPosted: Tue Mar 06, 2007 3:47 pm    Post subject: Reply with quote

Got the same problem with tetex & CJK - it uses ugly bitmap fonts because those are the only ones installed by default. There are some guides and tools that explain how to convert a ttf font, which tetex can't use natively, into the format used by tex, but I never succeeded, besides the tools are hard to get by.

Some alternative TeX distributions, such as XeTeX, support Unicode and all sorts of system fonts natively. I've got some very nice results with XeTeX in Gentoo. Unfortunately, it's not nearly as stable as tetex, still in beta stage.
Back to top
View user's profile Send private message
elvanor
Developer
Developer


Joined: 11 Oct 2004
Posts: 178
Location: France

PostPosted: Tue Mar 06, 2007 5:13 pm    Post subject: Reply with quote

Thanks for the help. I've searched a bit around the net today and found out that actually, tetex is kind of deprecated (unmaintained: other Linux distros already switched to TeXLive).

I'd like Gentoo to include support for TeXLive, since it is pretty much the future. It has integrated Unicode support via XeTeX and probably tons of other goodies: it seems much more modern.

I probably have a derivative of TeXLive installed on my Mac since my Mac produces better results.

Unfortunately, it seems the transition to TeXLive won't happen soon, due to the lack of Gentoo TeX developpers. I wish I had the time to help on this...

Elvanor
Back to top
View user's profile Send private message
gotaserena
Apprentice
Apprentice


Joined: 23 Feb 2005
Posts: 153
Location: fourth worst city in the world

PostPosted: Tue Mar 06, 2007 5:59 pm    Post subject: Reply with quote

That's strange. I've used tetex with utf-8 input support for ages and never had any problems. Does any files from /usr/share/texmf/fonts/type1/bluesky/cm/ get loaded into the pdf file when you compile it? If yes you may have a problem in the viewer. You may also want to check the fontenc package to include/generate new encodings for the fonts you have installed.
Back to top
View user's profile Send private message
elvanor
Developer
Developer


Joined: 11 Oct 2004
Posts: 178
Location: France

PostPosted: Thu Mar 08, 2007 3:29 pm    Post subject: Reply with quote

Hello

Did you use utf-8 with Russian characters or any other weird alphabet (chinese, indian, etc??) ? Because I did not have this when I was only using french, which has some accents though.

How can I know if the /usr/share/texmf/fonts/type1/bluesky/cm/ files get loaded in the PDF when I compile?

How can I use the fontenc package?

Elvanor
Back to top
View user's profile Send private message
gotaserena
Apprentice
Apprentice


Joined: 23 Feb 2005
Posts: 153
Location: fourth worst city in the world

PostPosted: Thu Mar 08, 2007 5:25 pm    Post subject: Reply with quote

elvanor wrote:
Hello

Did you use utf-8 with Russian characters or any other weird alphabet (chinese, indian, etc??) ? Because I did not have this when I was only using french, which has some accents though.


My experience is with western alphabet. If French goes all right then it is most definitely fonts. You can try setting the cyrillic font in the preamble like so:
Code:
\usepackage[OT2,OT1]{fontenc}
\newcommand\cyr{%
\renewcommand\rmdefault{wncyr}%
\renewcommand\sfdefault{wncyss}%
\renewcommand\encodingdefault{OT2}%
\normalfont
\selectfont}

then you can call "{\cyr Russian text goes here!}" in the document.

Quote:
How can I know if the /usr/share/texmf/fonts/type1/bluesky/cm/ files get loaded in the PDF when I compile?


run (pdf)latex at the command line. Or look at the tex output in your editor.

Quote:
How can I use the fontenc package?


It should be already installed, so see above. With the fonts above I've managed to produce beautiful, vector-font laden gibberish in cyrillic with both tetex and texlive.
Back to top
View user's profile Send private message
el_Salmon
Guru
Guru


Joined: 15 Dec 2003
Posts: 339
Location: Around 2.4GHz

PostPosted: Mon May 21, 2007 6:48 pm    Post subject: Reply with quote

gotaserena wrote:

My experience is with western alphabet. If French goes all right then it is most definitely fonts. You can try setting the cyrillic font in the preamble like so:
Code:
\usepackage[OT2,OT1]{fontenc}
\newcommand\cyr{%
\renewcommand\rmdefault{wncyr}%
\renewcommand\sfdefault{wncyss}%
\renewcommand\encodingdefault{OT2}%
\normalfont
\selectfont}

then you can call "{\cyr Russian text goes here!}" in the document.

It should be already installed, so see above. With the fonts above I've managed to produce beautiful, vector-font laden gibberish in cyrillic with both tetex and texlive.


A lot of thanks! It works for me
Back to top
View user's profile Send private message
BitJam
Advocate
Advocate


Joined: 12 Aug 2003
Posts: 2508
Location: Silver City, NM

PostPosted: Mon May 21, 2007 7:46 pm    Post subject: Reply with quote

@elvanor, I've got TexLive installed here. If you are still having problems, maybe you could post a sample .tex file and I will see how TeXLive handles it. The TeXLive install was easy as pie. The hardest part was downloading (via bittorrent) the 1.8 Gig texlive1007 iso file. I then just mounted it loopback and ran the install program. There are a couple of tips in the forums on how to get the 2007 TexLive to play nice with Portage.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum