[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#635491: latex-unicode bug+patch: requires PDF output, but should not



forwarded 635491 jeltsch@informatik.tu-cottbus.de
thanks

(Please keep 635491@bugs.debian.org in the CC in replies.)


I discovered the "missing ucs.dtx" described in my previous message
while trying to prepare a patch for latex-unicode; I wanted to make it
a clean patch to the ucs.dtx file (true "original" source), but as I
did not find that file, here's that patch in form of a patch to the
ucshyper.sty file directly. Here's a description of the bug it solves:


ucshyper.sty tries (buggily) to disable itself when (la)tex is not run
in PDF output mode. But ucshyper works like a charm when producing a
DVI meant for post-processing with dvipdfm (and hyperref loaded with
hdvipdfm driver). I have only tested it with pdf(la)tex running in DVI
output mode, but I expect "plain" (la)tex would work just as well.

Patch attached. Assumes e-tex (uses \ifdefined). I assume this is OK.
I disabled the loading of hyperref, so that the user can choose hir
hyperref driver freely; instead a call to \hypersetup{unicode=true},
and hence a requirement that ucshyper be loaded *after* hyperref.

What would be your thoughts about upgrading the warnings (or maybe one
of them) to errors?


When I say that is buggy in its detection of PDF output mode, I
obviously refer to the issues explained in
http://www.tex.ac.uk/cgi-bin/texfaq2html?label=whatengine
As it should not try to abort when not in PDF mode, that point is moot
anyway.

-- 
Lionel
--- /usr/share/texmf-texlive/tex/latex/ucs/ucshyper.sty	2006-01-13 01:10:12.000000000 +0100
+++ ucshyper.sty	2011-07-26 12:47:40.000000000 +0200
@@ -7,19 +7,29 @@
 %% ucs.dtx  (with options: `ucshyper.sty')
 %% 
 %% Copyright 2001 Dominique Unruh <dominique@unruh.de>
+%% Changed directly (not through ucs.dtx)in 2011 by
+%% Lionel Elie Mamane <lionel@mamane.lu>
+%% to allow use with .tex -> .dvi -> .pdf toolchain
+%% with latex and dvipdfm, using hyperref's hdvipdfm driver.
 %% 
 %% This program is provided under the terms of the LaTeX Project Public
 %% License with some modifications.
 %% See the file LICENSE (http://www.unruh.de/DniQ/latex/unicode/content/LICENSE)
 %% for information.
 %% 
-\ProvidesPackage{ucshyper}[2002/03/05
+\ProvidesPackage{ucshyper}[2011/07/26
     UCS: Unicode in Hyperref's PDF bookmarks]%
-\ifx\pdfoutput\undefined
-  \PackageWarning{ucshyper}{ucshyper needs to be run with
-    pdflatex.\MessageBreak Disabling functionality}%
+\ifdefined\PrerenderUnicode\else%
+\PackageWarning{ucshyper}{ucshyper needs to be run with
+    inputenc utf8x.\MessageBreak Disabling functionality}%
   \expandafter\endinput\fi
-\RequirePackage[pdftex,unicode]{hyperref}
+\ifdefined\hypersetup%
+ \hypersetup{unicode=true}%
+\else%
+  \PackageWarning{ucshyper}{ucshyper needs to be loaded after
+      hyperref.\MessageBreak Disabling functionality}%
+    \expandafter\endinput%
+\fi%
 \newif\ifucshyper@prerender\ucshyper@prerendertrue
 \newif\ifucshyper@direct\ucshyper@directtrue
 \DeclareOption{nodirect}{\ucshyper@directfalse}%

Reply to: