Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
LaTeX: to make the navigation symbols (and \framezoom) work with dvipdfmx
% bxdpx-beamer.sty
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{bxdpx-beamer}[2013/02/27 v0.2]
\def\bxqbd@pkgname{bxdpx-beamer}
% environment check
\@ifclassloaded{beamer}{}{%else
\PackageError\bxqbd@pkgname{Beamer is not in use}%
{Package loading is aborted.}%
\endinput}
% if not in presentation mode, then abort silently
\mode<presentation>{\let\bxqbd@tempa=t }
\ifx t\bxqbd@tempa\else
\expandafter\endinput\fi\relax
% if PGF driver is not dvipdfmx/xetex, then abort silently
\let\bxqbd@tempa=f
\def\bxqbd@tempb{pgfsys-dvipdfmx.def}
\ifx\pgfsysdriver\bxqbd@tempb \let\bxqbd@tempa=t \fi
\def\bxqbd@tempb{pgfsys-xetex.def}
\ifx\pgfsysdriver\bxqbd@tempb \let\bxqbd@tempa=t \fi
\ifx t\bxqbd@tempa\else
\expandafter\endinput\fi\relax
% if ec-lmr10 is not available, then abort with warning
\IfFileExists{t1lmr.fd}{}{%else
\PackageWarning\bxqbd@pkgname
{Some links are still out of order, since the\MessageBreak
hackery cannot be applied in absence of the \MessageBreak
LM Roman font}%
\endinput}
%---------------------------------------
% \bxqbd@enghost
\newbox\bxqbd@ghost
\font\bxqbd@font=ec-lmr10 at 1.1613pt % 10*0.5/4.3055
\setbox\bxqbd@ghost\hbox{\bxqbd@font\char23}
\def\bxqbd@enghost#1{%
\begingroup
\setbox\@tempboxa\hbox{#1}%
\lower\dp\@tempboxa\copy\bxqbd@ghost
\copy\@tempboxa
\@tempdima\ht\@tempboxa \advance\@tempdima\ht\bxqbd@ghost
\raise\@tempdima\copy\bxqbd@ghost
\endgroup}
% patch to \beamer@linkspace
\let\bxqbd@linkspace\beamer@linkspace
\def\beamer@linkspace#1{%
\bxqbd@enghost{\bxqbd@linkspace{#1}}}
% patch to \hyperlink
\let\bxqbd@hyperlink\hyperlink
\def\bxqbd@labelzoomed{\beamer@labelzoomed}
\def\hyperlink#1#2{%
\def\bxqbd@tempa{#1}%
\ifx\bxqbd@tempa\bxqbd@labelzoomed \expandafter\@firstoftwo
\else \expandafter\@secondoftwo \fi
{\bxqbd@hyperlink{#1}{\bxqbd@enghost{#2}}}%
{\bxqbd@hyperlink{#1}{#2}}}
%--------------------------------------- all done
\endinput
%% EOF
\documentclass[17pt,dvipdfmx]{beamer}
\usepackage{type1cm}
\usetheme{Warsaw}
\usepackage{bxdpx-beamer}
\begin{document}
\begin{frame}{Zoooooooom!}
\hypersetup{linkbordercolor={0 0.5 0.1}}
\framezoom<1><2>[border=2](0pt,20pt)(32pt,24pt)%
\framezoom<1><3>[border=2](50pt,28pt)(40pt,30pt)%
\framezoom<1><4>[border=2](100pt,22pt)(18pt,18pt)%
\strut\par
Blah blah blah!!?
\end{frame}
\end{document}
\documentclass[17pt,dvipdfmx]{beamer} % dvipdfmx needed
\usetheme{Warsaw}
\usepackage{bxdpx-beamer}
% These settings make navigation symbols rendered in black.
%\setbeamercolor{navigation symbols dimmed}{fg=black}
%\setbeamercolor{navigation symbols}{fg=black}
% This makes all links have a border.
%\hypersetup{pdfborder={0 0 1},allbordercolors={0 0.5 0}}
\begin{document}
\section{Important but Meaningless}
\begin{frame}{First}
This slide \pause is \alert{meaningless}.
\end{frame}
\begin{frame}{Second}
This slide \pause is also \alert{meaningless}.
\end{frame}
\section{Meaningless but Important}
\begin{frame}{Third}
This is yet another \alert{meaningless} slide.
\end{frame}
\end{document}

Ubuntu 12.10
Adobe Reader 8.17
When I click on the navigation bar, a black box appears.
http://img.nanpuyue.com/upload/2013/03/17/20130317141034-a7941c04.png

Owner

zr-tex8r commented Apr 27, 2013

nanpuyue (Sorry for late reply.)
This seems to be normal behavior: i.e. every link in PDF files generated by dvipdfmx gets color-inversed when active.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment