teTeX

Marcin Dalecki dalecki w cs.net.pl
Wto, 16 Lut 1999, 18:55:23 CET


Ziemek Borowski wrote:
> 
> [wtorek, 16 luty 1999], Marcin Dalecki napisa³(a):
> 
> > Poniewaz wciaz nadal nie udalo mi sie scignac pelnego CVS-u PLD,
> > chcialbym spytac czy ktos troszczyl sie juz o instalacje TeX-a?
> tak i nie. tj. ja mam rozgrzebanego, ale ostatnio nie mam na
> nic sensownego czasu.
> 
> > Bowiem ostatnio wlasnie instalowalem cos podobnego na bazie RedHat 5.2
> > dla kumpla studiujacego slawistyke i historie. Przygotowalem wiec
> > odpowiednie laty do wspomagania jezykow: polski, rosyjski itp.
> Co znaczy ³aty? W szczególno¶ci MeX/platex nie bardzo nadaj± siê na ³atê
> bo razem maj± 1.5Mb+1.8 PSowe fonty.

Nie ja mysle przede wszyskim o wykozystaniu babel+domyslne wlaczenie
rozdzielania
wierszy dla polskiego i rosyjskiego. Oczywiscie wloski mozemy sobie
smialo darowac.

> Chyba, ¿e ta ³ata, jest podobna do tego co ostatnio zrobi³ Gafton w rawhide:
> - enable italian formatting
> polegaj±ce na w³aczeniu w pliku konfiguracyjnym w³oskiej hypenacji.

No i oczywiscie trzeba rowniez zainstalowac odpowiednie czcionki
wymagane przez babel dla rosyjskiego. Nastepnie nalezy zalatac mktexmf
oraz
wywolac mktexfonts na nowo.

> Dla jasno¶ci: w tetexu i TeXLive pod Unices robi siê to narz±dkiem texconfig,
> a dok³adniej texconfig hyphen, wywo³uj±cym $EDITOR na tym¿e language, a potem
> generuj±cym odpowiednie formaty. Pó¼niejsze, po skompilowaniu i
> spakowaniu w RPMa, wywo³ywanie rozwala pliki formatów niszcz±c
> mo¿liwo¶æ ich weryfikacji:
> .5....T   /usr/share/texmf/ls-R
> ..5....T   /usr/share/texmf/tex/generic/config/language.dat
> S.5....T   /usr/share/texmf/web2c/amstex.fmt
> S.5....T   /usr/share/texmf/web2c/amstex.log
> S.5....T   /usr/share/texmf/web2c/elatex.efmt
> S.5....T   /usr/share/texmf/web2c/elatex.log
> S.5....T   /usr/share/texmf/web2c/etex.efmt
> S.5....T   /usr/share/texmf/web2c/etex.log
> S.5....T   /usr/share/texmf/web2c/lambda.fmt
> S.5....T   /usr/share/texmf/web2c/lambda.log
> S.5....T   /usr/share/texmf/web2c/latex.fmt
> S.5....T   /usr/share/texmf/web2c/latex.log
> S.5....T   /usr/share/texmf/web2c/tex.fmt
> S.5....T   /usr/share/texmf/web2c/tex.log
> S.5....T   /usr/share/texmf/web2c/latex.fmt
> S.5....T   /usr/share/texmf/web2c/latex.log
> 
> i generalnie zawarto¶æ /usr/share/texmf/web2c
> ale z drugiej strony nie jeste¶my w stanie w³±czyæ
> wszystkich wzorców przenoszenia (rejestry texowe do tego nie wystarcz±).

Owszem owszem, ale s±dzê ¿e w dystrybucji PLD smia³o mo¿na w³±czyæ
domy¶lnie Polski. Formaty s± generowane domy¶lnie podczas pakowania,
a dok³adniej tu¿ po zakoñczeniu kompilacji tex-a.


> > Dodatkowo texconfig nie pokazuje jak sie nalezy kolorow i ramek, bo
> > nie rozpoznaje ze pod linux-em nie ma potrzeby podmieniania TERMINFO
> > przed wywolaniem programu dialog... (wystarczy wstawic odpowiedni
> > case tuz po rozpoznawaniu FreeBSD).
> 
> a podes³a³by¶ to?

No problemski. 
Dzi¶ mam UNIX98-pty na agendzie. 
A wiêc przepraszam za nieco niechlujno¶ci...

A wiec oto ³ata na texconfig

--- texconfig-orig      Mon Feb  1 02:52:18 1999
+++ texconfig   Tue Feb 16 18:37:40 1999
@@ -156,7 +156,7 @@
   own_dialog=false
   { u=`uname -s`; } 2>/dev/null
   case "$u" in
-    FreeBSD)
+    FreeBSD|Linux)
       DIALOG_PROG=/usr/bin/dialog
       test -x "$DIALOG_PROG" && own_dialog=true;;
   esac                                                    

Mo¿na wiêc równie¿ smia³o wy³±czyæ kompilacjê w³asnego dialog
z teTeX-a.

W attachmencie natomiast s± ³aty konieczne dla odpowiednich
programów generujacych czcionki, aby w³±czyæ Rosyjski.
Rosyjskie czcionki wyci±gn±³em z aktualnej rozwojowej wersji
tetex-a i znajduj± siê one pod /usr/share/texmf/fonts/source/lh.
Tego jest nieco zadu¿o aby pakowaæ to na listê pocztow±.
Nie polecam równie¿ pe³nego przej¶cia na rozwojowe wersje teTeX-a,
albowiem s± one jak narazie jeszcze stanowczo zbyt chwiejne.

Trzecia za³±czona ³ata to ta konieczna aby kdvi z kdegraphics,
dzia³a³ poprawnie w "RedHat-owatym" otoczeniu.

--Marcin
-------------- nastêpna czê¶æ ---------
--- mktexmf.orig	Thu Mar 26 20:10:29 1998
+++ mktexmf	Thu Oct  1 16:16:24 1998
@@ -36,9 +36,9 @@
   rootfile=$sauterroot
 else
   case $rootname in
-    wn*)
-       lhname=`echo $name | sed 's/^wn/lh/'`
-       rootfile=`kpsewhich $lhname.mf 2>/dev/null`;;
+    wn*|lh*|ll*|rx*|la*|lb*|lc*)
+       lhprefix=`echo "$name" | sed 's/^\(..\).*/\1/'`
+       rootfile=`kpsewhich ${lhprefix}codes.mf 2>/dev/null`;;
     *)
        rootfile=`kpsewhich $rootname.mf 2>/dev/null`;;
   esac
@@ -94,10 +94,9 @@
 generate $rootname;
 END
     ;;
-  wn*)
+  wn*|lh*|ll*|rx*|la*|lb*|lc*)
     cat > "mf$$.tmp" <<END
-wncoding:=1;
-input $lhname;
+input fikparm;
 END
     ;;
   *)
-------------- nastêpna czê¶æ ---------
--- mktexnam.orig	Wed Mar 18 21:50:14 1998
+++ mktexnam	Tue Sep 29 22:30:29 1998
@@ -47,11 +47,12 @@
 if test -z "$fullname"; then
   rootname=`echo $NAME | sed 's/[0-9]*$//'`
   fullname=`kpsewhich "b-$rootname.mf" 2>/dev/null`
-  # Fonts starting with wn* get special treatment:
+  # LH fonts get special treatment:
   if test -z "$fullname"; then
     case $rootname in
-      wn*) lhname=`echo $NAME | sed 's/^wn/lh/'`
-           fullname=`kpsewhich "$lhname.mf" 2>/dev/null`;;
+      wn*|lh*|ll*|rx*|la*|lb*|lc*)
+           lhprefix=`echo $NAME | sed 's/^\(..\).*/\1/'`
+           fullname=`kpsewhich "${lhprefix}codes.mf" 2>/dev/null`;;
       *)   fullname=`kpsewhich "$rootname.mf" 2>/dev/null`
     esac
   fi
-------------- nastêpna czê¶æ ---------
diff -ur kdegraphics-1.1/kdvi/kpathsea/xputenv.c kdegraphics-1.1-new/kdvi/kpathsea/xputenv.c
--- kdegraphics-1.1/kdvi/kpathsea/xputenv.c	Sat Oct 18 13:34:00 1997
+++ kdegraphics-1.1-new/kdvi/kpathsea/xputenv.c	Sun Feb 14 19:18:19 1999
@@ -1,25 +1,30 @@
 /* xputenv.c: set an environment variable without return.
 
-Copyright (C) 1993, 94 Karl Berry.
+Copyright (C) 1993, 94, 95, 96, 97, 98 Karl Berry.
 
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
+This library is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Library General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
+You should have received a copy of the GNU Library General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #include <kpathsea/config.h>
 
-/* Avoid implicit declaration warning.  */
+#ifdef WIN32
+#include <stdlib.h>
+#else
+/* Avoid implicit declaration warning.  But since some systems do
+   declare it, don't use a prototype, for fear of conflicts.  */
 extern int putenv ();
+#endif /* not WIN32 */
 
 /* This `x' function is different from the others in that it takes
    different parameters than the standard function; but I find it much
@@ -30,19 +35,22 @@
    hundreds of times on a run.
    
    But naturally, some systems do it differently. In this case, it's
-   net2 that is smart and does its own saving/freeing. If you can write
-   a test for configure to check this, please send it to me. Until then,
-   you'll have to define SMART_PUTENV yourself. */
+   net2 that is smart and does its own saving/freeing.  configure tries
+   to determine this.  */
 
 void
 xputenv P2C(const_string, var_name,  const_string, value)
 {
-  static const_string *saved_env_items = NULL;
-  static unsigned saved_len;
   string old_item = NULL;
   string new_item = concat3 (var_name, "=", value);
+  unsigned name_len = strlen (var_name);
 
 #ifndef SMART_PUTENV
+
+  static const_string *saved_env_items = NULL;
+  static unsigned saved_len;
+  boolean found = false;
+
   /* Check if we have saved anything yet.  */
   if (!saved_env_items)
     {
@@ -54,20 +62,29 @@
     {
       /* Check if we've assigned VAR_NAME before.  */
       unsigned i;
-      unsigned len = strlen (var_name);
-      for (i = 0; i < saved_len && !old_item; i++)
+      for (i = 0; i < saved_len && !found; i++)
         {
           if (STREQ (saved_env_items[i], var_name))
             {
+              found = true;
               old_item = getenv (var_name);
+#ifdef WIN32
+	      /* win32 putenv() removes the variable if called with
+		 "VAR=". So we have to cope with this case. Distinction
+		 is not made between the value being "" or the variable
+		 not set. */
+	      if (old_item)
+		old_item -= (name_len + 1);
+#else
               assert (old_item);
               /* Back up to the `NAME=' in the environment before the
                  value that getenv returns.  */
-              old_item -= (len + 1);
+              old_item -= (name_len + 1);
+#endif
             }
         }
-      
-      if (!old_item)
+
+      if (!found)
         {
           /* If we haven't seen VAR_NAME before, save it.  Assume it is
              in safe storage.  */
@@ -78,17 +95,35 @@
     }
 #endif /* not SMART_PUTENV */
 
-  /* As far as I can see there's no way to distinguish between the
-     various errors; putenv doesn't have errno values.  */
-  if (putenv (new_item) < 0)
-    FATAL1 ("putenv (%s) failed", new_item);
-  
+  /* If the old and the new values are identical, don't do anything.
+     This is both more memory-efficient and safer as far as our
+     assumptions (about how putenv is implemented in libc) go.  */
+  if (!old_item || !STREQ (old_item, new_item))
+    {
+      char *new_val;
+      /* As far as I can see there's no way to distinguish between the
+         various errors; putenv doesn't have errno values.  */
+      if (putenv (new_item) < 0)
+        FATAL1 ("putenv (%s) failed", new_item);
+
+      /* If their putenv copied `new_item', we can free it.  */
+      new_val = getenv (var_name);
+      if (new_val && new_val - name_len - 1 != new_item)
+        free (new_item);
+
 #ifndef SMART_PUTENV
-  /* Can't free `new_item' because its contained value is now in
-     `environ', but we can free `old_item', since it's been replaced.  */
-  if (old_item)
-    free (old_item);
+      /* Can't free `new_item' because its contained value is now in
+         `environ', but we can free `old_item', since it's been replaced.  */
+#ifdef WIN32
+      /* ... except on Win32, where old_item points to garbage if we set the
+         variable to "".  So we recognize this special case.  */
+      if (old_item && value && *value)
+#else
+      if (old_item)
+#endif
+        free (old_item);
 #endif /* not SMART_PUTENV */
+    }
 }
 
 


Więcej informacji o liście dyskusyjnej pld-devel-pl