No puedo determinar el error entre hyperref e hypdvips

No puedo determinar el error entre hyperref e hypdvips

Mire el siguiente ejemplo mínimo que no funciona. No es correcto, porque se creará el pdf de salida. Sin embargo, el archivo de registro produce un error. Me llevó mucho tiempo y todavía no estoy seguro de si es culpa mía o no.

Descargué una nueva versión portátil de distribución MiKTeX 2.9.5105 y actualicé el paquete. Compilo con un archivo por lotes dvi-ps-pdf

Aquí está el MWE

\documentclass{scrreprt}
\usepackage[utf8]{inputenc} % Uses the utf8 input encoding
\usepackage{hyperref}
\usepackage{hypdvips}

\begin{document}
\chapter*{Impressum}
\chapter{Zu diesem Dokument}
Dieses Installationsanleitung erläutert alle Themen um den -Client installieren zu     können und ist als Leitfaden mit Zusatzinformationen aufgebaut. Bestimmte abgebildete windowsspezifische Programmelemente können in den Windowsversionen abweichen, gelten aber sinngemäß. 
\section{Symbole und Auszeichnungen}

\section{Want to use command from package hypdvips}
\attachfile[description={MNWEB.log},flags=0000000001, mimetype=application/txt]{MNWEB.log}
\end{document}  

El archivo de errores muestra el siguiente error.

LaTeX Info: Redefining \ref on input line 25.
LaTeX Info: Redefining \pageref on input line 25.
LaTeX Info: Redefining \nameref on input line 25.
 [2


]
Chapter 1.
! Missing \endcsname inserted.
<to be read again> 
               \@ne 
l.29  \section
          {Symbole und Auszeichnungen}
The control sequence marked <to be read again> should
not appear between \csname and \endcsname.

! Missing \endcsname inserted.
<to be read again> 
               \@ne 
l.29  \section
          {Symbole und Auszeichnungen}
The control sequence marked <to be read again> should
not appear between \csname and \endcsname.

! Missing \endcsname inserted.
<to be read again> 
               \BKM@style@\@ne  
l.29  \section
              {Symbole und Auszeichnungen}
The control sequence marked <to be read again> should
not appear between \csname and \endcsname.

! Extra \endcsname.
\KVS@ProcessorDefault ...sname KV@#1@#2\endcsname 
                                              \unless \ifcsname KVS@#1@h...
l.29  \section
              {Symbole und Auszeichnungen}
I'm ignoring this, since I wasn't doing a \csname.


! Package kvsetkeys Error: Undefined key `\BKM@style@\@ne  '.

See the kvsetkeys package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.29  \section
          {Symbole und Auszeichnungen}
The keyval family of the key `\BKM@style@\@ne  ' is `BKM'.
The setting of the key is ignored because of the error.

Try typing  <return>  to proceed.
If that doesn't work, type  X <return>  to quit.

Package atveryend Info: Executing hook `BeforeClearDocument' on input line 30.
[3

Si nadie ve mi error, entonces podría ser un error, lo informaré después de unos días de visualización.

Mejores deseos

EDITAR2:

Compile con estos comandos.

set B=C:\tex\miktex\bin\
set gs_path=d:\peter\Programme\gs\gs9.10\bin\
%B%latex --enable-write18 --src -interaction=nonstopmode --save-size=80000 MWE.tex
%B%dvips -P pdf -D1200 MWE.dvi"
%gs_path%gswin32c.exe -sPAPERSIZE=a4 -dNOSAFER -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFileMWE.pdf -c save pop -f MWE.ps

Pedro

Respuesta1

El error aparece al usar scrreprt, porque define

% scrreprt.cls, line 2874:
\newcommand\section{%
  \@startsection{section}{\sectionnumdepth}{\z@}%
  {-3.5ex \@plus -1ex \@minus -.2ex}%
  {2.3ex \@plus.2ex}%
  {\ifnum \scr@compatibility>\@nameuse{scr@[email protected]}\relax
    \setlength{\parfillskip}{\z@ plus 1fil}\fi
    \raggedsection\normalfont\sectfont\nobreak\size@section}%
}

y también

% scrreprt.cls, line 2397:
\newcommand*{\sectionnumdepth}{\@ne}

Cuando se construye el marcador para la sección, \BKM@currentlevelse define mediante

\xdef\BKM@currentlevel{<second argument to \startsection>}

que en este caso da lo mismo que

\gdef\BKM@currentlevel{\@ne}

porque \@nees inexpandible. Pero luego \BKM@currentlevelse usa en interiores \csname...\endcsname, donde \@nees ilegal.

Aquí hay una solución (propuesta por Heiko Oberdiek): después de cargar, hypdvipscambie la forma en que \@startsectionse redefine con

\makeatletter
\def\@startsection#1#2#3#4#5#6{%
  \bookmarksetup{style=pp@bmstyle@empty}%
  \ifx\@M#2%
    \xdef\BKM@currentlevel{1}%
  \else
    \xdef\BKM@currentlevel{\number#2}%
  \fi
  \@ifundefined{BKM@style@\BKM@currentlevel}{}{\bookmarksetup{style=\BKM@currentlevel}}%
  \pp@backup@@startsection{#1}{#2}{#3}{#4}{#5}{#6}%
}
\makeatother

Una solución quizás más sencilla es parchear \sectionpara tener \number\sectionnumdepth:

\documentclass{scrreprt}
\usepackage[utf8]{inputenc} % Uses the utf8 input encoding
\usepackage{etoolbox}
\usepackage[pdfencoding=auto]{hyperref} % don't forget the option
\usepackage{hypdvips}

\patchcmd{\section}{\sectionnumdepth}{\number\sectionnumdepth}{}{}

\begin{document}

\chapter*{Impressum}

\chapter{Zu diesem Dokument} 

Dieses Installationsanleitung erläutert alle Themen um den -Client installieren 
zu können und ist als Leitfaden mit Zusatzinformationen aufgebaut. Bestimmte 
abgebildete windowsspezifische Programmelemente können in den Windowsversionen 
abweichen, gelten aber sinngemäß.

\section{Symbole und Auszeichnungen}

\section{Want to use command from package hypdvips}
\attachfile[description={MNWEB.log},flags=0000000001, mimetype=application/txt]{MNWEB.log}
\end{document}  

información relacionada