Template:Figure: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
Trying to remove extra empty paragraph when there is no caption. |
Avoid page breaks between image and caption |
||
Line 1: | Line 1: | ||
<div style="{{ #ifeq: {{{position|}}} | absolute | position:absolute; left:{{{figureleft|0px}}}; top:{{{figuretop|0px}}}; | position:relative; {{ #ifeq: {{{position|}}} | center | margin:0 auto; | float:{{{position|left}}}; }} }} width:{{{width|400px}}}; padding:{{{padding|0}}};"> |
<div style="{{ #ifeq: {{{position|}}} | absolute | position:absolute; left:{{{figureleft|0px}}}; top:{{{figuretop|0px}}}; | position:relative; {{ #ifeq: {{{position|}}} | center | margin:0 auto; | float:{{{position|left}}}; }} }} width:{{{width|400px}}}; padding:{{{padding|0}}}; page-break-inside:avoid;"> |
||
{{ #if: {{{topcaption|}}} | {{{topcaption}}} }} |
{{ #if: {{{topcaption|}}} | {{{topcaption}}} }} |
||
[[File:{{{image|cross.svg}}}|{{{width|400px}}}|{{{alt|{{{image|cross.svg}}}}}}]] |
[[File:{{{image|cross.svg}}}|{{{width|400px}}}|{{{alt|{{{image|cross.svg}}}}}}]] |
Revision as of 18:54, 16 March 2021
Usage
This template is designed to allow for the convenient captioning and positioning of figures.
Parameters
- image – the name of the image for the figure (i.e. figure_x.png)
- width – the desired width of the figure. Default is 400px, which is the largest size compatable with dynamic layout "Layout 2".
- position – the desired positioning of the figure. Options are "left", "right", "center", and "absolute". "Left" and "right" and float the figure to the appropriate side of the text, allowing the text to flow around the figure; "center" positions the ifigure in the center of the text, but breaks the flow of the text. "Absolute" allows for some more advanced positioning, but care is required since this removes the figure completely from the flow of the text, which could cause issues with the figure overlapping and covering bits of text or other figures.
- figuretop – only used in "absolute" positioning. The distance to the top of the figure from the top of the containing block.
- figureleft – only used in "absolute" positioning. The distance to the left of the figure from the left of the containing block.
- topcaption – used to add a caption to the top of the figure image.
- bottomcaption – used to add a caption to the bottom of the figure image.
- caption – used to position a caption somewhere within the figure image.
- top – the position from the top of the figure image to the top of the caption text.
- left – the position from the left of the figure image to the left of the caption text.
- captionwidth – width of the caption text. Currently only used with "caption".
Example
Simple Usage
{{c| {{font-size-x|375%|{{sc|Carpentry {{x-smaller|and}} Joinery}}}} {{x-larger|HAND TOOLS AND APPLIANCES.}} '''Introduction.''' }} The reader of this book is assumed to have some acquaintance with woodworking, and not to stand in need of detail instruction as to the shape, action, care and use of each and all of a woodworker's tools. This information is given in comprehensive style in a companion volume, entitled "[[Woodworking]]," produced by the Editor of this present book, and sold by the same {{figure | image = cc&j-fig1--two foot rule with slide rule.png | width = 250px | bottomcaption = {{c|{{smaller|'''Fig. 1.—Two-foot Rule with Slide Rule.'''}}}} }} publishers at 9s. Should any reader of this chapter desire further particulars of the tools and appliances here briefly mentioned, he is recommended to consult that work, which undoubtedly contains the most complete description of woodworking tools yet published. {{c|'''Classification of Tools.'''}} Tools may be classed according to their functions and modes of action, as follows: (1) Geometrical tools for laying off and testing work—such tools are rules, straight-edges, gauges, etc. (2) Tools for supporting and holding work; such tools are benches, vices, stools, etc. (3) Paring or shaving tools, such as chisels, spokeshaves, planes, etc. (4) Saws. (5) Percussion or impelling tools, such as hammers, mallets, {{figure | image = cc&j-fig2--combined marking awl and striking knife.png | width = 250px | position = right | caption = {{c|{{smaller|'''Fig. 2.—Combinded Marking Awl and Striking Knife'''}}}} | top = 150px | left = 75px | captionwidth = 175px }} screw-drivers, and (combined with cutting) hatchets, axes, adzes, etc. (6) Boring tools, such as gimlets, brace-bits, etc. (7) Abrading and scraping tools, such as rasps, scrapers, glasspaper, and implements such as whetstones, etc., for sharpening edged tools. {{c|'''Geometrical Tools.'''}} Rules.—For all-round purposes a 2-ft. four-fold boxwood rule, with or without a slide rule (Fig. 1), is best. Rules are made in great variety, but the average worker's requirements will be best met by a simple one.
Carpentry and Joinery
HAND TOOLS AND APPLIANCES.
Introduction.
Classification of Tools.
Geometrical Tools.
Rules.—For all-round purposes a 2-ft. four-fold boxwood rule, with or without a slide rule (Fig. 1), is best. Rules are made in great variety, but the average worker's requirements will be best met by a simple one.
Complex Usage
{{center block|width=600px|height=890px| {{figure | image = cc&j-fig3--straight-edge.png | width = 550px | position = left | bottomcaption = {{c|{{smaller|'''Fig. 3.—Straight-Edge.'''}}}} }} {{figure | image = cc&j-fig5--try and mitre square.png | width = 260px | position = right | caption = {{c|{{smaller|'''Fig. 5.—Try and Mitre Square.'''}}}} | top = 70px | left = 25px }} {{figure | image = cc&j-fig4--try square.png | width = 240px | position = right | caption = {{c|{{smaller|'''Fig. 4.—Try Square.'''}}}} | top = 70px | left = 40px }} {{figure | image = cc&j-fig6--mitre square.png | width = 250px | position = absolute | figuretop = 210px | caption = {{c|{{smaller|'''Fig. 6.—Mitre Square.'''}}}} | top = 260px | left = 150px }} {{figure | image = cc&j-fig7--sliding bevel.png | width = 350px | position = right | caption = {{c|{{smaller|'''Fig. 7.—Sliding Bevel.'''}}}} | top = 270px | left = 250px }} {{figure | image = cc&j-fig8--marking gauge.png | width = 350px | position = absolute | figuretop = 570px | bottomcaption = {{c|{{smaller|'''Fig. 8.—Marking Gauge.'''}}}} }} {{figure | image = cc&j-fig9--mortise gauge.png | width = 270px | position = right | caption = {{c|{{smaller|'''Fig. 9.—Mortise Gauge.'''}}}} | top = 140px | left = 130px | captionwidth = 100px }} {{figure | image = cc&j-fig10--cutting gauge.png | width = 400px | position = absolute | figuretop = 740px | caption = {{c|{{smaller|'''Fig. 10.—Cutting Gauge.'''}}}} | top = 110px | left = 90px }} }}{{clear}}