From 06c0341705c5f65c5c68b4b64cfc6b3476aad8eb Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 18 Sep 2021 20:21:24 +0000 Subject: pdfextra (18sep21) git-svn-id: svn://tug.org/texlive/trunk@60542 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/optex/pdfextra/README.md | 12 +- .../pdfextra/examples/pdfextra-example-latex.tex | 223 +++++++++++++ .../optex/pdfextra/examples/pdfextra-example.pdf | Bin 385845 -> 385350 bytes .../optex/pdfextra/examples/pdfextra-example.tex | 76 +++-- .../texmf-dist/doc/optex/pdfextra/pdfextra-doc.pdf | Bin 230095 -> 245952 bytes .../texmf-dist/doc/optex/pdfextra/pdfextra-doc.tex | 122 ++++++- Master/texmf-dist/doc/optex/pdfextra/pdfextra.tex | 364 +++++++++++++++++++++ Master/texmf-dist/tex/optex/pdfextra/pdfextra.opm | 144 ++++---- Master/texmf-dist/tex/optex/pdfextra/pdfextra.sty | 4 + Master/tlpkg/libexec/ctan2tds | 1 + 10 files changed, 831 insertions(+), 115 deletions(-) create mode 100644 Master/texmf-dist/doc/optex/pdfextra/examples/pdfextra-example-latex.tex create mode 100644 Master/texmf-dist/doc/optex/pdfextra/pdfextra.tex create mode 100644 Master/texmf-dist/tex/optex/pdfextra/pdfextra.sty diff --git a/Master/texmf-dist/doc/optex/pdfextra/README.md b/Master/texmf-dist/doc/optex/pdfextra/README.md index c47262b1f58..70ef8febf7e 100644 --- a/Master/texmf-dist/doc/optex/pdfextra/README.md +++ b/Master/texmf-dist/doc/optex/pdfextra/README.md @@ -1,6 +1,7 @@ # PDF Extra -PDF Extra provides extra PDF features for OpTeX. +PDF Extra provides extra PDF features for OpTeX (or in limited form for plain +LuaTeX and LuaLaTeX). As a minimalistic package OpTeX doesn't support "advanced" features of PDF file format in the base. This third party package aims to provide them. Summary of @@ -21,13 +22,18 @@ well as technical documentation interleaved with source code. # Installation instructions -Put `pdfextra.opm` where `optex` can find it. +Put `pdfextra.opm` where your TeX can find it. Additionaly, for plain/LaTeX you +need `pdfextra.tex`, and on top of that `pdfextra.sty` for LaTeX. Or just copy paste anything you want. # Usage -In OpTex do: `\load [pdfextra]`. +In OpTeX do: `\load [pdfextra]`. + +In plain LuaTeX do: `\input pdfextra`. + +In LuaLaTeX do: `\usepackage{pdfextra}`. # License diff --git a/Master/texmf-dist/doc/optex/pdfextra/examples/pdfextra-example-latex.tex b/Master/texmf-dist/doc/optex/pdfextra/examples/pdfextra-example-latex.tex new file mode 100644 index 00000000000..dc5a31f9f18 --- /dev/null +++ b/Master/texmf-dist/doc/optex/pdfextra/examples/pdfextra-example-latex.tex @@ -0,0 +1,223 @@ +% Compiled with: +% env TEXMFDOTDIR='..//:~/src/texlive/texmf-dist/source/latex/media9/files/' lualatex pdfextra-example-latex.tex +\documentclass{article} + +\usepackage{hyperref} +\usepackage{xcolor} +\usepackage{graphicx} +\usepackage{pdfextra} +\sdef{_linkcolor}{\color{blue}} + +\begin{document} + +% Using document level JavaScript we can run initialization code right at the +% start (this is more flexible than \openaction). +\dljavascript[random]{ + function getRandomNumber() { + return 4; % chosen by fair dice roll, ![https://xkcd.com/221/] + } + console.println("initialized with seed " + getRandomNumber()); +} + + + +% For external references we need to `\filedef` "external" and "url" files +% beforehand: +\filedef/u[doc-internet]{http://petr.olsak.net/ftp/olsak/optex/optex-doc.pdf} +\filedef/x[doc-local]{optex-doc.pdf} + +% We then try to reference them using external references: +\hlink[extref:doc-internet:ref:langphrases]{OpTeX documentation, section ``Multilingual phrases and quotation marks''.} +\hlink[extpgref:doc-internet:12]{OpTeX documentation, page 12.} + + + +% Insert a video twice with different settings: +\filedef/e[video]{example-movie.mp4} +% Insert video into page using Renditions mechanism with controls and autoplay. +\render[video][ + controls=true, + aactions=\renditionautoplay, +]{\includegraphics[width=\textwidth]{example-image.pdf}} + +% We set red text color, blue border (RGB triplet) for "rendition" links. +\sdef{_renditionlinkcolor}{\color{red}} +\sdef{_renditionborder}{0 1 0} +% Then we add some buttons. +\hlink[rendition::play]{play} \hlink[rendition::pause]{pause} +\hlink[rendition::stop]{stop} \hlink[rendition::resume]{resume} + +% Render the same file again, but with different dimensions, no controls +% and explicit activation. +\render[video]{\includegraphics{example-image.pdf}} +% This one can't have buttons, because it doesn't have its own name -- "video" +% is used by the previous one. + + + +% Add already embedded video to the list of attachments shown in user +% interface. +\attach[video] + + +% We are done for this page, who not go to the next one? +% +% \hlink typesets in group, so we locally disable lining links (our button is +% bigger than normal line) +\hlink[named:NextPage]{\nolininglinks\scalebox{2}[2]{NEXT PAGE}} + + + +\clearpage + + + +% Deliver fresh random number to everyone who sees this page using "page open" +% ("O") trigger event of page's actions. +\pageactions[ + {O} {js:{app.alert("Random number for you is " + getRandomNumber());}} +] + + +% Link to previous page (predefined PDF action) with "Split" transition: +\hlink[named:PrevPage, transition:Split]{Go to previous page (with transition).} + + + +\clearpage + +% A 3D Rich Media annotation with a custom view and script follows: + +% First we define the 3D file, so we can use same name for the view and have it +% auto included. +\filedef/e[example]{pdfextra-example-part.prc} + +% Then a simplistic "front" view. +\DDDview[example][ + projection=ortho, + roo=400, +] + +% A 3D JavaScript script that will define function to use with action button. +% (we write the script only now, so we don't have to carry around an extra file +% in the package, you would normally have the contents in the file -- "turn.js" +% in this case). +\newwrite\js +\immediate\openout\js=turn.js +% rotate every node by angle degrees along $x$ axis +\immediate\write\js{\detokenize{ +function turn(angle) { + angle = angle * Math.PI / 180; + for (var i = 0; i < scene.nodes.count; i++) { + var node = scene.nodes.getByIndex(i); + node.transform.rotateAboutXInPlace(angle); + } +} +}} +\closeout\js + +% The annotation itself, with our script above. +\RM[example][ + activation=auto, + scripts=turn.js, +]{\textcolor{white}{\vrule width\textwidth height\textwidth}} + +\hlink[js:\DDDcontext{example}.turn(10);]{Turn by 10 degrees along $x$ axis.}\par +\hlink[js:\DDDcontext{example}.turn(30);]{Turn by 30 degrees along $x$ axis.}\par +\hlink[js:\DDDcontext{example}.turn(90);]{Turn by 90 degrees along $x$ axis.} + + + +\clearpage + + +% Here is the "epix" 3D model example from media9 documentation ported to +% pdfextra. +% +% First we define a view with the same name as the future Rich Media +% annotation. This view will then automatically be used if no `views` key is +% specified. No need to be excessive with decimal numbers. +\DDDview[epix][ + FOV=30, + c2c=4 2 3, + coo=4.41 2.19 0, + roo=430, +] + +% 3Dmenu is used often, lets use shortcut instead. +\filedef/e[3dmenu]{3Dmenu.js} +% We want to use the nice "epix" name for the view and annotation. +\filedef/e[epix]{epix.prc} + +% Just to spice things up, we diverge a bit from media9 and define custom +% background color. We can't use LaTeX's colors, so we use RGB triplet. +\newcommand{\GreyBG}{0.9 0.9 0.9} + +% Define the 3D Rich Media annotation. One view is automatically detected from +% name ("epix"). Scripts will run in specified order at initialization time +% (when the annotation is activated). +\RM[epix][ + scripts={ + asylabels.js, + 3Dspintool.js, + 3dmenu, + }, + background=\GreyBG, +]{\includegraphics[width=0.8\textwidth, height=0.8\textwidth]{epixposter.pdf}} + + + +\clearpage + + + +% Second media9 example is "dice" it has a lot of views, but they are simple. +% This time we can't use the view name deduction from `\RM` name -- there is +% more than one view. +\DDDview[Front][roo=27] +\DDDview[Back][roo=27, c2c=0 1 0] +\DDDview[Left][roo=27, c2c=-1 0 0] +\DDDview[Right][roo=27, c2c=1 0 0] +\DDDview[Top][roo=27, c2c=0 0 1] +\DDDview[Bottom][roo=27, c2c=0 0 -1] +\DDDview[Fish Eye at Centre][fov=120] + +% We want to use all the defined views, as well as autoactivate the annotation. +% This means that the preview mostly sets dimensions, because it will not be +% shown much. (Only in viewers that don't support 3D Rich Media -- that is, all +% except Acrobat). +\RM[dice.u3d][ + views={Front, Back, Left, Right, Top, Bottom, Fish Eye at Centre}, + activation=auto, + scripts=3dmenu, +]{\textcolor{red}{\vrule height.5\textwidth width.5\textwidth}} + +% A few buttons for switching views. +\hlink[goto3dview::/N]{\frame{Next view}} +\hlink[goto3dview::(Back)]{\frame{View ``Back''}} +\hlink[goto3dview::5]{\frame{6th view in the list}} + +\clearpage + + +% Last media9 example ported. It has its own JavaScript file for animation, +% which can be customized at runtime using JavaScript actions that access 3D +% context of the annotation. +\filedef/e[malte]{malte.u3d} +\DDDview[malte][c2c=1 1 1, roo=0.25] +\RM[malte][ + activation=auto, + scripts={3dmenu, malte.js}, +]{\textcolor{blue}{\vrule height 0.5\textwidth width 0.5\textwidth}} + +% Normal JavaScript actions, but we access functions defined globaly in the 3D +% JavaScript context of "malte" Rich Media annotation. +\hlink[js:\DDDcontext{malte}.cntrClockWise();] {\includegraphics[height=1.44em]{boutona.pdf}} +\hlink[js:\DDDcontext{malte}.pause();] {\includegraphics[height=1.44em]{boutonb.pdf}} +\hlink[js:\DDDcontext{malte}.clockWise();] {\includegraphics[height=1.44em]{boutonc.pdf}} +\hlink[js:\DDDcontext{malte}.scaleSpeed(1/1.1);]{\includegraphics[height=1.44em]{boutond.pdf}} +\hlink[js:\DDDcontext{malte}.origSpeed();] {\includegraphics[height=1.44em]{boutone.pdf}} +\hlink[js:\DDDcontext{malte}.scaleSpeed(1.1);] {\includegraphics[height=1.44em]{boutonf.pdf}} + + +\end{document} diff --git a/Master/texmf-dist/doc/optex/pdfextra/examples/pdfextra-example.pdf b/Master/texmf-dist/doc/optex/pdfextra/examples/pdfextra-example.pdf index abb2e9c4c5a..24ca714a755 100644 Binary files a/Master/texmf-dist/doc/optex/pdfextra/examples/pdfextra-example.pdf and b/Master/texmf-dist/doc/optex/pdfextra/examples/pdfextra-example.pdf differ diff --git a/Master/texmf-dist/doc/optex/pdfextra/examples/pdfextra-example.tex b/Master/texmf-dist/doc/optex/pdfextra/examples/pdfextra-example.tex index 6093bf7def5..6704ac4b982 100644 --- a/Master/texmf-dist/doc/optex/pdfextra/examples/pdfextra-example.tex +++ b/Master/texmf-dist/doc/optex/pdfextra/examples/pdfextra-example.tex @@ -7,17 +7,14 @@ % env TEXMFDOTDIR=.:~/src/texlive/texmf-dist/source/latex/media9/files/ optex pdfextra-example.tex % \endtt -% basic \OpTeX/ settings +% Basic \OpTeX/ settings: \enlang\enquotes \fontfam[lm] -%\pdfobjcompresslevel=0 -%\pdfcompresslevel=0 - -% load the package from standard search path +% Load the package from standard search path: \load[pdfextra] -% Before using \hlink we must activate hyperlinks +% Before using \hlink we must activate hyperlinks: \hyperlinks\Blue\Green % Maybe we want to greet the user and jump to page 2 right at the start? @@ -41,7 +38,8 @@ -% For external references we need to `\filedef` "external" and "url" files beforehand: +% For external references we need to `\filedef` "external" and "url" files +% beforehand: \filedef/u[doc-internet]{http://petr.olsak.net/ftp/olsak/optex/optex-doc.pdf} \filedef/x[doc-local]{optex-doc.pdf} @@ -53,20 +51,24 @@ % Insert a video twice with different settings: \filedef/e[video]{example-movie.mp4} -% insert video into page using Renditions mechanism with controls and autoplay +% Insert video into page using Renditions mechanism with controls and autoplay. \render[video][ controls=true, aactions=\renditionautoplay, ]{\picwidth=\hsize \inspic{example-image.pdf}} -% Maybe add action buttons? +% We set red text color, blue border (RGB triplet) for "rendition" links. +\let\_renditionlinkcolor\Red +\def\_renditionborder{0 1 0} +% Then we add some buttons. \hlink[rendition::play]{play} \hlink[rendition::pause]{pause} \hlink[rendition::stop]{stop} \hlink[rendition::resume]{resume} % Render the same file again, but with different dimensions, no controls % and explicit activation. \render[video]{\inspic{example-image.pdf}} -% This one can't have buttons, because it doesn't have its own name ("video") is used by the previous one. +% This one can't have buttons, because it doesn't have its own name -- "video" +% is used by the previous one. @@ -87,13 +89,13 @@ -% deliver fresh random number to everyone who sees this page using "page open" -% trigger event of page's actions +% Deliver fresh random number to everyone who sees this page using "page open" +% ("O") trigger event of page's actions. \pageactions[ {O} {js:{app.alert("Random number for you is " + getRandomNumber());}} ] -% "previous page" link with "Split" transition +% Link to OpTeX's page reference ("pg:1") with "Split" transition: \hlink[pg:1, transition:Split]{Go to previous page (with transition).} @@ -102,7 +104,8 @@ % A 3D Rich Media annotation with a custom view and script follows: -% First we define the 3D file, so we can use same name for the view and have it auto included. +% First we define the 3D file, so we can use same name for the view and have it +% auto included. \filedef/e[example]{pdfextra-example-part.prc} % Then a simplistic "front" view. @@ -112,7 +115,9 @@ ] % A 3D JavaScript script that will define function to use with action button. -% (we write the script only now, so we don't have to carry around an extra file in the package) +% (we write the script only now, so we don't have to carry around an extra file +% in the package, you would normally have the contents in the file -- "turn.js" +% in this case). \newwrite\js \immediate\openout\js=turn.js % rotate every node by angle degrees along $x$ axis @@ -131,7 +136,7 @@ function turn(angle) { \RM[example][ activation=auto, scripts=turn.js, -]{{\White\vrule width\hsize height\hsize}} +]{\White\vrule width\hsize height\hsize} \hlink[js:\DDDcontext{example}.turn(10);]{Turn by 10 degrees along $x$ axis.}\par \hlink[js:\DDDcontext{example}.turn(30);]{Turn by 30 degrees along $x$ axis.}\par @@ -142,10 +147,11 @@ function turn(angle) { \vfil\break -% Here is the "epix" 3D model example from media9 documentation ported to pdfextra +% Here is the "epix" 3D model example from media9 documentation ported to +% pdfextra. % % First we define a view with the same name as the future Rich Media -% annotation. This view will then automatically be used if no `views` is +% annotation. This view will then automatically be used if no `views` key is % specified. No need to be excessive with decimal numbers. \DDDview[epix][ FOV=30, @@ -159,11 +165,13 @@ function turn(angle) { % We want to use the nice "epix" name for the view and annotation. \filedef/e[epix]{epix.prc} -% Just to spice things up, we diverge a bit from media9 and define custom background color. +% Just to spice things up, we diverge a bit from media9 and define custom +% background color. \colordef\GreyBG{0.1\Black} % Define the 3D Rich Media annotation. One view is automatically detected from -% name ("epix"). Scripts will run in turn at initialization time. +% name ("epix"). Scripts will run in specified order at initialization time +% (when the annotation is activated). \RM[epix][ scripts={ asylabels.js, @@ -180,7 +188,8 @@ function turn(angle) { % Second media9 example is "dice" it has a lot of views, but they are simple. -% This time we can't use the deduction with same name. +% This time we can't use the view name deduction from `\RM` name -- there is +% more than one view. \DDDview[Front][roo=27] \DDDview[Back][roo=27, c2c=0 1 0] \DDDview[Left][roo=27, c2c=-1 0 0] @@ -190,38 +199,32 @@ function turn(angle) { \DDDview[Fish Eye at Centre][fov=120] % We want to use all the defined views, as well as autoactivate the annotation. -% This means that the previews mostly sets dimensions, because it will not be -% shown much. (Except in viewers that don't support 3D Rich Media -- all except -% Acrobat). +% This means that the preview mostly sets dimensions, because it will not be +% shown much. (Only in viewers that don't support 3D Rich Media -- that is, all +% except Acrobat). \RM[dice.u3d][ views={Front, Back, Left, Right, Top, Bottom, Fish Eye at Centre}, activation=auto, scripts=3dmenu, -]{{\Red \vrule height.5\hsize width.5\hsize}} +]{\Red \vrule height.5\hsize width.5\hsize} % A few buttons for switching views. \hlink[goto3dview::/N]{\frame{Next view}} \hlink[goto3dview::(Back)]{\frame{View \"Back"}} \hlink[goto3dview::5]{\frame{6th view in the list}} -% And define the action buttons using this new custom action. -\hlink[diceview:/N]{Next view} -\hlink[diceview:(Back)]{View \"Back"} -\hlink[diceview:5]{6th view in the list} - - \vfil\break % Last media9 example ported. It has its own JavaScript file for animation, % which can be customized at runtime using JavaScript actions that access 3D -% conotext. +% context of the annotation. \filedef/e[malte]{malte.u3d} \DDDview[malte][c2c=1 1 1, roo=0.25] \RM[malte][ activation=auto, scripts={3dmenu, malte.js}, -]{{\Blue \vrule height.5\hsize width0.5\hsize}} +]{\Blue \vrule height.5\hsize width0.5\hsize} {\picheight=1.44em % Normal JavaScript actions, but we access functions defined globaly in the 3D @@ -240,7 +243,7 @@ function turn(angle) { % Lastly a showcase of transitions / page durations in \OpTeX/ slideshow. % Because transitions are displayed only in fullscreen mode, we could request -% it by using "\fullscreen". But we have more pages before this, so we didn't. +% it by using `\fullscreen`. But we have more pages before this, so we didn't. % We just turn the rest of the document into slideshow. \slides @@ -253,7 +256,8 @@ function turn(angle) { % "Wipe" and be 1 second long. \transitions[Wipe:1] -% The slides will by default be shown for 3 seconds before advancing to the next one. +% The slides will by default be shown for 3 seconds before advancing to the +% next one. \defaultpageduration[3] % But the first slide has override to only be shown for 1 second. \pageduration[1] @@ -268,7 +272,7 @@ function turn(angle) { % to that page. That means that we probably didn't see the "Wipe:1" animation % of the first slide, because we already were there. However, this second slide % with "Fade" is now shown correctly. (The first one also will, when we go -% back.) +% back to it.) \transition[Fade] \sec First slide diff --git a/Master/texmf-dist/doc/optex/pdfextra/pdfextra-doc.pdf b/Master/texmf-dist/doc/optex/pdfextra/pdfextra-doc.pdf index e5a6b8e30de..9534e46bfac 100644 Binary files a/Master/texmf-dist/doc/optex/pdfextra/pdfextra-doc.pdf and b/Master/texmf-dist/doc/optex/pdfextra/pdfextra-doc.pdf differ diff --git a/Master/texmf-dist/doc/optex/pdfextra/pdfextra-doc.tex b/Master/texmf-dist/doc/optex/pdfextra/pdfextra-doc.tex index 38f6cd97952..292bb34ab23 100644 --- a/Master/texmf-dist/doc/optex/pdfextra/pdfextra-doc.tex +++ b/Master/texmf-dist/doc/optex/pdfextra/pdfextra-doc.tex @@ -2,8 +2,6 @@ \load [doc, pdfextra] \catcode`\.=11 -\hyperlinks\Green\Green - % table notes (http://petr.olsak.net/optex/optex-tricks.html#tnote) \newcount\tnotenum \def\tnotelist{} @@ -14,22 +12,23 @@ \global\tnotenum=0 \gdef\tnotelist{}% } -% use `\hlink` instead of OpTeX `\*link` s -\protected\def\_link[#1]#2#3{\hlink[#1]{#3}} -\protected\def\_ilink[#1]#2{\hlink[#1]{#2}} -\protected\def\_ulink[#1]#2{\hlink[url:#1]{#2}} -\public \link \ilink \ulink ; - \let\_cslinkcolor\Blue % allow hyperlinking of \OpTeX's control sequences (see doc.opm) -\let\_pdfextra_opdocaction\_pdfextra_urlaction -\let\_pdfextra_opdoclinkcolor\Blue +\let\_pdfextra_extdocaction\_pdfextra_urlaction +\let\_extdoclinkcolor\Blue \def\_Xindex#1#2{\sdef{,#1}{}\slet{el:#1}{optexdoclink}} -\def\optexdoclink{\hlink[opdoc:\optexdocurl\#cs:\_tmpa]{\csstring\\\_tmpb}} +\def\optexdoclink{\hlink[extdoc:\optexdocurl\#cs:\_tmpa]{\csstring\\\_tmpb}} \def\optexdocurl{http://petr.olsak.net/ftp/olsak/optex/optex-doc.pdf} \isfile{optex-doc.eref}\iftrue \input{optex-doc.eref}\fi +% allow hyperlinks to TeX's control sequences (TeX in a Nutshell) +\def\Xeref#1{\sdef{,#1}{}\slet{el:#1}{texdoclink}} +\def\texdoclink{\hlink[extdoc:\texdocurl\#cs:\_tmpa]{\csstring\\\_tmpb}} +\def\texdocurl{http://petr.olsak.net/ftp/olsak/optex/tex-nutshell.pdf} +\isfile{tex-nutshell.eref}\iftrue \input{tex-nutshell.eref}\fi + + \insertoutline{PDF extra} \tit PDF extra -- extra PDF features for \OpTeX/ @@ -50,7 +49,8 @@ copying some useful parts of this package into your documents / packages. \OpTeX/ namespacing is used, but it can be easily stripped, if you wish to incorporate these macros into other macro packages. The code currently depends on \LuaTeX/, but mostly uses only pdf\TeX/ primitives and a few simple macros -from \OpTeX/. +from \OpTeX/. Additionally, the package can be used in plain LuaTeX and +LuaLaTeX (in a limited form), see section~\ref[user:plain+latex]. User documentation (`pdfextra-doc.tex`) and technical documentation interleaved with source code (`pdfextra.opm`) are all typeset in this PDF file. Some @@ -367,7 +367,7 @@ macros like `\ref` or `\url` might be beneficial. will be typeset directly and the area it occupies will be clickable. Clicking it executes action defined by . Line breaks inside will be possible, in that case several clickable rectangles will be created, one for each line. -Normally in text you want the ares to be of the same height and depth +Normally in text you want the areas to be of the same height and depth (calculated from `\baselineskip`), to achieve sort of a lining, uniform effect. If you want to define big clickable buttons, you may need to turn off the lining effect using \^`\nolininglinks`. It respects groups, but a counterpart @@ -482,7 +482,7 @@ must be unique) and are executed in order of definition. Use \begtt \adef![#1]{\url{#1}} \filedef/e[preamble]{preamble.js} -\djavascript[preamble]{preamble} +\dljavascript[preamble]{preamble} \dljavascript[initialization]{% var data = 42; @@ -554,7 +554,7 @@ Examples: \render[video]{\inspic{example-image.pdf}} % we want the rendition action to have yellow border and red content -\let\_renditionborder\Yellow +\def\_renditionborder{1 1 0} \let\_renditionlinkcolor\Red To start playing the video, click \hlink[rendition::play]{\"Play"}. @@ -671,14 +671,102 @@ You can choose what is shown when document is opened with commands: The commands are mutually exclusive and only the first appearing one will be respected. -You can set request two page view (odd pages on the right) using +You can request two page view (odd pages on the right) using \^`\duplexdisplay`. It is useful for more natural display of double sided documents. Because it may not be desirable to automatically apply this, it is independent of `\margins`. +\label[user:plain+latex] +\sec Usage in plain \LuaTeX/ or LuaLa\TeX/ + +You can use this package also from plain LuaTeX by adding to your document: + +\begtt +\input pdfextra +\endtt + +\noindent or for LuaLa\TeX/: + +\begtt +\usepackage{pdfextra} +\endtt + +See the file `pdfextra-example-latex.tex` for the adaptation of the \OpTeX/ +examples to \LaTeX/. + +The usage of the macros described in this document is the same, but there are +limitations: + +\begitems +* {\em Color}. Where this package expects \"\OpTeX/ color" key value argument +(e.g. `\Blue`), you have to use an RGB triplet instead (e.g. `0.0 0.0 0.0` or +the shorter `0 0 0`). + +But for text color setting, you can get away with wrapping commands from +La\TeX/'s `color` package, e.g. to customize link border/color: + + \begtt + \sdef{_renditionlinkcolor}{\color[red]} + \endtt + +* {\em Initialization}. In \OpTeX/ you normally have to initialize hyperlinks +with the command\nl +`\hyperlinks`.\nl +This is not required by this package. You can instead set the color by setting +`\_linkcolor` (fallback for all link types), `\_ilinkcolor` / `\_elinkcolor` +(internal / external links). E.g. if you have the \LaTeX/ `color` package +loaded, you can get blue links like this: + + \begtt + \sdef{_linkcolor}{\color[blue]} + \endtt + +In addition to the above this means all links will be blue except \"rendition" +links. + +* {\em Openaction}. If the package `hyperref` is used, then `\openaction` will +not work. + +* {\em Labels / hyperlink destinations}. \OpTeX/ uses very simple and consistent +scheme for labels / hyperlink destinations: + + \begitems + * `ref: