<!doctype linuxdoc system>

<article>

<title>The Linux Danish/International HOWTO
<author>Thomas Petersen, <tt/petersen@risoe.dk/
<date>v1.0, 9 March 1995
<abstract>
This document describes how to configure Linux and various
Linux applications for use with the Danish characterset and
keyboard. It is hoped that Linux users from other places
in Western Europe will find this document of use too.
</abstract>

<toc>

<sect>Introduction

<p>
All European users of almost any operating system have two
problems: The first is to tell the OS that you have a 
non-american keyboard, and the second is to get the OS to
display the special letters. 

Under Linux you change the way your computer interprets the
keyboard with the commands <tt/xmodmap/ and <tt/loadkeys/. <tt/loadkeys/
will modify the keyboard for plain Linux while 'xmodmap' makes
the modifications necessary when the handshaking between X
and Linux is imperfect.

To display the characters you need to tell your applications that you
use the ISO-8859-Latin-1 international set of glyphs. Mostly
this is not necessary, but a number of key applications need
special attention.

This Mini-Howto is intended to tell Danish users how to do this,
but will hopefully be of help to many other people.

If you continue to have troubles after reading this you should
try the German HOWTO,  the Keystroke HOWTO for Linux or the
ISO 8859-1 FAQ. They have
tips for many applications. Many of the hints contained herein 
are cribbed from there. The HOWTOs are available from all 
respectable mirrors of <tt>sunsite.unc.edu</tt> while the ISO 8859-1
FAQ is available from <tt>ftp.vlsivie.tuwien.ac.at</tt> in 
<tt>/pub/8bit/FAQ-ISO-8859-1</tt>.

<sect>Keyboard setup

<p>



<sect1><heading><label id="loadkbd">Loading a Danish keytable</>

<p>

Keyboard mappings are in <tt>/usr/lib/kbd/keytables/</tt>.
Try typing either of these two commands to load one
<tscreen><verb>
/usr/bin/loadkeys /usr/lib/kbd/keytables/dk.map 
/usr/bin/loadkeys /usr/lib/kbd/keytables/dk-lat1.map
</verb></tscreen>
The difference between the two lines is that <tt>dk-lat1.map</tt> uses 
`dead' keys while <tt>dk.map</tt> doesn't.  Dead keys are explained 
in section <ref id="deadkeys" name="DeadKeys">.

You can change the keymapping loaded at boot by editing the
file <tt>/etc/rc.d/rc.keymap</tt>.

If this doesn't work you simply haven't installed support for
international keyboards. 

<sect1>Getting the <tt>AltGr</tt> key to work under X

<p>

Edit the file <tt>/etc/Xconfig</tt> (under XFree86 2.0) or 
<tt>/etc/X11/XF86Config</tt> (underXFree86 3.x) 
and make sure the line
<tscreen><verb>
  RightAlt    ModeShift
</verb></tscreen>
appears in the <tt>Keyboard</tt> section. Usually you can do 
this by uncommenting an appropriate line.

<sect1><heading><label id="deadkeys">Dead keys and accented characters</>
<p>

Dead keys are those who don't type anything until you hit
another key. Tildes and umlauts are like this by default under 
Microsoft Windows and if you use the <tt>dk-lat1.map</tt> keymap 
under Linux.

<sect2>Removing dead key functionality

<p>
Under plain Linux type
<tscreen><verb>
loadkeys dk.map
</verb></tscreen>

<sect2>Invoking dead key functionality

<p>
<itemize>
<item>Invoking dead key functionality under plain Linux

<p>
Under plain Linux type
<tscreen><verb>
loadkeys dk-lat1.map
</verb></tscreen>

<item>Invoking dead key functionality under X11R5 sessions

<p>
Insert the following lines in a file <tt>&tilde;/.Xmodmap</tt>
or <tt>/etc/X11/Xmodmap</tt>
<tscreen><verb>
keycode 21 = acute      Dgrave_accent           bar
keycode 35 = Ddiaeresis Dcircumflex_accent      Dtilde
</verb></tscreen>
You can now make  the dead keys work by typing (e.g.) 
<tt>xmodmap .Xmodmap</tt>. Using the Slackware distribution
this commando will be automatically executed next time you
run X.

<item>Invoking dead key functionality under X11R6 sessions

<p>
Under X11R6 applications dead keys won't work unless they
were compiled with support for unusual input methods. The
only application reported to do so is <tt>kterm</tt> - an
<tt>xterm</tt> substitute. Eventually the situation might
improve, but as it is you can't do much but revert to X11R5
or hack every application you own. Do not attempt the method
described for X11R5.

</itemize>


<sect1>Making <tt/&oslash;/ (oslash) <tt/&Oslash;/ (Ooblique) and the 
dollar sign work

<p>

<sect2> <tt/&oslash;/ (oslash) and <tt/&Oslash;/ (Ooblique)

<p>
Find out what keymap you load at boot-up. You should be able
to find out by typing <tt>less /etc/rc.d/rc.keymap</tt>. 
On my computer it is
called <tt>/usr/lib/kbd/keytables/dk-lat1.map</tt>. Find the line 
for keycode 40 in this file and change it from 
<tscreen><verb>
keycode  40 = cent              yen
</verb></tscreen>
to
<tscreen><verb>
keycode  40 = oslash            Ooblique
</verb></tscreen>
and load the keytable as described in 
section <ref id="loadkbd" name="LoadKeys">.

Note: This bug appears to have been fixed in version 0.88 of 
the international keytable package.

<sect2>Dollar sign

<p>
The dollar sign is accessed with <tt/Shift-4/ instead of <tt/AltGr-4/
by default. You can fix this by changing the line
<tscreen><verb>
keycode   5 = four             dollar           dollar          
</verb></tscreen>
in the keymap file to e.g.
<tscreen><verb>
keycode   5 = four             asciicircum      dollar
</verb></tscreen>
It doesn't matter if you something else instead <tt>asciicircum</tt>
if it is just a valid symbol name. 
See section <ref id="glyphs" name="Glyphs"> for a list of valid symbols.




<sect>Display and application setup

<p>

<sect1>International character sets in specific applications

<p>
A number of applications demand special attention. This section
descibes how to set up configuration filesfor them.

<itemize>
<item><tt>bash</tt> v.1.13+ : Put the following in your <tt>.inputrc</tt> file
<tscreen><verb>
set meta-flag on
set convert-meta off
set output-meta on
</verb></tscreen>

<item><tt>tcsh</tt>: Put the following in your <tt>/etc/csh.login</tt> 
or <tt>.tcshrc</tt> file
<tscreen><verb>
setenv LC_CTYPE ISO-8859-1
stty pass8
</verb></tscreen>

<item><tt>less</tt>: Set the following environment variable
<tscreen><verb>
LESSCHARSET=latin1
</verb></tscreen>

<item><tt>elm</tt>: Set the following environment variables
<tscreen><verb>
LANG=C
LC_CTYPE=ISO-8859-1
</verb></tscreen>

<item><tt>emacs</tt>: Put the following in your <tt>.emacs</tt> or the
<tt>/usr/lib/emacs/site-lisp/default.el</tt> file:
<tscreen><verb>
(standard-display-european t)

(set-input-mode (car (current-input-mode))
	(nth 1 (current-input-mode))
	0) 
</verb></tscreen>

<item> TeX / LaTeX: Cribbed from the ISO 8859-1 FAQ by
Michael Gschwind <tt>&lt;mike@vlsivie.tuwien.ac.at&gt;</tt>:

In LaTeX 2.09, use 
<tscreen><verb>
\documentstyle[isolatin]{article}
</verb></tscreen>
to include support for ISO latin1 characters. In LaTeX2e, the
commands
<tscreen><verb>
\documentclass{article}
\usepackage{isolatin}
</verb></tscreen>
will do the job.  <tt>isolatin.sty</tt> is available from all 
CTAN servers and
from URL <tt>ftp://ftp.vlsivie.tuwien.ac.at/pub/8bit</tt>.

</itemize>

<sect1><heading><label id="glyphs">What characters you can display under Linux </>

<p>
Type <tt>dumpkeys -l | less</tt> at the prompt to find out what is
readily available. You can map them to your keyboard via the keymap
files mentioned in section <ref id="loadkbd" name="LoadKeys">.

X11R5 Note: The dead keys don't get the correct names
under X11R5 with this scheme. Generally
<tscreen>
<tt>dead_*</tt> (under plain Linux) => <tt>D*</tt> or <tt>D*_accent</tt> (under X11R5)
</tscreen>
(i.e. the tilde may be <tt/dead_tilde/ in <tt/dk-lat1.map/ but X11R5 
expects the dead tilde to be called <tt/Dtilde/.) This does not apply
to X11R6.

<sect1>Loading the Latin-1 characer set on the console

<p>
Execute the following commands under the <tt>bash</tt> shell:
<tscreen><verb>
setfont /usr/lib/kbd/consolefonts/lat1-16.psf
mapscrn /usr/lib/kbd/consoletrans/trivial
echo -ne '\033(K'
</verb></tscreen>

Note: This only has effect under plain Linux. Do not try it under X.

<sect>Post-amble: Acknowledgements and Copyright

<p>
Thanks to Peter Dalgaard, Anders Majland, the authors of the German Howto 
and Michael Gschwind for help with several questions.

This Mini-Howto is copyrighted by Thomas Petersen and distributed
as other Linux HOWTOs under the terms described below.

Linux HOWTO documents may be reproduced and distributed 
in whole or in part, in any medium physical or electronic, as long as
this copyright notice is retained on all copies. Commercial redistribution 
is allowed and encouraged; however, the author would like to be notified of 
any such distributions. 

All translations, derivative works, or aggregate works incorporating 
any Linux HOWTO documents must be covered under this copyright notice. 
That is, you may not produce a derivative work from a HOWTO and impose
additional restrictions on its distribution. Exceptions to these rules
may be granted under certain conditions; please contact the Linux HOWTO
coordinator at the address given below.

If you have questions, please contact Greg Hankins, the Linux HOWTO 
coordinator, at gregh@sunsite.unc.edu. You may finger this address for
phone number and additional contact information. 

</article>
