为什么 fancytooltips 会出现错误?-- 弹出多余的浮动文本和 JavaScript 调试器

为什么 fancytooltips 会出现错误?-- 弹出多余的浮动文本和 JavaScript 调试器

描述:

为什么 fancytooltips 会出现错误?——弹出多余的浮动文本和 JavaScript 调试器。


详细说明:

我想在鼠标悬停在文本上时添加新的工具提示。因此,我使用了 fancytooltips 包

并执行“详细步骤”部分中的以下步骤。

但是,它并没有像预期的那样工作。.pdf 中出现了多余的浮动文本,并且弹出一个标题为“JavaScript 调试器”的窗口,上面写着“SyntaxError: 语法错误 1:Field:Mouse Enter SyntaxError: 语法错误 1:Field:Mouse Enter”。

(有关更多详细信息,请参见“详细步骤”部分底部的图表。

我不知道为什么

详细步骤:

步骤1:

已下载该包。

我从其官方网站下载了 fancytooltip.zip 包到目录“Downloads”。

然后我使用 7-zip 将其解压缩到目录“下载”。

第2步:

阅读文档然后按照说明进行操作。

我读过文档,然后按照说明操作。为了按照说明操作,我下载了“Adobe Acrobat”。

步骤3:

测试。

我已经通过以下方式分别对一组文件“tooltipy”“fancytooltips-example”验证了 fancytooltip 的行为和示例是否按预期工作

首先检查 fancytooltips 提供的代码的原始行为是否按预期工作。

open <filename>.pdf with "Adobe Acrobat"

清除缓冲区,以便在使用 pdfLaTex 模式编译 .tex 时不会出错。

close <filename>.pdf

open <filename>.tex with TeXworks

根据 fancytooltips 文档第 2 章第 1 节,.tex 文件必须使用 pdfLaTex 进行编译。否则,编译器会报错,或者生成的 .pdf 格式不正确。

change compiler mode to pdfLaTex

compile it (NOTE that at compile time with pdfLaTex mode, one has to click enter at the bottom of console until either there are errors or pdf displays.)

查看结果。

open <filename>.pdf with "Adobe Acrobat"

close <filename>.pdf

在更改.tex 文件中的代码之前,我分别对文件“tooltipy”、“fancytooltips-example”进行了更改,它可以按预期工作。

对于 tooltipy,

我在 tooltipy.tex 中添加以下语句(当然,保存它),使用 pdfLaTex 模式进行编译。

\strankaB{reference}{At}

然后使用“Adobe Acrobat”打开 tooltipy.pdf,我发现其中有一个带有文本 At 的工具提示,其工作方式与我预期的一样。

对于 fancytooltips 示例,

我在 fancytooltips-example.tex 中添加以下语句(当然,保存它),并使用 pdfLaTex 模式进行编译。

\begin{definition}
This is Reference of  \tooltip{reference}{3}. 
\end{definition}

并更改以下语句:

\usepackage[filename=tooltipy,movetips,mouseover]{fancytooltips}

\usepackage[filename=pics/tooltipy,movetips,mouseover]{fancytooltips}

我这样做的原因是,在更改语句之前,编译器会引发错误,表明未找到 tooptipy.pdf,并出现以下错误。

!pdfTeX error: miktex-pdftex.exe (file tooltipy.pdf): cannot find image file to oltipy.pdf

但是,我用“Adobe Acrobat”打开 fancytooltips-example.pdf 时,弹出一个标题为“JavaScript Debugger”的窗口,并且 fancytooltips-example.pdf 中有多余的浮动文本。(如图 2 所示)

(原始结果见图1)

(修改代码后效果见图2)

图。1:

tooltipy.pdf 的原始内容

图2:

更改代码后 fancytooltips-example.pdf 的内容


欣赏:

如有任何回复,我们将不胜感激。


代码:

对于 optipy.tex,

\documentclass{article}
% \usepackage[czech]{babel}
% \usepackage[IL2]{fontenc}

\pagestyle{empty}
\usepackage[createtips]{fancytooltips}

\usepackage{fancybox}
\parindent 0 pt

\usepackage{color}
\definecolor{gray}{rgb}{0.8, 0.8, 0.8}
\definecolor{lightblue}{rgb}{0.7, 0.7, 1}
\definecolor{lightgreen}{rgb}{0.7, 1, 0.7}

\usepackage{multido,graphicx}
\usepackage[papersize={5in,5in},margin=1pt]{geometry}
\long\def\stranka#1#2{
\setbox0=\hbox{\begin{minipage}{2in}
\fboxsep 0 pt
\color{red}
\shadowbox{{\fboxsep 4pt\colorbox{yellow}
    {\begin{minipage}{\linewidth}
      \color{black}#2
    \end{minipage}}}}
\end{minipage}\ \ \ \ }
\pdfpagewidth=\wd0
\pdfpageheight=\ht0
\advance \pdfpageheight by \dp0
\copy0
\keytip{#1}
  \newpage
}

\long\def\strankaB#1#2{
\setbox0=\hbox{\fboxsep 0 pt
\color{red}
\shadowbox{{\fboxsep 4pt\colorbox{yellow}
    {\color{black}#2
    }}}}
\pdfpagewidth=\wd0
\pdfpageheight=\ht0
\advance \pdfpageheight by \dp0
\copy0
\keytip{#1}
  \newpage
}


\def\definice#1{
  \begin{center}
    \colorbox{gray}{\begin{minipage}{0.9\linewidth} #1
      \end{minipage}}
  \end{center}
}
\def\vyuziti#1{
  \begin{center}
    \colorbox{lightblue}{\begin{minipage}{0.9\linewidth} #1
      \end{minipage}}
  \end{center}
}
\def\vypocet#1{
  \begin{center}
    \colorbox{lightgreen}{\begin{minipage}{0.9\linewidth} #1
      \end{minipage}}
  \end{center}
}


\begin{document}

\stranka{derivace}{ \definice{The \textbf{derivative} is the limit
    $$\lim_{h\to0}\frac{f(x+h)-f(x)}h,$$ if this limit exists as a finite number.} \vyuziti{ The derivative
    has important applications in physics as a rate of change and as a
    linear approximation.}  \vypocet{The derivative can be evaluated
    using appropriate formulas}}

\stranka{hodnost}{ \definice{\textbf{Rank} is a maximal number of
    linearly independent rows in a matrix.}  \vyuziti{Rank can be used
    to prove or disprove linear independence of vectors and it also
    appears in the Frobenius Theorem.}  \vypocet{To find the rank of a
    matrix, you have to convert this matrix into row echelon form.}}

\strankaB{definition}{???}


\pdfpageheight=0pt

\pdfpagewidth=0pt

\def\obrazek#1{%
\setbox0=\hbox{\color{red}%
    \fboxsep 0 pt{\shadowbox{{\color{black}\includegraphics[width=3.5in, 
        page=#1,viewport= 0 57 350 230,clip]{tecna2.pdf}}}}}
\pdfpagewidth=\wd0
\pdfpageheight=\ht0
\advance \pdfpageheight by \dp0
\copy0
\newpage}


\multido{\i=1+1}{25}{\obrazek{\i}}

\end{document}

对于 fancytooltips-example.tex,

\documentclass{article}

\usepackage[pdftex,designiii]{web}

\usepackage[filename=tooltipy,movetips,mouseover]{fancytooltips}

\let\rmdefault\sfdefault

\usepackage[shadein]{shadethm}

\newshadetheorem{definition}{Definition}

\usepackage{graphicx}

\definecolor{bkg}{rgb}{1,0.9,0.9}
\def\Message#1{\colorbox{bkg}{
      \begin{minipage}{1\linewidth}
        \smallskip
      #1
        \smallskip
      \end{minipage}
 }}
\begin{document}


\parindent 0 pt

\Message{
\begin{itemize}
\item Use Acrobat Reader or Adobe Acrobat to view this file, please.
\item The blue texts are covered by an active button. If you \textbf{move mouse over} one of
  these buttons, tooltip appears. If you move your mouse out or if you
  close the page, the tooltip disappears.
\item The first links are tooltips, the fifth one is animated tooltip.
\item The tooltips appears with the left down corner at the mouse
  cursor, or at least as close as possible. 
\end{itemize}
}

\begin{definition}
  This is definition of  \tooltip{rank}{2}. 
\end{definition}


\begin{definition}
  This is \tooltip{definition}3 of \tooltip{derivative}{1}. Filler
  text. Filler text. Filler text. Filler text. Filler text. Filler text. Filler text. Filler text. Filler text. Filler text.
  \tooltip{derivative}{1}.
\end{definition}


% \begin{definition}
%  This is Reference of  \tooltip{reference}{3}. 
% \end{definition}

This is a geometric \tooltipanim{idea}{4}{28} which is behind the
definition of derivative.

\end{document}

参考:

关于 fancytooltips:

对于 fancytooltips 官方网站,

fancytooltips 官方网站

对于 fancytooltips 官方文档,

fancytooltips 文档


集成开发环境(IDE):

TeXworks
MikTex Console.

编译模式:

pdfLaTex

查看方式:

我使用以下方式查看 .pdf

Adobe Acrobat

相关内容