From 25111608e6aa05042b0c6f83009262e1973d7a45 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Fri, 10 Apr 2020 03:06:35 +0000 Subject: CTAN sync 202004100306 --- macros/latex/contrib/media4svg/ChangeLog | 3 + macros/latex/contrib/media4svg/README.md | 173 ++ .../contrib/media4svg/example/beamer-example-1.svg | 240 ++ .../contrib/media4svg/example/beamer-example-2.svg | 2807 ++++++++++++++++++++ .../contrib/media4svg/example/beamer-example-3.svg | 95 + .../contrib/media4svg/example/beamer-example-4.svg | 828 ++++++ .../contrib/media4svg/example/beamer-example.tex | 148 ++ macros/latex/contrib/media4svg/media4svg.lua | 102 + macros/latex/contrib/media4svg/media4svg.sty | 736 +++++ 9 files changed, 5132 insertions(+) create mode 100644 macros/latex/contrib/media4svg/ChangeLog create mode 100644 macros/latex/contrib/media4svg/README.md create mode 100644 macros/latex/contrib/media4svg/example/beamer-example-1.svg create mode 100644 macros/latex/contrib/media4svg/example/beamer-example-2.svg create mode 100644 macros/latex/contrib/media4svg/example/beamer-example-3.svg create mode 100644 macros/latex/contrib/media4svg/example/beamer-example-4.svg create mode 100644 macros/latex/contrib/media4svg/example/beamer-example.tex create mode 100755 macros/latex/contrib/media4svg/media4svg.lua create mode 100644 macros/latex/contrib/media4svg/media4svg.sty (limited to 'macros/latex/contrib/media4svg') diff --git a/macros/latex/contrib/media4svg/ChangeLog b/macros/latex/contrib/media4svg/ChangeLog new file mode 100644 index 0000000000..8270a8ad6f --- /dev/null +++ b/macros/latex/contrib/media4svg/ChangeLog @@ -0,0 +1,3 @@ +2020-04-09 + * v0.1 + * new: initial release diff --git a/macros/latex/contrib/media4svg/README.md b/macros/latex/contrib/media4svg/README.md new file mode 100644 index 0000000000..841f2ba63c --- /dev/null +++ b/macros/latex/contrib/media4svg/README.md @@ -0,0 +1,173 @@ +# The `media4svg` LaTeX Package + +Version 0.1, 2020/04/09 + +© 2020--today, Alexander Grahn + +https://gitlab.com/agrahn/media4svg + +## Introduction + +This package implements an interface for embedding video and audio files in SVG +(Scalable Vector Graphics) output. SVG with embedded media is very portable, +as it is supported by all modern Web browsers across a variety of operating +systems and platforms, including portable devices. + +The most portable media formats are as follows: + +**Video** + +| **File extension** | **Codecs** | **MIME-type** | +|:-------------------|:---------------------|:--------------| +| `mp4` | v: h264, a: AAC | `video/mp4` | +| `webm` | v: VP8, a: Vorbis | `video/webm` | +| `ogg` | v: Theora, a: Vorbis | `video/ogg` | + +**Audio** + +| **File extension** | **MIME-type** | +|:-------------------|:--------------| +| `mp3` | `audio/mpeg` | +| `ogg` | `audio/ogg` | +| `wav` | `audio/wav` | + + +In the world of TeX and LaTeX, SVG is produced by means of the +[`dvisvgm`](https://dvisvgm.de/) backend by M. Gieseking, which is included in +TeXLive and MiKTeX. + +Supported workflows are: +* `dvilualatex` ⇒ `dvisvgm` +* `[p|up]latex` ⇒ `dvisvgm` +* `xelatex --no-pdf` ⇒ `dvisvgm` + +All TeX engines that produce DVI/XDV output can be used, but `dvilualatex` is +to be preferred. By default, media data are physically embedded into the SVG +output. For this, they need to be Base64 encoded, which is done by the +built-in Lua interpreter of LuaTeX. The other, non-LuaTeX-based engines call +the Lua script for Base64-encoding as an external program via shell-escape, +which is much slower. + +**Recommended `dvisvgm` commandline options** + +There are a number of `dvisvgm` commandline options that should be used in general: + +````latex +dvisvgm --zoom=-1 --exact --pages=1,- --font-format=woff2 +```` +For exporting `beamer`-class documents to SVG, option `--box=papersize` +should also be added. Refer to the manual page, `man dvisvgm`, for additional +information. + +## Usage + +---- + +**Usage example** + +Here is an +[example presentation](http://mirrors.ctan.org/macros/latex/contrib/media4svg/example/beamer-example-1.svg) +([source code][http://mirrors.ctan.org/macros/latex/contrib/media4svg/example/beamer-example.tex]) +with an embedded video file and a streamed video. It also explains how to use +the mouse and the keyboard for playback control. + +---- + +Option `dvisvgm` must be set globally by passing it to the document class. +````latex +\documentclass[dvisvgm]{...} +```` + +The package itself is loaded with +````latex +\usepackage[]{media4svg} +```` + +Package options are: `draft`, `final`, `autoplay`, `loop`, `controls`, +`mimetype`, `width`, `height`, `totalheight`, `keepaspectratio`, `scale`, +`url`, `embed`. They have the same meaning as the command options explained +below, but are applied globally. + +Note that `media4svg` is incompatible with package `media9`. + +The command for media inclusion is +````latex +\includemedia[]{}{} +```` +Command options: +````latex +id=