From a9b8cdca9e56f15128ba80b12cd16efb7ff85a81 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Sun, 1 Nov 2015 11:00:23 +0100 Subject: [PATCH] Varwidth module provided by d.iabo See #9417. --- lib/Makefile.am | 3 ++- lib/chkconfig.ltx | 1 + lib/doc/LaTeXConfig.lyx | 51 +++++++++++++++++++++++++++++++++++-- lib/layouts/varwidth.module | 42 ++++++++++++++++++++++++++++++ src/LaTeXFeatures.cpp | 3 ++- 5 files changed, 96 insertions(+), 4 deletions(-) create mode 100644 lib/layouts/varwidth.module diff --git a/lib/Makefile.am b/lib/Makefile.am index 9d58de4b81..0b17eb1fc2 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -2185,7 +2185,8 @@ dist_layouts_DATA =\ layouts/todonotes.module \ layouts/treport.layout \ layouts/tufte-book.layout \ - layouts/tufte-handout.layout + layouts/tufte-handout.layout \ + layouts/varwidth.module scriptsdir = $(pkgdatadir)/scripts dist_scripts_DATA = \ diff --git a/lib/chkconfig.ltx b/lib/chkconfig.ltx index 2c1249cfaf..009d9ed16f 100644 --- a/lib/chkconfig.ltx +++ b/lib/chkconfig.ltx @@ -376,6 +376,7 @@ \TestPackage{units} \TestPackage{url} \TestPackage{varioref} +\TestPackage{varwidth} \TestPackage[vietnamese.ldf]{vietnamese} \TestPackage{wallpaper} \TestPackage{wrapfig} diff --git a/lib/doc/LaTeXConfig.lyx b/lib/doc/LaTeXConfig.lyx index 1c8da73565..ee40697d04 100644 --- a/lib/doc/LaTeXConfig.lyx +++ b/lib/doc/LaTeXConfig.lyx @@ -1,5 +1,5 @@ #LyX 2.2 created this file. For more info see http://www.lyx.org/ -\lyxformat 497 +\lyxformat 499 \begin_document \begin_header \origin /systemlyxdir/doc/ @@ -6596,7 +6596,7 @@ macros/latex/contrib/todonotes/ \begin_layout Description -\change_inserted -712698321 1409489236 +\change_inserted -712698321 1446371553 Notes: The package \family sans todonotes @@ -6611,6 +6611,53 @@ TODO \end_inset notes into documents. +\end_layout + +\begin_layout Subsection + +\change_inserted -712698321 1446371571 +Variable-width Minipages module +\end_layout + +\begin_layout Subsubsection + +\change_inserted -712698321 1446371576 +varwidth +\end_layout + +\begin_layout Description + +\change_inserted -712698321 1446371554 +Found: +\begin_inset Info +type "package" +arg "varwidth" +\end_inset + + +\end_layout + +\begin_layout Description + +\change_inserted -712698321 1446371591 +CTAN: +\family typewriter +macros/latex/contrib/varwidth/ +\end_layout + +\begin_layout Description + +\change_inserted -712698321 1446371666 +Notes: The package +\family sans +varwidth +\family default +\color none + is used to produce minipages variable (i. +\begin_inset space \thinspace{} +\end_inset + +e., content-dependent) width. \change_unchanged \end_layout diff --git a/lib/layouts/varwidth.module b/lib/layouts/varwidth.module new file mode 100644 index 0000000000..fc69597de7 --- /dev/null +++ b/lib/layouts/varwidth.module @@ -0,0 +1,42 @@ +#\DeclareLyXModule{Variable-width Minipages} +#DescriptionBegin +# Adds a 'Minipage (Var. Width)' inset using the varwidth LaTeX package. +# The varwidth package provides a variable-width minipage, whose resulting +# width is the width of its contents (if this does not exceed the specified +# maximum width). +# +# The inset has two optional arguments: vertical adjustment (c|t|b) and +# maximum width (defaults to \linewidth). +#DescriptionEnd +# +# Authors: d.iabo +# Jürgen Spitzmüller + +Format 49 + +InsetLayout Flex:Minipage_(Var._Width) + LyXType custom + LabelString "Minipage (var.)" + LatexType Environment + LatexName varwidth + Decoration Classic + MultiPar true + CustomPars true + ResetsFont true + LabelFont + Color foreground + Size Small + EndFont + Argument 1 + LabelString "Vert. Adjustment" + Tooltip "Vertical adjustment: c (center), t (top) or b (bottom)" + EndArgument + Argument 2 + LabelString "Max. Width" + Tooltip "Maximum width (default: \linewidth)" + DefaultArg "\linewidth" + Mandatory 1 + EndArgument + Requires varwidth +End + diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp index 562e0e2a00..fb8fb6085a 100644 --- a/src/LaTeXFeatures.cpp +++ b/src/LaTeXFeatures.cpp @@ -796,7 +796,8 @@ char const * simplefeatures[] = { "pdfcomment", "fixme", "todonotes", - "forest" + "forest", + "varwidth" }; char const * bibliofeatures[] = { -- 2.39.2