The nccfloats package

Similar documents
The nccfancyhdr package

The manyfoot package

NCCTOOLS. Release 3.5

The fullminipage package

The supertabular environment

The mcaption package

The extdash package. Alexander I. Rozhenko 2018/06/24

Lecture 05 I/O statements Printf, Scanf Simple statements, Compound statements

Typesetting lettrines in L A TEX 2ε documents Daniel Flipo

Documentation of the UJAC print module's XML tag set.

The tensor package for L A TEX2e

The xargs package. Manuel Pégourié-Gonnard v1.1 (2008/03/22) 1 Introduction 1. 2 Usage 1

C How to Program, 6/e by Pearson Education, Inc. All Rights Reserved.

% \lineskip is 1pt for all font sizes. \normallineskip 1pt \def\baselinestretch{1.37}

mnotes annotate documents with margin comments

Arrays. Defining arrays, declaration and initialization of arrays. Designed by Parul Khurana, LIECA.

Square cells: an array cooking lesson

The showkeys package

A package for rotated objects in L A TEX

Formatting Text. 05_Format rd July 2000

Graphics. Graphics. Graphics. Graphics

L A TEX examples. a b c a b c b b a c b c c b a. This table was typeset with the following commands.

The keyval package. David Carlisle 2014/10/28

Welcome to the floatflt package!

Unit 3 Decision making, Looping and Arrays

The multicap L A TEX2ε package

This package allows you to add version control information as a gray watermark on each page of your document.

The showkeys package

How to use text. Adding a text frame

The KOMA- Script package tocstyle

CS 189 L A TEX and Linux: Text in Boxes

Band Editor User Guide Version 1.3 Last Updated 9/19/07

TSM Report Designer. Even Microsoft Excel s Data Import add-in can be used to extract TSM information into an Excel spread sheet for reporting.

Documentation for xcomment.sty

The showexpl package

The adjustbox Package

Text and Layout. Digital Multimedia, 2nd edition Nigel Chapman & Jenny Chapman Chapter 11. This presentation 2004, MacAvon Media Productions

The afterpage package

Lecture 5 Tao Wang 1

% \lineskip is 1pt for all font sizes. \normallineskip 1pt \def\baselinestretch{1.37}

The xtab package. Peter Wilson herries dot press (at) earthlink dot net 2008/07/26

The newcommand.py utility

A style option for rotated objects in L A TEX

REPETITION CONTROL STRUCTURE LOGO

Meeting One. Aaron Ecay. February 2, 2011

Martin Scharrer Version v1.2a 2018/03/30. Abstract


pgfopts LaTeX package options with pgfkeys

COMP-202: Foundations of Programming. Lecture 6: Conditionals Jackie Cheung, Winter 2016

Review Sheet for Midterm #1 COMPSCI 119 Professor William T. Verts

1 Executing the Program

Web Site Design and Development Lecture 6

The latexrelease package

SIMPLE TEXT LAYOUT FOR COREL DRAW. When you start Corel Draw, you will see the following welcome screen.

Unit D Lecture Notes Word 2003

Chapter 3. More Flow of Control. Copyright 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

L A TEX Primer. Randall R. Holmes. August 17, 2018

footnotehyper Abstract footnotehyper footnotehyper footnotehyper 1 License

Document Editor Basics

The xparse package Document command parser

Binghamton University. CS-211 Fall Syntax. What the Compiler needs to understand your program

Lecture 04 FUNCTIONS AND ARRAYS

\STRUCT{struct name}{structure purpose}{statements} For a description of the statements see section Macros

Arrays. Comp Sci 1570 Introduction to C++ Array basics. arrays. Arrays as parameters to functions. Sorting arrays. Random stuff

EDITOR GUIDE. Button Functions:...2 Inserting Text...4 Inserting Pictures...4 Inserting Tables...8 Inserting Styles...9

JME Language Reference Manual

Labels and Envelopes in Word 2013

Python I. Some material adapted from Upenn cmpe391 slides and other sources

Sample Chapters. To learn more about this book, visit the detail page at: go.microsoft.com/fwlink/?linkid=192147

A L A TEX-Package for IEEE PES Transactions

L A TEX: Online module 2

The footbib package. Eric Domenjoud 2007/02/20. 1 General overview 1. 3 Known and potential problems 7

The Newsletter will contain a Title for the newsletter, a regular border, columns, Page numbers, Header and Footer and two images.

The MathType Window. The picture below shows MathType with all parts of its toolbar visible: Small bar. Tabs. Ruler. Selection.

Word Tutorial 4 Enhancing Page Layout and Design

CounselLink Reporting. Designer

Trees in TEX David Eppstein; February 6, 1985

New Perspectives on Microsoft Word Module 4: Enhancing Page Layout and Design

Working with Strings. Husni. "The Practice of Computing Using Python", Punch & Enbody, Copyright 2013 Pearson Education, Inc.

Introduction to Programming in C Department of Computer Science and Engineering. Lecture No. #43. Multidimensional Arrays

Math 291: Lecture 5. Dr. Fagerstrom. Minnesota State University Moorhead web.mnstate.edu/fagerstrom

Introduction to Internet of Things Prof. Sudip Misra Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur

Lesson 7A Arrays. By John B. Owen All rights reserved 2011, revised 2014

Make a Website. A complex guide to building a website through continuing the fundamentals of HTML & CSS. Created by Michael Parekh 1

The xparse package Document command parser

The l3galley package Galley code

The crush package. Jesse A. Tov This document corresponds to crush v0.2, dated 2011/07/29.

Loops / Repetition Statements. There are three loop constructs in C. Example 2: Grade of several students. Example 1: Fixing Bad Keyboard Input

TUGboat, Volume 22 (2001), No. 1/2 87

SmartLCD. Programmer s Guide and Application Notes

The dashrule package

Report Composer Version 6.0. What's New

Assoc. Prof. Dr. Marenglen Biba. (C) 2010 Pearson Education, Inc. All rights reserved.

Honu. Version November 6, 2010

Introduction to Programming in C Department of Computer Science and Engineering. Lecture No. #16 Loops: Matrix Using Nested for Loop

The widetable package

LATEX. Leslie Lamport. Digital Equipment Corporation. Illustrations by Duane Bibby. v ADDISON-WESLEY

Wiki markup is a core feature for Topic pages, tightly integrating all the other parts of Trac into a flexible and powerful whole.

Basic Computer Programming (Processing)

Functions. Lecture 6 COP 3014 Spring February 11, 2018

Transcription:

The nccfloats package Alexander I. Rozhenko rozhenko@oapmg.sscc.ru 2006/01/07 The standard L A TEX floating environments, namely figure and table, allow user to place floating material in a document. But they do not introduce a style in which this material must be formatted. In this package, styles are joined with floats and mini-floats are introduced. Mini-floats are prepared at a mini-page and allow captions within. Basing on mini-floats, a number of service commands for figures and tables are defined. The ability to create other types of mini-floats is introduced with the \newminifloat command. Contents 1 Basic Commands 1 2 Side Figures and Tables 2 3 Floating Figures and Tables 4 4 Two Floating Figures or Tables Side by Side 4 5 Declare a Mini-float and Service Commands 5 6 The Implementation 5 6.1 Float Style............................... 5 6.2 The Kernel............................... 6 6.3 Side Floats............................... 7 6.4 Service Commands........................... 9 6.5 Declare a New Mini-float and Service Commands.......... 10 6.6 Base Mini-floats and Defaults..................... 11 1 Basic Commands \FloatStyle The \FloatStyle[ type ]{ style } command sets a style for the float of the given type. If the type is omitted, the default style is specified. It will be applied to This file has version number v1.2, last revised 2006/01/07. 1

a float or mini-float if no specialized style was defined. This command is available in the preamble only. To specify the style of a mini-float and of service commands based on it, add the mini prefix to the float type. The default styles are \FloatStyle{} \FloatStyle[minifigure]{\footnotesize\centering} \FloatStyle[minitable]{\footnotesize\centering} \normalfloatstyle \minifig \minitabl This means that the formatting of floats prepared with standard figure and table environments does not changed, but service commands based on mini-figures and mini-tables use a special formatting with \footnotesize font and the centered alignment. This command is applied inside floats or mini-floats to reset formatting style of subsequent floating material to the standard formatting with paragraph alignment and the normal font of normal size. We start with the basic commands, namely \minifig and \minitabl. They prepare a material in a mini-page and allow using the \caption command in the body. Their syntax is similar to the \parbox command: \minifig [ pos ][ height ][ inner-pos ]{ width }{ body } \minitabl[ pos ][ height ][ inner-pos ]{ width }{ body } The pos is a vertical alignment parameter for mini-page (t, b, or c) with respect to surrounding text; the height is a mini-page height required; the inner-pos is a vertical alignment of text inside the mini-page (t, b, c, or s); and the width is the mini-page width. The body is prepared in the style specified by the \FloatingStyle command and can contain the \caption command inside. All other floating extension commands are based on these two commands. 2 Side Figures and Tables \sidefig \sidetabl For small figures and tables, it is preferable to insert them inside a text instead of using floating mechanism. The typographic rules usually require an illustrative material to occupy an outer side of page. In two-side mode, this means figure and tables should be on the right side if a page number is odd and on the left side if page number is even. In one-side mode, figures and tables must occupy the right side of page. The following commands support such a placement: \sidefig[ pos ](w 1 )(w 2 ){ figure }{ text } \sidefig*[ pos ](w 1 )(w 2 ){ figure }{ text } \sidetabl[ pos ](w 1 )(w 2 ){ table }{ text } \sidetabl*[ pos ](w 1 )(w 2 ){ table }{ text } We use the term mini-float for the small illustrating material (figure or table), however taking into account that it is not a float at all. It is inserted in the main 2

flow next to a paragraph box specified in the last parameter of above described commands. The no-star forms of above described commands place a mini-float next to the specified text on the outer side of page (to the right for odd page and to the left for even page). In two-column or one-side mode, mini-float is always posed to the right. The star-forms provide the reverse placement. By default, mini-float is vertically centered with respect to the text and the \strut command is inserted at the beginning and at the end of the text to provide normal baseline distances of the first and last lines of the text from surrounding text lines. All parameters in square and round brackets are optional and mean the following: pos specifies mini-float alignment (t, b, or c; default is c) with respect to text box and can contain additional chars controlling the text body preparation: j means the last line of the text to be justified to the right and n means suppressing of struts insertion (they should be inserted manually if necessary); w 1 w 2 is the width of mini-float; and is the width of the text box. You can omit units in the width parameters. In this case, the width value is considered as a multiple of \unitlength (similarly to the use of length dimensions in the picture environment). If both width parameters are absent, the width of both mini-float and text body is calculated as (\linewidth-1.5em)/2. If w 2 is absent, the text body width is calculated as \linewidth-w 1-1.5em. The placement of side-floats in the document consists in the following steps: 1. Decide where you want to insert a side-float; 2. Insert a \sidefig or \sidetabl command after a word that finishes the line before the supposed side-float position; 3. Specify a width of float in its parameter and set the top alignment as the pos parameter (e.g. \sidefig[t](w 1 )); 4. Prepare the side-float in the first mandatory parameter of the command (e.g. \sidefig[t](w 1 ){ figure }); 5. Enclose enough text going after the command in braces; 6. Translate the document; 7. Find what part of the text is redundant in the text parameter; 8. Move it after the close brace; 3

9. If the same paragraph continues after the close brace, add the j letter to the pos parameter. Also change the t alignment to c alignment in the pos parameter; 10. Translate the document once more; 11. If the side-float has a wrong placement (this can appear when paragraph with a side-float begins at the end of page), insert the star after the sidefloat command and translate the document once more. \ifleftsidefloat While preparing a side-float, it is sometimes necessary to provide conditional placement depending on the side a mini-float is posed. \ifleftsidefloat{ left-clause }{ right-clause } provides this. It is useful in parameters of \sidefig or \sidetabl and processes left-clause if the mini-float is posed to the left and right-clause otherwise. Side-floats can be also used within floating environments to pos a caption near a figure or table. 3 Floating Figures and Tables \fig \tabl The following commands envelop floating environments: \fig[ placement ](w){ body } \fig*[ placement ](w){ body } \tabl[ placement ](w){ body } \tabl*[ placement ](w){ body } The placement is a float placement parameter describing places where a float can appear. The default value is ht (here or at the top of page). The optional w parameter defines a width of box occupied by the float (the width of nested \minifig or \minitabl). If it is omitted, the float has the maximum width equal to the \linewidth. The \fig and \tabl commands envelop the figure and table environments respectively. Their star-forms envelop figure* or table* environments respectively. 4 Two Floating Figures or Tables Side by Side \figs \tabls The following commands place two figures or tables side by side. \figs[ placement ](w 1 )(w 2 ){ body1 }{ body2 } \figs*[ placement ](w 1 )(w 2 ){ body1 }{ body2 } \tabls[ placement ](w 1 )(w 2 ){ body1 }{ body2 } \tabls*[ placement ](w 1 )(w 2 ){ body1 }{ body2 } 4

The body1 is a body of the left figure or table and the body2 is a body of the right figure or table. Other parameters are optional. The meaning and default value of the placement parameter is the same as described above. The w 1 and w 2 parameters are widths of left and right boxes. If they both are omitted, the left and right boxes will have the width equal to (\linewidth-1em)/2. If w 2 is omitted, the right box will occupy the rest of horizontal space minus 1em. If both parameters are specified, the rest space is inserted between boxes. If the total width of left and right floats exceeds the \linewidth, the floats will overlap at the middle (a negative horizontal space is inserted between them). In the \tabls command, boxes of the left and right bodies are top-aligned, but, in the \figs command, the bottom alignment is used. The star-forms of this commands are based on the figure* or table* environments respectively. 5 Declare a Mini-float and Service Commands \newminifloat If a new type of float is introduced, the respective mini-float and service commands can be helpful for it. To prepare them, use the following declaration: \newminifloat{ gen }{ type }{ placement }{ pos } Here gen is a root for command names to be generated, type is a float type, placement is a default placement on the page, and pos is a vertical alignment for pair of floats. This command declares 4 commands: \mini gen, \side gen, \ gen, and \ gen s. For example, the commands described in previous sections are declared as follows: \newminifloat{fig}{figure}{ht}{b} \newminifloat{tabl}{table}{ht}{t} 6 The Implementation The package uses some commands of the nccboxes package. Load it here: 1 package 2 \RequirePackage{nccboxes}[2002/03/20] \FloatStyle \NCC@setfltstyle 6.1 Float Style \FloatStyle[ type ]{ style } specifies a style for a given float type. 3 \newcommand*{\floatstyle}[2][]{% 4 \expandafter\def\csname NCC@fltstyle@#1\endcsname{#2}} 5 \@onlypreamble\floatstyle \NCC@setfltstyle{ prefix } applies a style for a float of \@captype type. While selection a style to be applied it adds the given prefix to the float type. 6 \def\ncc@setfltstyle#1{% 5

7 \edef\@tempa{ncc@fltstyle@#1\@captype}% 8 \@ifundefined{\@tempa}{\ncc@fltstyle@}{\csname\@tempa\endcsname}% 9 } We add this style with empty prefix to the \@floatboxreset hook which is applied at the end of preamble of a float. 10 \g@addto@macro\@floatboxreset{\ncc@setfltstyle{}} \normalfloatstyle Reset a float style to par-box formatting with normal font of the normal size. 11 \newcommand\normalfloatstyle{% 12 \leftskip\z@skip \rightskip\z@skip \@rightskip\z@skip 13 \parfillskip\@flushglue \let\\\@normalcr 14 \reset@font \normalsize 15 } 6.2 The Kernel \NCC@minifloat The base for mini-floats \NCC@minifloat[ pos ][ height ][ inner-pos ]{ width }{ body } It finishes a mini-float with extra \endgroup command. A \@captype should be specified before it. 16 \newcommand*\ncc@minifloat[1][c]{% 17 \@ifnextchar[{\ncc@mflt{#1}}{\ncc@@mflt{#1}\relax[s]}} 18 \def\ncc@mflt#1[#2]{% 19 \@ifnextchar[{\ncc@@mflt{#1}{#2}}{\ncc@mflt{#1}{#2}[#1]}} 20 \long\def\ncc@@mflt#1#2[#3]#4#5{% 21 \@iiiminipage{#1}{#2}[#3]{#4}\normalfloatstyle 22 \NCC@setfltstyle{mini}#5\endminipage\endgroup 23 } \NCC@pair \NCC@pair{ c1 }{ c2 }{ def-dist }{ def-place }*[ place ](w 1 )(w 2 ) executes c1 { place }{w 1 }{w 2 } if star is absent or c2 { place }{w 1 }{w 2 } if star presents. Four first parameters are mandatory. Others a optional. The def-dist parameter contains a default distance value. It is saved in the \@tempdimc register. The def-place parameter contains the default value for the place parameter. If the last one is omitted, the def-place is used instead. 24 \def\ncc@pair#1#2#3#4{\setlength\@tempdimc{#3}% 25 \@ifstar{\ncc@pair@{#2}{#4}}{\ncc@pair@{#1}{#4}}} 26 \def\ncc@pair@#1#2{\@ifnextchar[{\ncc@pair@@{#1}}{\ncc@pair@@{#1}[#2]}} 27 \def\ncc@pair@@#1[#2]{\def\@tempa{#1{#2}}% 28 \@ifnextchar({\ncc@pair@@@}{\ncc@@pair()()}} 29 \def\ncc@pair@@@(#1){\@ifnextchar({\ncc@@pair(#1)}{\ncc@@pair(#1)()}} 30 \def\ncc@@pair(#1)(#2){\@tempa{#1}{#2}} 6

\NCC@setwidth \NCC@wcalc The \NCC@setwidth{ register }{ width } command sets the given width for the register. If units in width are omitted, the \unitlength unit is used. In other words, if width is a real number, it is considered as a multiple of \unitlength. 31 \def\ncc@setwidth#1#2{\@defaultunits#1#2\unitlength\relax\@nnil} The \NCC@wcalc{w 1 }{w 2 } calculates widths of left and right boxes in the \@tempdima and \@tempdimb registers. The distance between boxes must be specified in \@tempdimc register before the call. The algorithm: If w 1 is empty, \@tempdima:=(\linewidth-\@tempdimc)/2, otherwise, \@tempdima:=w 1 ; If w 2 is empty, \@tempdimb:=\linewidth-\@tempdima-\@tempdimc, otherwise, \@tempdimb:=w 2 ; If w 2 is nonempty, \@tempdimc:=\linewidth-\@tempdima-\@tempdimb. 32 \def\ncc@wcalc#1#2{% 33 \if!#1!\@tempdima.5\linewidth \advance\@tempdima -.5\@tempdimc 34 \else \NCC@setwidth\@tempdima{#1}% 35 \fi 36 \if!#2!\@tempdimb \linewidth \advance\@tempdimb -\@tempdima 37 \advance\@tempdimb -\@tempdimc 38 \else \NCC@setwidth\@tempdimb{#2}% 39 \@tempdimc \linewidth \advance\@tempdimc -\@tempdima 40 \advance\@tempdimc -\@tempdimb 41 \fi 42 } \ifleftsidefloat \NCC@sidemfloat 6.3 Side Floats This command is used in parameters of side-floats. 43 \newif\ifncc@smfltleft 44 \newcommand{\ifleftsidefloat}{% 45 \ifncc@smfltleft 46 \expandafter\@firstoftwo 47 \else 48 \expandafter\@secondoftwo 49 \fi 50 } \NCC@sidemfloat{ command }*[ pos ](w 1 )(w 2 ){ mini-float }{ text } is used for preparing a side-float. The command parameter contains a \mini gen command. The pos parameter specifies vertical alignment and additional flags. The w 1 and w 2 parameters (if present) specify widthes of mini-float and text boxes. Starred version reverses the position of side-float and text boxes. 7

The implementation of these commands is based on the \NCC@pair command that parses all optional parameters. Finally the \NCC@smflt command is executed. 51 \def\ncc@sidemfloat#1{% 52 \NCC@smfltleftfalse 53 \if@twocolumn \else 54 \if@twoside 55 \ifodd\c@page \else \NCC@smfltlefttrue \fi 56 \fi 57 \fi 58 \NCC@pair{\NCC@smflt{#1}}% 59 {\ifncc@smfltleft \NCC@smfltleftfalse \else \NCC@smfltlefttrue\fi 60 \NCC@smflt{#1}}% 61 {1.5em}{}% 62 } \NCC@smflt \NCC@smflt{ command }{ pos }{w 1 }{w 2 }{ mini-float }{ text } prepares a side-float. The \@tempdimc register contains the default distance between the mini-float and text. 63 \long\def\ncc@smflt#1#2#3#4#5#6{% Parse the pos parameter. Create a \NCC@ letter command with empty content for every letter from the pos. 64 \let\ncc@t\relax \let\ncc@b\relax \let\ncc@j\relax \let\ncc@n\strut 65 \@tfor\@tempa :=#2\do {% 66 \expandafter\let\csname NCC@\@tempa\endcsname\@empty}% Define the vertical alignment letter in the \NCC@c command. 67 \ifx\ncc@t\@empty \def\ncc@c{t}\else 68 \ifx\ncc@b\@empty \def\ncc@c{b}\else 69 \def\ncc@c{c}% 70 \fi 71 \fi Define a justification hook in the \NCC@j command. 72 \ifx\ncc@j\@empty \def\ncc@j{\parfillskip\z@skip}\fi Define the text starting hook in the \NCC@t command. It will contain the \parindent setting command and the optional \noindent command. 73 \edef\ncc@t{\parindent\the\parindent\ifvmode\else\noindent\fi}% Complete the current paragraph and leave the horizontal mode. 74 \ifvmode\else 75 \unskip{\parfillskip\rightskip\par}\vskip -\parskip 76 \fi Prepare the side-float in \@tempboxa: 77 \setbox\@tempboxa\vbox{\hsize\linewidth\noindent 8

Calculate widthes of left and right boxes and distance between them in \@tempdima, \@tempdimb, and \@tempdimc. 78 \NCC@wcalc{#3}{#4}% Conditionally put a side-float to the left: 79 \ifncc@smfltleft 80 \jparbox{\strut}[\ncc@c]\@tempdima{#1\@tempdima{#5}}% 81 \nobreak\hskip\@tempdimc 82 \fi Put a text box: 83 \jparbox{\ncc@n\strut}[\ncc@c]\@tempdimb{% 84 \everypar{\ncc@n\everypar{}}\ncc@t#6% 85 \ifvmode \else \unskip\ncc@n\ncc@j\fi}% Conditionally put a side-float to the right: 86 \ifncc@smfltleft \else 87 \nobreak\hskip\@tempdimc 88 \jparbox{\strut}[\ncc@c]\@tempdima{#1\@tempdima{#5}}% 89 \fi 90 }% Games with height and depth the \@temboxa allow us produce right line spacing with surrounding text. 91 \@tempdima\dp\@tempboxa \advance\@tempdima\lineskip 92 \dp\@tempboxa\@tempdima 93 \@tempdima\ht\@tempboxa \advance\@tempdima -\ht\strutbox 94 \noindent \raise-\@tempdima\box\@tempboxa 95 } 6.4 Service Commands \NCC@float \NCC@float{ type }{ def-place }*[ placement ](w){ body } is the envelope for a mini-float inside a float. The def-place is the default placement specifier. 96 \def\ncc@float#1#2{\@ifstar{\ncc@flt{#1*}{#2}}{\ncc@flt{#1}{#2}}} 97 \def\ncc@flt#1#2{\@ifnextchar[{\ncc@flt@{#1}}{\ncc@flt@{#1}[#2]}} 98 \def\ncc@flt@#1[#2]{\begin{#1}[#2]\normalfloatstyle\centering 99 \@ifnextchar({\ncc@@flt{#1}}{\ncc@@flt{#1}()}} 100 \long\def\ncc@@flt#1(#2)#3{% 101 \if!#2!\@tempdima\linewidth \else \NCC@setwidth\@tempdima{#2}\fi 102 \begingroup\ncc@minifloat[c]\@tempdima{#3}% 103 \end{#1}% 104 } \NCC@floats \NCC@floats{ type }{ pos }{ def-place }*[ placement ](w 1 )(w 2 ) { body1 }{ body2 } 9

\NCC@flts \newminifloat is the envelope for a pair of mini-floats inside a float. The implementation of these commands is based on the \NCC@pair command that parses all optional parameters. Finally the \NCC@flts command is executed. 105 \def\ncc@floats#1#2#3{% 106 \NCC@pair{\NCC@@flts{#1}{#2}}{\NCC@@flts{#1*}{#2}}{1em}{#3}} \NCC@flts{ type }{ pos }{ placement }{w 1 }{w 2 }{ body1 }{ body2 } prepares a pair of floats within type environment. The pos contains relative vertical alignment of floats. The w 1 and w 2 parameters (if present) specify widthes of floats. The \@tempdimc register contains the default distance between floats. 107 \long\def\ncc@@flts#1#2#3#4#5#6#7{% 108 \begin{#1}[#3]\normalfloatstyle\ncc@wcalc{#4}{#5}% 109 \begingroup\ncc@minifloat[#2]\@tempdima{#6}% 110 \nobreak\hskip\@tempdimc 111 \begingroup\ncc@minifloat[#2]\@tempdimb{#7}% 112 \end{#1}% 113 } 6.5 Declare a New Mini-float and Service Commands \newminifloat{ gen }{ type }{ def-place }{ pos } declares a new mini-float and 3 service commands. 114 \newcommand*\newminifloat[4]{% 115 \edef\@tempa{% Prepare \mini gen definition: 116 \noexpand\newcommand\expandafter\noexpand\csname mini#1\endcsname{% 117 \noexpand\begingroup\noexpand\def\noexpand\@captype{#2}% 118 \noexpand\ncc@minifloat}% Prepare \side gen definition: 119 \noexpand\newcommand\expandafter\noexpand\csname side#1\endcsname{% 120 \noexpand\ncc@sidemfloat{% 121 \expandafter\noexpand\csname mini#1\endcsname}}% Prepare \ gen definition: 122 \noexpand\newcommand\expandafter\noexpand\csname #1\endcsname{% 123 \noexpand\ncc@float{#2}{#3}}% Prepare \ gen s definition: 124 \noexpand\newcommand\expandafter\noexpand\csname #1s\endcsname{% 125 \noexpand\ncc@floats{#2}{#4}{#3}}% 126 }% Define all commands: 127 \@tempa 128 } 129 \@onlypreamble\newminifloat 10

6.6 Base Mini-floats and Defaults 130 \newminifloat{fig}{figure}{ht}{b} 131 \newminifloat{tabl}{table}{ht}{t} 132 \FloatStyle{} 133 \FloatStyle[minifigure]{\footnotesize\centering} 134 \FloatStyle[minitable]{\footnotesize\centering} 135 /package 11