lwarp 和 movie9 包

lwarp 和 movie9 包

tutorial.tex' file (shown in the我测试了lwarp movie9` 包的转换documentation) adding an embedded video with the

\documentclass{article}

\usepackage{iftex}
\ifPDFTeX
\usepackage{lmodern} % pdflatex or dvi latex
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\else
\usepackage{fontspec} % XeLaTeX or LuaLaTeX
\fi
% --- LWARP IS LOADED NEXT ---
\usepackage[
% HomeHTMLFilename=index, % Filename of the homepage.
% HTMLFilename={node-}, % Filename prefix of other pages.
% IndexLanguage=english, % Language for xindy index, glossary.
% latexmk, % Use latexmk to compile.
% OSWindows, % Force Windows. (Usually automatic.)
% mathjax, % Use MathJax to display math.
]{lwarp}
% \boolfalse{FileSectionNames} % If false, numbers the files.

% --- OTHER PACKAGES ARE LOADED AFTER LWARP ---
\usepackage{makeidx} \makeindex
\usepackage{xcolor}             % (Demonstration purposes only.)
\usepackage{hyperref,cleveref}  % LOAD THESE LAST!

\usepackage{media9}             %pdflatex, latex+dvips+ps2pdf, xelatex
%\usepackage[dvipdfmx]{media9}  %latex+dvipdfmx
% --- LATEX AND HTML CUSTOMIZATION ---
\title{The Lwarp Tutorial}
\author{Some Author}
\setcounter{tocdepth}{2}        % Include subsections in the \TOC.
\setcounter{secnumdepth}{2}     % Number down to subsections.
\setcounter{FileDepth}{1}       % Split \HTML\ files at sections
\booltrue{CombineHigherDepths}  % Combine parts/chapters/sections
\setcounter{SideTOCDepth}{1}    % Include subsections in the side\TOC
\HTMLTitle{Webpage Title}       % Overrides \title for the web page.
\HTMLAuthor{Some Author}        % Sets the HTML meta author tag.
\HTMLLanguage{en-US}            % Sets the HTML meta language.
\HTMLDescription{A description.}% Sets the HTML meta description.
\HTMLFirstPageTop{Name and \fbox{HOMEPAGE LOGO}}
\HTMLPageTop{\fbox{LOGO}}
\HTMLPageBottom{Contact Information and Copyright}
\CSSFilename{lwarp_sagebrush.css}

\begin{document}
\includemedia[
  width=0.6\linewidth,height=0.45\linewidth,
  activate=pageopen,
  flashvars={
    modestbranding=1 % no YT logo in control bar
   &autohide=1       % controlbar autohide
   &showinfo=0       % no title and other info before start
  }
]{}{http://www.youtube.com/v/<video id>?rel=0}   % Flash file

\begin{warpprint}   % For print output ...
\cleardoublepage    % ... a common method to place index entry into TOC.
\phantomsection
\addcontentsline{toc}{chapter}{\indexname}
\end{warpprint}
\ForceHTMLPage      % HTML index will be on its own page.
\ForceHTMLTOC       % HTML index will have its own toc entry.

\end{document}

打印版本看起来不错,但当我切换到html

$lwarp html

我收到以下错误:

LaTeX Warning: Reference `LWRlateximage-movie2-1' on page 1 undefined on input 
line 55.

! Improper \prevdepth.
\LWR@orignewpage ... {}\fi \par \ifdim \prevdepth 
                                                  >\z@ \vskip -\ifdim \prevd...
l.55 ...http://www.youtube.com/v/<video id>?rel=0}
                                                     % Flash file
? 

知道如何修复这个问题吗?

答案1

一个简单的解决方案就是为打印和 HTML 编写单独的版本:

\begin{warpprint}
\includemedia[
  width=0.6\linewidth,height=0.45\linewidth,
  activate=pageopen,
  flashvars={
    modestbranding=1 % no YT logo in control bar
   &autohide=1       % controlbar autohide
   &showinfo=0       % no title and other info before start
  }
]{}{http://www.youtube.com/v/<video id>?rel=0}   % Flash file
\end{warpprint}
\begin{warpHTML}
<iframe width="560" height="315" src="https://www.youtube.com/embed/<video id>" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
\end{warpHTML}

我从 youtube“嵌入”链接复制了 HTML 片段。

相关内容