X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=lib%2Fexamples%2Fcolored-boxes.lyx;h=69762f7aa8dd9e17be3be688cc2104b1632254cd;hb=2111e775f53f42b64539a64350b35c39af53fd18;hp=2993ef6562081e3d70c358b5b1cbadbf74e58939;hpb=ce933b1e14fc9e18f2cb3f987ce84d068a3b1d44;p=lyx.git diff --git a/lib/examples/colored-boxes.lyx b/lib/examples/colored-boxes.lyx index 2993ef6562..69762f7aa8 100644 --- a/lib/examples/colored-boxes.lyx +++ b/lib/examples/colored-boxes.lyx @@ -1,7 +1,8 @@ #LyX 2.2 created this file. For more info see http://www.lyx.org/ -\lyxformat 497 +\lyxformat 508 \begin_document \begin_header +\save_transient_properties true \origin /systemlyxdir/examples/ \textclass scrartcl \begin_preamble @@ -15,15 +16,17 @@ \fi % end if pdflatex is used -% increase link area for cross-references and autoname them, -\AtBeginDocument{\renewcommand{\ref}[1]{\mbox{\autoref{#1}}}} -\@ifundefined{extrasenglish}{\usepackage[english]{babel}}{} -\addto\extrasenglish{% - \renewcommand*{\equationautorefname}[1]{}% - \renewcommand{\sectionautorefname}{sec.\negthinspace}% - \renewcommand{\subsectionautorefname}{sec.\negthinspace}% - \renewcommand{\subsubsectionautorefname}{sec.\negthinspace}% -} +\@ifpackageloaded{babel}{ + % increase link area for cross-references and autoname them, + \AtBeginDocument{\renewcommand{\ref}[1]{\mbox{\autoref{#1}}}} + \@ifundefined{extrasenglish}{\usepackage[english]{babel}}{} + \addto\extrasenglish{% + \renewcommand*{\equationautorefname}[1]{}% + \renewcommand{\sectionautorefname}{sec.\negthinspace}% + \renewcommand{\subsectionautorefname}{sec.\negthinspace}% + \renewcommand{\subsubsectionautorefname}{sec.\negthinspace}% + } +}{} \end_preamble \options BCOR8mm, most, usenames, dvipsnames \use_default_options false @@ -35,16 +38,16 @@ tcolorbox \language_package default \inputencoding auto \fontencoding global -\font_roman default -\font_sans default -\font_typewriter default -\font_math auto +\font_roman "default" "default" +\font_sans "default" "default" +\font_typewriter "default" "default" +\font_math "auto" "auto" \font_default_family default \use_non_tex_fonts false \font_sc false \font_osf false -\font_sf_scale 100 -\font_tt_scale 100 +\font_sf_scale 100 100 +\font_tt_scale 100 100 \graphics default \default_output_format default \output_sync 0 @@ -145,7 +148,7 @@ The fancy boxes are generated by the \SpecialChar LaTeX tcolorbox \series default . - This package has so many features so that its manual exceeds 400 + This package has so many features that its manual exceeds 400 \begin_inset space ~ \end_inset @@ -282,7 +285,7 @@ status open \series bold Note: \series default - the box can contain forced page breaks but they will be ignored. + The box can contain forced page breaks but they will be ignored. To get breakable boxes, see \begin_inset CommandInset ref LatexCommand ref @@ -335,8 +338,15 @@ A dynamic color box. \end_layout \begin_layout Standard -In contrary to static boxes dynamic boxes cannot have parts, they cannot - made breakable but one can set their vertical placement, see +In contrary to static boxes dynamic boxes cannot have parts, see +\begin_inset CommandInset ref +LatexCommand ref +reference "subsec:Box-parts" + +\end_inset + +, and they cannot made breakable but one can set their vertical placement, + see \begin_inset CommandInset ref LatexCommand ref reference "subsec:Vertical" @@ -352,7 +362,7 @@ Fit \end_layout \begin_layout Standard -A fit color box insert is inserted via the menu +A fit color box is inserted via the menu \family sans Insert\SpecialChar menuseparator Custom Insets\SpecialChar menuseparator @@ -386,7 +396,7 @@ reference "subsec:Geometry" \end_layout \begin_layout Standard -This is a fit color box: +These are fit color boxes: \end_layout \begin_layout Standard @@ -426,7 +436,6 @@ cm wide fit color box with some text. \end_layout \begin_layout Standard -Another fit color box: \begin_inset Flex Fit Color Box status open @@ -484,7 +493,7 @@ Box \end_layout \begin_layout Standard -How to use and customize the custom color boxes, see +How to use and customize custom color boxes, see \begin_inset CommandInset ref LatexCommand ref reference "subsec:General" @@ -599,11 +608,18 @@ reference "subsec:Title-text" \begin_layout Subsection Box parts +\begin_inset CommandInset label +LatexCommand label +name "subsec:Box-parts" + +\end_inset + + \end_layout \begin_layout Standard -The content of the box can be divided into an upper and a lower part with - by using the environment +The content of the box can be divided into an upper and a lower part by + using the environment \family sans Color Box Separator \family default @@ -611,8 +627,8 @@ Color Box Separator 's environment selection combobox. The idea behind this is that both parts can be treated and customized separatel y. - An example would be where the upper part contains a description and the - lower part an equation. + An application would be that the upper part contains a description and + the lower part an equation. \end_layout \begin_layout Standard @@ -791,11 +807,11 @@ Color Box Line \family default . The line is by default dashed. - it is just a line and does not separate box parts. + Note that it is just a line and does not separate box parts! \end_layout \begin_layout Standard -This is a box where the content is divided: +This is a box with a line: \end_layout \begin_layout Standard @@ -820,38 +836,51 @@ Some text \end_layout \begin_layout Standard -The line style can be changed with the box option -\series bold -segmentation style={} -\series default -. -\end_layout +The line style can only be changed if a skin is specified, see +\begin_inset CommandInset ref +LatexCommand ref +reference "subsec:Enhanced" -\begin_layout Standard -\begin_inset Note Greyedout -status open +\end_inset -\begin_layout Plain Layout +. + Then one can use the box option +\series bold +segmentation style={commands} +\series default + where +\series bold +commands +\series default + are commands to define the style. + See section +\family sans +Library +\begin_inset space ~ +\end_inset +skins +\family default + of the \series bold -Note: +tcolorbox \series default - The braces and its content must be inserted as \SpecialChar TeX - code. -\end_layout + manual for possible commands, +\begin_inset CommandInset citation +LatexCommand cite +key "tcolorbox" \end_inset - +. \end_layout \begin_layout Standard -To be able to use this option, the option -\series bold +Here is an example in the +\emph on enhanced -\series default - needs to be added too. - Here is an example with a double blue line: +\emph default + skin with a double blue line: \end_layout \begin_layout Standard @@ -885,18 +914,10 @@ Some text \end_layout \begin_layout Standard -For more details have a loot at the -\series bold -tcolorbox -\series default - manual, -\begin_inset CommandInset citation -LatexCommand cite -key "tcolorbox" - +\begin_inset Newpage newpage \end_inset -. + \end_layout \begin_layout Section @@ -911,7 +932,11 @@ name "sec:Beakable-boxes" \end_layout \begin_layout Standard -To make a box breakable the option breakable is added. +To make a box breakable the option +\series bold +breakable +\series default + is added. If a page break occurs within a box, the box will get broken this way: \end_layout @@ -1010,7 +1035,7 @@ title after break \end_layout \begin_layout Standard -If boxes are inside boxes, only the outer box can be made breakable. +If boxes are inside boxes, only the outer box can made breakable. \end_layout \begin_layout Standard @@ -1022,7 +1047,7 @@ status open \series bold Note: \series default - Dynamic boxes and fit boxes cannot be made breakable! + Dynamic boxes and fit boxes cannot made breakable! \end_layout \end_inset @@ -1050,9 +1075,7 @@ The following subsections show many possibilities to customize boxes. \end_layout \begin_layout Standard -In real documents one wants only a few types of boxes and all boxes of a - type should look identical. - To avoid to write the box commands all the time, you can use the environment +To avoid to write the box commands all the time, you can use the environment \family sans Color @@ -1068,8 +1091,11 @@ Setup . It is inserted via \SpecialChar LyX 's style selection combobox. - There you can write all options that should be applied for all boxes of - the document + There you can write all options that should be applied for +\emph on +all +\emph default + boxes of the document \emph on following \emph default @@ -1087,16 +1113,18 @@ cm and a width of 3 \end_inset cm. -\end_layout - -\begin_layout Standard -This is not useful if one needs several box types since the changes would - affect + However, this is not useful if one needs several box types since the changes + would affect \emph on all \emph default boxes. - Therefore the module +\end_layout + +\begin_layout Standard +In most documents one need a few types of boxes and all boxes of a type + should look identical. + To achieve this the module \emph on Fancy \begin_inset space ~ @@ -1244,7 +1272,7 @@ enhanced, frame style={left color=red!75!black, right color=blue!75!black}, \end_layout \begin_layout Standard -Now every +This way you defined the box type \family sans Custom \begin_inset space ~ @@ -1260,7 +1288,8 @@ Box 1 \family default - will look like this: +. + Boxes of this type will look like this: \end_layout \begin_layout Standard @@ -1336,8 +1365,11 @@ Name \series bold cBoxB \series default -. - The Argument is +, +\family sans +Arguments +\family default + is \series bold 1 \series default @@ -1428,7 +1460,6 @@ thetcbcounter : #1 \end_layout \begin_layout Standard -a \begin_inset Flex Custom Color Box 2 status open @@ -1568,7 +1599,11 @@ cBoxC \begin_inset space ~ \end_inset -Arguments, the Argument is therefore +Arguments, +\family sans +Arguments +\family default + is therefore \series bold 2 \series default @@ -1741,8 +1776,16 @@ Skins \begin_layout Standard The \SpecialChar LaTeX - package tcolorbox provides different skins. - For a full list, see the tcolorbox manual, section + package +\series bold +tcolorbox +\series default + provides different skins. + For a full list, see the +\series bold +tcolorbox +\series default + manual, section \family sans Library \begin_inset space ~ @@ -1781,10 +1824,17 @@ This skin is enabled by adding the option enhanced. LatexCommand ref reference "subsec:Lines" +\end_inset + + or the ability to have shadows, see +\begin_inset CommandInset ref +LatexCommand ref +reference "subsec:Shadows" + \end_inset . - Another feature is a nicer view of breakable boxes: + Another feature is a nicer style of breakable boxes: \end_layout \begin_layout Standard @@ -1873,7 +1923,8 @@ Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy \end_layout \begin_layout Standard -A feature you might like is to add color gradient with the options +Another feature you might like is to add color gradients with the options + \series bold frame style \series default @@ -1882,11 +1933,19 @@ frame style interior style \series default . - Its syntax is + Their syntax is +\begin_inset Newline newline +\end_inset + + \series bold frame style={left color=color, right color=color} +\begin_inset Newline newline +\end_inset + + \series default - where +where \series bold color \series default @@ -2002,7 +2061,7 @@ The color of the lower part can be changed with the option colbacklower \series default . - See also + See \begin_inset CommandInset ref LatexCommand ref reference "subsec:Color" @@ -2012,10 +2071,6 @@ reference "subsec:Color" for color customization. \end_layout -\begin_layout Standard -Shadow drop shadow -\end_layout - \begin_layout Subsubsection Beamer \begin_inset CommandInset label @@ -2181,8 +2236,8 @@ Side by side Normally the boxes are a paragraph of its own. They will therefore appear by default one upon another separated by vertical space. - To change this behavior to place for example boxes side by side and uses - the placement options + To change this behavior, to place for example boxes side by side, use the + placement options \series bold before=code \series default @@ -2380,7 +2435,7 @@ cm wide, square box. \begin_layout Standard If you prefer \SpecialChar TeX - code you can alternative use the option + code you can alternatively use the option \series bold after= \backslash @@ -2441,7 +2496,7 @@ b \begin_inset Quotes erd \end_inset -, and + and \begin_inset Quotes eld \end_inset @@ -2462,7 +2517,7 @@ Float Placement \family default - of the of the + of the \emph on Embedded \begin_inset space ~ @@ -2619,8 +2674,8 @@ tcbox raise=0pt \series bold tcbox raise base \series default - the box is lowered that the base of the box content matches the base of - the surrounding line. + the box is lowered so that the base of the box content matches the base + of the surrounding line. \end_layout \begin_layout Standard @@ -2699,7 +2754,7 @@ Raster \begin_layout Standard The easiest way to place boxes in a table-like raster is to put them into a raster box. - To get a raster box insert a + The \family sans Raster \begin_inset space ~ @@ -2711,7 +2766,7 @@ Color Box \family default - inset via the menu + inset is inserted via the menu \family sans Insert\SpecialChar menuseparator Custom Insets @@ -2854,7 +2909,8 @@ A simple box. \end_layout \begin_layout Standard -For more info options of the raster color box, please consult the +For more info about options of the raster color box, please consult the + \series bold tcolorbox \series default @@ -2959,7 +3015,7 @@ One can also set a width only for the text of the box with the option text width=length \series default . - If the width is shorter than required for the text new lines will be created + If the width is shorter than required for the text, new lines will be created automatically. \end_layout @@ -2998,7 +3054,7 @@ width \series bold text width \series default - because only the last given width option is taken into account. +; only the last given width option is taken into account. \end_layout \begin_layout Standard @@ -3006,7 +3062,7 @@ To extend the width of the box one must use the \series bold width \series default - option and can then uses the option + option and can then use the option \series bold add to width=length \series default @@ -3092,7 +3148,11 @@ Embedded Objects \emph default manual. - All option require of course the option sidebyside. + All options require of course the option +\series bold +sidebyside +\series default +. \end_layout \begin_layout Standard @@ -3100,7 +3160,7 @@ Objects \series bold sidebyside gap \series default - sets the space between the left and the right part. + sets the space between the left and the right part: \end_layout \begin_layout Standard @@ -3146,7 +3206,7 @@ lefthand width \series bold righthand width \series default - sets the absolute width of the left and right part, respectively. + set the absolute width of the left and right part, respectively: \end_layout \begin_layout Standard @@ -3192,7 +3252,7 @@ lefthand ratio \series bold righthand ratio \series default - sets the relative width of the left and right part, respectively. + set the relative width of the left and right part, respectively: \end_layout \begin_layout Standard @@ -3284,7 +3344,7 @@ cm high box. \end_layout \begin_layout Standard -If the specified height is smaller then the one consumed by the content, +If the specified height is smaller than the one consumed by the content, the content will be placed below the box: \end_layout @@ -3322,7 +3382,7 @@ With the option \series bold square \series default - the height will automatically set to the same value than the box width. + the height will automatically be set to the same value than the box width. \end_layout \begin_layout Standard @@ -3491,7 +3551,7 @@ max are values. The height will then be at least the given minimal value or the height consumed by the content. - It does not exceed the maximum independent of the content: + It does not exceed the maximum, independent of the content: \end_layout \begin_layout Standard @@ -3546,6 +3606,11 @@ cm and maximal height of 3 \begin_inset space \thinspace{} \end_inset +cm. + The content consumes more space than 3 +\begin_inset space \thinspace{} +\end_inset + cm. A box with minimal height of 1 \begin_inset space \thinspace{} @@ -3555,6 +3620,11 @@ cm and maximal height of 3 \begin_inset space \thinspace{} \end_inset +cm. + The content consumes more space than 3 +\begin_inset space \thinspace{} +\end_inset + cm. A box with minimal height of 1 \begin_inset space \thinspace{} @@ -3564,6 +3634,25 @@ cm and maximal height of 3 \begin_inset space \thinspace{} \end_inset +cm. + The content consumes more space than 3 +\begin_inset space \thinspace{} +\end_inset + +cm. + A box with minimal height of 1 +\begin_inset space \thinspace{} +\end_inset + +cm and maximal height of 3 +\begin_inset space \thinspace{} +\end_inset + +cm. + The content consumes more space than 3 +\begin_inset space \thinspace{} +\end_inset + cm. \end_layout @@ -3601,12 +3690,12 @@ status open status open \begin_layout Plain Layout -height=1.5cm, add to height=1cm +height=1cm, add to height=1cm \end_layout \end_inset -A 1.5 +A 1 \begin_inset space \thinspace{} \end_inset @@ -3655,7 +3744,7 @@ true \end_inset In this example the box is in the main text and therefore consumes the rest - of the current page. + of the current page: \end_layout \begin_layout Standard @@ -3737,7 +3826,7 @@ height \series bold text height \series default - because only the last given width option is taken into account. +; only the last given width option is taken into account. \end_layout \begin_layout Standard @@ -3896,7 +3985,7 @@ split fraction \series default is the fraction of the complete height (not the additional height). - Therefore one must be careful of e. + Therefore one must be careful if e. \begin_inset space \thinspace{} \end_inset @@ -3992,7 +4081,7 @@ status open status open \begin_layout Plain Layout -adjusted title=ice, width=0.3 +adjusted title=ace, width=0.3 \backslash columnwidth, nobeforeafter, equal height group=A \end_layout @@ -4115,7 +4204,7 @@ Grapefruit \begin_inset Quotes eld \end_inset -ice +ace \begin_inset Quotes erd \end_inset @@ -4370,7 +4459,7 @@ arc=5 \begin_inset space \thinspace{} \end_inset -mm +mm, \series default \series bold @@ -4477,7 +4566,7 @@ A 3.5 \begin_inset space \thinspace{} \end_inset -cm wide circular box. +cm wide circular arc box. \end_layout \end_inset @@ -4486,7 +4575,7 @@ cm wide circular box. \end_layout \begin_layout Standard -As you can see circular box looks ugly when the box is wider than high. +As you can see circular arc box looks ugly when the box is wider than high. It is therefore recommended to add the option \series bold square @@ -4500,7 +4589,7 @@ reference "subsec:Height" , to get the same width and height. The result is a perfect circle. - The center the text in the box use the text alignment options described + To center the text in the box use the text alignment options described in \begin_inset CommandInset ref LatexCommand ref @@ -4529,7 +4618,7 @@ A 4 \begin_inset space \thinspace{} \end_inset -cm wide circular box. +cm wide circular arc box. \end_layout \end_inset @@ -4668,7 +4757,7 @@ The option octogon arc \series default is useful to get an octagon. - For an octagon one needs a square box and the options + For an octagon one needs a square box and the option \series bold arc is angular \series default @@ -5199,7 +5288,7 @@ A vertically centered box. \end_layout \begin_layout Description -scale the content is vertically centered to fit the height +scale the content is vertically scaled to fit the height \begin_inset Flex Color Box status open @@ -5410,7 +5499,7 @@ The color is specified in one of these schemes: Name \series default -\begin_inset Newline newline +\begin_inset VSpace 3mm \end_inset @@ -5462,10 +5551,10 @@ red \begin_layout Enumerate \series bold -Name1!PercentOfName1 +Name!PercentOfName \series default -\begin_inset Newline newline +\begin_inset VSpace 3mm \end_inset @@ -5496,7 +5585,7 @@ geen!30 \begin_inset Quotes eld \end_inset -transparent +transparency \begin_inset Quotes erd \end_inset @@ -5536,7 +5625,7 @@ green!30 Name1!PercentOfName1!Name2 \series default -\begin_inset Newline newline +\begin_inset VSpace 3mm \end_inset @@ -5599,7 +5688,7 @@ red!30!blue Name1!PercentName1!Name2!PercentName3!Name3 \series default -\begin_inset Newline newline +\begin_inset VSpace 3mm \end_inset @@ -6863,6 +6952,23 @@ title=A title, coltitle=orange Title text color \end_layout +\begin_layout Plain Layout +\begin_inset Flex Subtitle +status open + +\begin_layout Plain Layout +The subtitle +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Plain Layout +Text +\end_layout + \end_inset @@ -6946,6 +7052,278 @@ Lower text color \end_inset +\end_layout + +\begin_layout Standard +\begin_inset Newpage newpage +\end_inset + + +\end_layout + +\begin_layout Subsection +Shadows +\begin_inset CommandInset label +LatexCommand label +name "subsec:Shadows" + +\end_inset + + +\end_layout + +\begin_layout Standard +Boxes can only be decorated with shadows if a skin is specified, see +\begin_inset CommandInset ref +LatexCommand ref +reference "subsec:Enhanced" + +\end_inset + +. +\end_layout + +\begin_layout Subsubsection +Shadow +\end_layout + +\begin_layout Standard +A shadow is added with the box option +\series bold +drop shadow=color +\series default + where +\series bold +color +\series default + is a color name or definition, see +\begin_inset CommandInset ref +LatexCommand ref +reference "subsec:Color" + +\end_inset + +. + One can omit the color, the shadow color is then black!50!white. + The option +\series bold +drop fuzzy shadow +\series default + creates a semi-transparent shadow. +\end_layout + +\begin_layout Standard +\begin_inset Flex Color Box +status open + +\begin_layout Plain Layout +\begin_inset Argument 1 +status open + +\begin_layout Plain Layout +enhanced, drop shadow, nobeforeafter +\end_layout + +\end_inset + +A box with a shadow +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset VSpace defskip +\end_inset + + +\begin_inset Flex Color Box +status open + +\begin_layout Plain Layout +\begin_inset Argument 1 +status open + +\begin_layout Plain Layout +enhanced, drop fuzzy shadow=purple, nobeforeafter +\end_layout + +\end_inset + +A box with a fuzzy, purple shadow +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +The default shadow is placed right below the box. + For other shadow placements have a look at section +\family sans +Shadow Option Keys +\family default + of the +\series bold +tcolorbox +\series default + manual, +\begin_inset CommandInset citation +LatexCommand cite +key "tcolorbox" + +\end_inset + +. +\end_layout + +\begin_layout Subsubsection +Halo +\end_layout + +\begin_layout Standard +A halo is added with the box option +\series bold +halo=size with color +\series default + where +\series bold +size +\series default + is a value and +\series bold +color +\series default + is a color name or definition. + One can omit the size and color, the halo is then 0.9 +\begin_inset space \thinspace{} +\end_inset + +mm thick and has the color yellow. + Note that one cannot omit only the size or color, either both is omitted + or both is specified. + The option +\series bold +fuzzy halo +\series default + creates a semi-transparent halo. +\end_layout + +\begin_layout Standard +\begin_inset Flex Color Box +status open + +\begin_layout Plain Layout +\begin_inset Argument 1 +status open + +\begin_layout Plain Layout +enhanced, halo, nobeforeafter +\end_layout + +\end_inset + +A box with a halo +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset VSpace defskip +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Flex Color Box +status open + +\begin_layout Plain Layout +\begin_inset Argument 1 +status open + +\begin_layout Plain Layout +enhanced, fuzzy halo=5mm with green, nobeforeafter +\end_layout + +\end_inset + +A box with a 5 +\begin_inset space \thinspace{} +\end_inset + +mm thick, green fuzzy halo +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Subsubsection +Generic +\end_layout + +\begin_layout Standard +Generic shadows/halos can be created with the box option +\series bold +shadow +\series default + or +\series bold +fuzzy shadow +\series default +. + For a brief description of these options consult section +\family sans +Generic Shadows +\family default + of the +\series bold +tcolorbox +\series default + manual, +\begin_inset CommandInset citation +LatexCommand cite +key "tcolorbox" + +\end_inset + +. +\end_layout + +\begin_layout Standard +\begin_inset Flex Color Box +status open + +\begin_layout Plain Layout +\begin_inset Argument 1 +status open + +\begin_layout Plain Layout +enhanced, title=Double shadow, shadow={-2.5mm}{-2.5mm}{0mm}{fill=blue, opacity=0.25 +}, shadow={1.5mm}{1.5mm}{0mm}{fill=red, opacity=0.25} +\end_layout + +\end_inset + +A box with 2 +\begin_inset space ~ +\end_inset + +generic shadows +\end_layout + +\end_inset + + \end_layout \begin_layout Bibliography