[texhax] Latvian Special Characters

Daniel Greenhoe dgreenhoe at gmail.com
Mon Mar 17 10:44:43 CET 2014


On Mon, Mar 17, 2014 at 4:34 PM, Pascal <pascal.bernhard at belug.de> wrote:
> ... or just leave it at the incorrect g.
> My reviewers won't even notice :-D

The point is that *you* notice. Writing is a form of art. And it is
somewhat likely that the thesis you are to submit with your name on it
will be on permanent (and possibly public) record until the end of
time. Of course it is your decision. But I think that jobs worth doing
are worth doing right (the first time if possible).

> Using luatex or xelatex which are
> both installed on my Linux system gives me errors with UTF-8 strings for
> German and Latvian characters, although I guess this can be solved by
> replacing them with UTF-8 characters via input encoding. I'll see
> whether I will have time to fix this issue (this would mean replacing
> several hundred characters in my document, still a hassle even if using
> a LaTeX-editor)

I have tried the problem using XeLaTeX, a UTF-8 encoded file (with
BOM), and an OTF latin modern font that I downloaded from here:
  http://www.gust.org.pl/projects/e-foundry/latin-modern/download

Here is some test code (see also attached file):

\documentclass{book}

\usepackage[no-config,no-math]{fontspec}  % font selection for xelatex
\usepackage{xunicode}                 % unicode character support

 \setmainfont[
   ExternalLocation,
   Path           = {/xfonts/lm2004/},
   Extension      = {.otf},
   Mapping        = /dan/r/common/teckit/punctuation,
   UprightFont    = {*-regular},
   BoldFont       = {*-bold},
   ItalicFont     = {*-italic},
   Scale          = {1.0},
   ]{lmroman12}

\begin{document}
A Ā B    C    Č    D    E    Ē    F    G    Ģ    H    I    Ī    J    K
   Ķ    L    Ļ    M    N    Ņ    O    P    R    S    Š    T    U    Ū
  V    Z    Ž\\
a    ā    b    c    č    d    e    ē    f    g    ģ    h    i    ī
j    k    ķ    l    ļ    m    n    ņ    o    p    r    s    š    t
u    ū    v    z    ž

A /-A B C /vC D E /-E F /;G H I /-I J K /;K L /;L M N /;N O P Q R S
/vS T U /-U V W X Y Z /vZ\\
a /-a b c /vc d e /-e f /;g h i /-i j k /;k l /;l m n /;n o p q r s
/vs t u /-u v w x y z /vz

\end{document}

The output seems correct (see pdf attachment). The above example
includes both UTF-8 strings and teckit mapping strings. Both seem to
work ... so it does *not* seem to be necessary to use a teckit map
file. AND it would not seem necessary to change all the UTF-8 strings
in your document (see above example).

Kind Regards,
Dan

On Mon, Mar 17, 2014 at 4:34 PM, Pascal <pascal.bernhard at belug.de> wrote:
> Am Monday, den 17.03.2014, 01:59 +0100 schrieb Reinhard Kotucha:
>> On 2014-03-16 at 19:11:28 +0100, Pascal wrote:
>>
>>  > Hi all,
>>  >
>>  > in my master thesis I need to use some special Latvian characters.
>> Since
>>  > I'm writing the document in German I use the babel ngerman package
>> in
>>  > the preamble.
>>  >
>>  > For most special characters that works, but I hit upon a quite
>> specific
>>  > g, I could not get "diplayed" correctly so far: ģ
>>  >
>>  > The technical specifications for this letter are:
>>  > UTF-8: 0xC4 0xA3
>>  > UTF-16: 0x0123
>>  > C oktal dargestelltes UTF-8: \304\243
>>  > XML-Dezimal-Entität: ģ
>>  >
>>  >
>>  > I came upon this website (http://home.lu.lv/~drikis/TeX/) which
>> provides
>>  > "commands" for Latvian letters, but this g it does not work, and
>> since I
>>  > do not understand Latvian, I miss the instructions on how to set up
>> the
>>  > LaTeX environment in order for the "commands" to work properly.
>>  >
>>  > Here is a minimal example where the ģ is not displayed correctly:
>>  >
>>  > \documentclass{scrreprt}
>>  > \usepackage[ngerman]{babel}
>>  > \usepackage[ansinew]{inputenc}
>>  > \usepackage{lmodern}
>>
>> I wrote a few lines about typesetting multilingual documents with
>> 8-bit TeX engines.  Run
>>
>>   texdoc vntex
>>
>> and see the example on page 4 (Vietnamese and Russian).
>>
>> I don't know whether babel supports Latvian.  But I strongly recommend
>> to use a Unicode-aware TeX engine (XeTeX or LuaTeX).  You don't have
>> to select another language or encoding. Just type ģ on your keyboard
>> and ģ wil appear in the PDF file.  Of course, you have to use a font
>> wich supports ģ.
>
>
> Thanks Reinhard & Daniel for the quicks answers.
>
> I forgot to mention that I use pdflatex for compiling the document and
> for fonts I use lmodern & mathpazo. Using luatex or xelatex which are
> both installed on my Linux system gives me errors with UTF-8 strings for
> German and Latvian characters, although I guess this can be solved by
> replacing them with UTF-8 characters via input encoding. I'll see
> whether I will have time to fix this issue (this would mean replacing
> several hundred characters in my document, still a hassle even if using
> a LaTeX-editor) or just leave it at the incorrect g. My reviewers won't
> even notice :-D
>
>
> Anyway thanks for your tipps,
>
> Pascal
>
>
>
> _______________________________________________
> TeX FAQ: http://www.tex.ac.uk/faq
> Mailing list archives: http://tug.org/pipermail/texhax/
> More links: http://tug.org/begin.html
>
> Automated subscription management: http://tug.org/mailman/listinfo/texhax
> Human mailing list managers: postmaster at tug.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: diacriticslm.pdf
Type: application/pdf
Size: 9019 bytes
Desc: not available
URL: <http://tug.org/pipermail/texhax/attachments/20140317/4fe8c9dc/attachment-0001.pdf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: diacriticslm.tex
Type: application/x-tex
Size: 1070 bytes
Desc: not available
URL: <http://tug.org/pipermail/texhax/attachments/20140317/4fe8c9dc/attachment-0001.tex>


More information about the texhax mailing list