Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > More E-Book Readers > iRex

Notices

Reply
 
Thread Tools Search this Thread
Old 10-13-2007, 11:45 PM   #1
alanine
Connoisseur
alanine has a complete set of Star Wars action figures.alanine has a complete set of Star Wars action figures.alanine has a complete set of Star Wars action figures.alanine has a complete set of Star Wars action figures.
 
Posts: 54
Karma: 399
Join Date: Sep 2007
Device: iLiad v2
PDF creation from Latex using CJK fonts

Hi, I'm a new comer, and just want to share some recent experience creating PDF contents with embeded CJK (Chinese/Japanese/Korean) Truetype fonts from Latex. The result is very pleasant, with page turn speed almost matching English content using built-in fonts.

Latex is a nice system for PDF production, and there is already CJK package for Latex, in addition to which, you need to install your own set of CJK fonts for use with Latex. But even after you have done all that, you may find that your PDF with CJK fonts loads all fine into Acrobat Reader, but unbearably slow on iLiad.

The trouble is really with ipdf, the PDF viewer on iLiad. It simply can't handle PDFs with many embeded subfonts, which is often the case of using Type1 fonts for CJK contents. The issue is NOT that ipdf can't deal with a big set of embeded fonts, but that it can't deal with too MANY font sets. Bad implementation or some other reason, but that's not the focus here.

Long story short, you'll need your Truetype fonts and a tool called dvipdfmx, which is able to embed Truetype font directly into the PDF without rasterizing them into bitmaps. This has many advantages, big header, smooth zoom, and smaller size. Most importantly, it put all fonts of the same size into a single CID-indexed font set, which can be handled smoothly by ipdf on iLiad without any apparent lag. This way you create your text document, use latex to compile it into DVI file, and then use dvipdfmx to produce the final PDF.

You'll need CJK package for Latex, dviipdfmx, Truetype fonts, and Adobe CMap files to start with. The detail installation step is given in my Wiki, so I won't repeat it here. Though it is very Chinese specific, I'd imagine Japanese or Korean fonts won't be very much different. I hope this piece information is useful for CJK users.

I'm attaching a sample file here, and the style file iliad.sty is given below:

Code:
\usepackage[colorlinks,dvipdfm]{hyperref}
\usepackage[dvipdfm,lmargin=.1in,rmargin=.1in,tmargin=0in,bmargin=0.1in,
                   nohead,nofoot,paperwidth=4.72in,paperheight=5.79in]{geometry}
\headheight 0.2in
\headsep 0.04in
\textheight 5.50in
\usepackage{times}
\usepackage{hyperref}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\rhead[\small{\sectionname}]{\small{\sectionname}}
\lhead[\small{\filename}]{\small{\filename}}
\newcommand{\mysection}[2]{\section*{#1}\label{#2}\renewcommand{\sectionname}{#1}}
\newcommand{\myfile}[1]{\renewcommand{\filename}{#1}}
\newcommand{\sectionname}{}
\newcommand{\filename}{}
I use the hyperref to create links in PDF. The actual tex is something like this:

Code:
\documentclass[10pt]{report}
\usepackage{iliad}
\usepackage{CJK}
\begin{document}
\begin{CJK*}{GBK}{your font name go here}
...
\myfile{file name to appear top left}
...
\hyperref[section label]{reference text to the section}
...
\mysection{section name to apear top right}{section label for cross reference}
...
\clearpage{}
\end{CJK*}
\end{document}
The final clearpage is important for cross-reference to show up correctly.
Attached Files
File Type: pdf sample-zaobao.pdf (271.0 KB, 1050 views)

Last edited by alanine; 10-14-2007 at 12:09 AM.
alanine is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
LaTeX, a way to PDF Sweetpea Workshop 62 05-22-2010 10:00 PM
Latex, PDF and the PRS-600 Dictionary s3ntient PDF 4 11-06-2009 09:35 AM
CJK fonts on North American PRS-505 possible? Abisha Sony Reader Dev Corner 9 04-29-2009 10:21 PM
PDF Generated with LaTeX for the iLiad Hadrien iRex 17 07-25-2008 09:59 AM
latex template for sony reader pdf technicolor Sony Reader 10 07-25-2008 09:51 AM


All times are GMT -4. The time now is 12:53 PM.


MobileRead.com is a privately owned, operated and funded community.