Subject: bug#2666: 23.0.91; TeX calendar and UTF-8 encoding

From: Peter Dyballa <[email-masked]>
Date: Fri, 13 Mar 2009 22:16:53 +0100

Hello!

I have localised calendar to show month and day names in German. This  
month is März. When I create a (La)TeX calendar, it's in UTF-8  
(because of my shell environment), the ä is 0xC3 0xA4 or Ã¤ in ISO  
8859-1 or Ã€ in ISO 8859-15. The latter is my preferred LaTeX input  
encoding since it allows to use our currency sign, the €. This now  
makes it necessary to use the textcomp package in LaTeX.

Is it possible to make the output produced or its encoding more  
flexible, adapt itself to the default encoding of GNU Emacs? If not,  
could the documentation be updated to state which encoding is used  
and that the user should use cal-tex-preamble-extra to adapt for that?

I have some difficulties with the documentation of cal-tex-preamble- 
extra. Its doc-string contains

    For example, to include extra packages:
    "\\usepackage{foo}\n\\usepackage{bar}\n".

but when I use \\ and \n in the customisation interface these appear  
unchanged in the calendar.tex buffer. (Actually LaTeX does not  
complain when a few commands are concatenated to build a long line.)  
I haven't yet saved my customisation – if this explains the  
difference between theory and practise.

I'd also recommend to use the report class instead of article in the  
LaTeX output generated: no useless AUX file is created then. Other  
differences won't show up.

Another improvement would be to update some old LaTeX code, for  
example the

	\special{landscape}{}%

This would only work for ancient DVI output. Modern XeTeX and pdfTeX  
do not understand this. A completely orthogonal solution is:

	\usepackage[landscape]{geometry}

Between ``[´´ and ``]´´ is also the correct place to define the margin:

	\usepackage[landscape,nomarginpar,top=0pt,margin={-2cm,-2cm}]{geometry}

It should be OK to just use:

	\usepackage[landscape,nomarginpar,top=0pt]{geometry}

It's not necessary to set \textwidth and \textheight. There is  
probably no-one using a TeX distribution elder then 15 years, i.e.,  
it will be teTeX or TeX Live based. In these distributions a TeX  
configuration file sets the default paper size. To switch from  
landscape to portrait just remove the ``landscape,´´ option from the  
line loading the geometry package or set clearly:

	\usepackage[portrait,nomarginpar,top=0pt]{geometry}

This package is in all TeX distributions. Since some years (<10) this  
is also true for the Latin Modern fonts (texdoc lm-info), which are  
planned as a modernised update and substitute of all CM fonts in a  
modern font format (OTF), which can be loaded via

	\usepackage{lmodern}

(actually PostScript fonts are used here). It could also be thought  
of making the LaTeX output XeTeX compatible (loading ifpdf and  
ifxetex packages, loading the fontspec package for XeTeX and setting  
a system font, for example Times, or leaving the default Latin Modern).

In GNU Emacs 23.0.91.1 (powerpc-apple-darwin8.11.0, GTK+ Version 2.14.7)
  of 2009-03-13 on localhost
Windowing system distributor `The XFree86 Project, Inc', version  
11.0.40400000
configured using `configure  '--without-sound' '--without-pop' '-- 
with-dbus' '--with-libotf' '--x-includes=/opt/local/include' '--x- 
libraries=/opt/local/lib' '--enable-locallisppath=/Library/ 
Application Support/Emacs/calendar23:/Library/Application Support/ 
Emacs' 'PKG_CONFIG_PATH=/opt/local/lib/pkgconfig:/usr/local/lib/ 
pkgconfig:/usr/lib/pkgconfig' 'CFLAGS=-Wno-pointer-sign -H -pipe - 
fPIC -mcpu=7450 -mtune=7450 -fast -mpim-altivec -ftree-vectorize - 
foptimize-register-move -freorder-blocks -freorder-blocks-and- 
partition -fthread-jumps -fpeephole -fno-crossjumping' 'LDFLAGS=- 
dead_strip -multiply_defined suppress -L/opt/local/lib' 'CPPFLAGS=''

Important settings:
   value of $LC_ALL: nil
   value of $LC_COLLATE: nil
   value of $LC_CTYPE: de_DE.UTF-8
   value of $LC_MESSAGES: nil
   value of $LC_MONETARY: nil
   value of $LC_NUMERIC: nil
   value of $LC_TIME: nil
   value of $LANG: de_DE.UTF-8
   value of $XMODIFIERS: nil
   locale-coding-system: utf-8-unix
   default-enable-multibyte-characters: t

Major mode: Info

Minor modes in effect:
   shell-dirtrack-mode: t
   diff-auto-refine-mode: t
   show-paren-mode: t
   display-time-mode: t
   desktop-save-mode: t
   tooltip-mode: t
   mouse-wheel-mode: t
   menu-bar-mode: t
   file-name-shadow-mode: t
   global-font-lock-mode: t
   font-lock-mode: t
   blink-cursor-mode: t
   global-auto-composition-mode: t
   auto-composition-mode: t
   auto-encryption-mode: t
   auto-compression-mode: t
   column-number-mode: t
   line-number-mode: t
   transient-mark-mode: t

--
Mit friedvollen Grüßen

   Pete

Imbecility, n.:
	A kind of divine inspiration, or sacred fire affecting
	censorious critics of this dictionary.
			– Ambrose Bierce: _The Devil's Dictionary_