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

Bug#635382: texlive-latex-extra: ucshyper check for PDF mode buggy and not necessary anyway



Package: texlive-latex-extra
Version: 2009-10
Severity: normal
Tags: patch

Near beginning of ucshyper.sty:

\ifx\pdfoutput\undefined
  \PackageWarning{ucshyper}{ucshyper needs to be run with
    pdflatex.\MessageBreak Disabling functionality}%
  \expandafter\endinput\fi

This is buggy in several ways.

1) If another package loaded before ucshyper has used \@ifundefined
   to test the value of pdfoutput, then it is redefined to \relax
   instead of \undefined, and the above test will take the wrong
   branch.

2) Even if 1) is fixed, this tests whether the TeX implementation
   running is pdfTeX, while what it probably was intended to test for
   is whether the output produced is PDF... In other words, this test
   will not issue the warning if pdftex is running in DVI output mode;
   this is what happens in Debian when one runs /usr/bin/tex or
   /usr/bin/latex.

E.g. this document:

\documentclass{article}
\usepackage{ucshyper}
\begin{document}
foo
\end{document}

leads to this (La)TeX output (when run with plain latex):

LaTeX2e <2009/09/24>
(...)
Package hyperref Warning: Wrong driver `hpdftex.def';
(hyperref)                pdfTeX is not running in PDF mode.
(hyperref)                Using default driver.

*hyperref using default driver hdvips*

(...)

! Undefined control sequence.
\pdfstringdef ...@pdfstringtrue \PrerenderUnicode 
                                                  {#2}\endgroup \fi \ucshype...
l.5 \end{document}
                  
? 


Luckily (as you probably already know), the ifpdf package takes care
of these details for you, so the above code should be replaced by
something like:

\RequirePackage{ifpdf}
\ifpdf\else%
\PackageWarning{ucshyper}{ucshyper needs to be run with
    pdflatex.\MessageBreak Disabling functionality}%
  \expandafter\endinput\fi


See /usr/share/doc/texlive-doc/generic/FAQ-en/html/FAQ-ifpdf.html and
/usr/share/doc/texlive-doc/latex/oberdiek/ifpdf.pdf for more details.


However, there is a third issue even with 1) and 2) solved.


3) ucshyper does not actually need the output mode to be PDF, nor the
   TeX implementation to be pdfTeX. I just _removed_ the above test,
   as well as the following line:

\RequirePackage[pdftex,unicode]{hyperref}

and then I produce DVI with hyperref's "dvipdfm" option (driver
hdvipdfm), run it through dvipdfm and ucshyper still does its job like
a charm. For example this document:

\documentclass{article}
\usepackage[utf8x]{inputenc}
\usepackage[dvipdfm,bookmarks=true,unicode=true]{hyperref}
\usepackage{ucshyper}
\begin{document}
\section{\texorpdfstring{\ensuremath\lambda{}}{λ}}
\end{document}

latex it, run dvipdfm over the dvi, and the \lambda looks fine in
evince's side panel (Index).


So possibly this test should be changed to something like:

\ifdefined\PrerenderUnicode\else%
\PackageWarning{ucshyper}{ucshyper needs to be run with
    inputenc utf8x.\MessageBreak Disabling functionality}%
  \expandafter\endinput\fi

_and_ still remove the

\RequirePackage[pdftex,unicode]{hyperref}

line so that users can choose their own hyperref driver freely. Maybe
add instead:

\ifdefined\hypersetup%
 \hypersetup{unicode=true}%
\else%
  \PackageWarning{ucshyper}{ucshyper needs to be loaded after
      hyperref.\MessageBreak Disabling functionality}%
    \expandafter\endinput%
\fi%

I'd be tempted to promote the warnings to errors, actually.

##################################
minimal input file

See above

##################################
other files

######################################
 List of ls-R files

-rw-r--r-- 1 root root 1753 Jun 10 19:05 /var/lib/texmf/ls-R
-rw-rw-r-- 1 root staff 80 Jun 28  2010 /usr/local/share/texmf/ls-R
lrwxrwxrwx 1 root root 29 Jun 10 19:00 /usr/share/texmf/ls-R -> /var/lib/texmf/ls-R-TEXMFMAIN
lrwxrwxrwx 1 root root 27 Oct 28  2010 /usr/share/texmf-texlive/ls-R -> /var/lib/texmf/ls-R-TEXLIVE
lrwxrwxrwx 1 root root 27 Oct 28  2010 /usr/share/texmf-texlive/ls-R -> /var/lib/texmf/ls-R-TEXLIVE
######################################
 Config files
lrwxrwxrwx 1 root root 20 Jun 10 19:00 /usr/share/texmf/web2c/texmf.cnf -> /etc/texmf/texmf.cnf
-rw-r--r-- 1 root root 10081 Jun 10 19:05 /var/lib/texmf/web2c/fmtutil.cnf
-rw-r--r-- 1 root root 24192 Jun 10 19:05 /var/lib/texmf/web2c/updmap.cfg
-rw-r--r-- 1 root root 15119 Jun 10 19:05 /var/lib/texmf/tex/generic/config/language.dat
######################################
 Files in /etc/texmf/web2c/
total 4
-rw-r--r-- 1 root root 283 Nov 10  2008 mktex.cnf
######################################
 md5sums of texmf.d
3875bf0f4a53a29b7f247399dc9833e2  /etc/texmf/texmf.d/05TeXMF.cnf
6e82a3d4c00ae7e4f86aa8dcf9438cf3  /etc/texmf/texmf.d/15Plain.cnf
c60a084820a0b73e3bfbf2e90bda437c  /etc/texmf/texmf.d/45TeXinputs.cnf
ea33127256c6a9f37145ae5b16fdb80c  /etc/texmf/texmf.d/55Fonts.cnf
afccf1d3f87057411166a77c58e00bd1  /etc/texmf/texmf.d/65BibTeX.cnf
9da7c1c7b1eaf06f941af91f48a23068  /etc/texmf/texmf.d/75DviPS.cnf
7ae52efac46feb97010986e57877d12e  /etc/texmf/texmf.d/80DVIPDFMx.cnf
055e06548bac99958d8ab2dd1248f2b4  /etc/texmf/texmf.d/80tex4ht.cnf
37329819f1109e8a457e64b8b58fecdb  /etc/texmf/texmf.d/85Misc.cnf
a8952d594677235951d447665ec46e9c  /etc/texmf/texmf.d/90TeXDoc.cnf
402d5adb3864c09ed3cd80c0f2131361  /etc/texmf/texmf.d/95NonPath.cnf

-- System Information:
Debian Release: 6.0.2
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'oldstable'), (500, 'stable'), (400, 'testing'), (300, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/2 CPU cores)
Locale: LANG=fr_LU.UTF-8, LC_CTYPE=fr_LU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages texlive-latex-extra depends on:
ii  dpkg                          1.15.8.11  Debian package management system
ii  preview-latex-style           11.85-1    extraction of elements from LaTeX 
ii  tex-common                    2.08.1     common infrastructure for building
ii  texlive-binaries              2009-8     Binaries for TeX Live
ii  texlive-common                2009-11    TeX Live: Base component
ii  texlive-latex-base            2009-11    TeX Live: Basic LaTeX packages
ii  texlive-pictures              2009-11    TeX Live: Graphics packages and pr

Versions of packages texlive-latex-extra recommends:
ii  texlive-latex-extra-doc       2009-10    TeX Live: Documentation files for 
ii  texlive-latex-recommended     2009-11    TeX Live: LaTeX recommended packag
ii  texpower                      0.2-7      Macros for creating professional p

texlive-latex-extra suggests no packages.

Versions of packages tex-common depends on:
ii  debconf [debconf-2.0]        1.5.36.1    Debian configuration management sy
ii  dpkg                         1.15.8.11   Debian package management system
ii  ucf                          3.0025+nmu1 Update Configuration File: preserv

Versions of packages texlive-latex-extra is related to:
ii  tex-common                    2.08.1     common infrastructure for building
ii  texlive-binaries              2009-8     Binaries for TeX Live

-- debconf information:
  tex-common/check_texmf_wrong:
  tex-common/check_texmf_missing:



Reply to: