\documentclass{article} \usepackage{xoutput} \usepackage{xo-grid} \usepackage{graphicx} \usepackage{trace} %\showoutput %\tracingpages=1 %\tracingonline=1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % PLAY AROUND WITH MANUAL FLOAT CONTROL % % \savefloatplacements writes the file \jobname.fpl % \readfloatplacements reads in \jobname.fpc % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %\savefloatplacements %\readfloatplacements %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % DECLARING FLOAT TYPES % % \DeclareFloatSequenceClass currently needed for each name used in % the sequence-class-id key (will vanish) % % \DeclareFloatType defines type % % Example below is a bit strange: all floats are in one % sequence class and share the same numbering but go in different tocs % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \DeclareFloatSequenceClass{figure} \DeclareFloatSequenceClass{tabalg} % tables and algorithms \DeclareFloatType{figure} { sequence-class-id = figure, toc-extension = lof, caption-text = \figurename, numbered-boolean = true, numbered-id = figure, numbered-within-id = section, numbered-action = \thesection.\arabic{figure}, body-decls = \footnotesize, } \DeclareFloatType{table} { sequence-class-id = tabalg, toc-extension = lot, caption-text = \tablename, numbered-boolean = true, numbered-id = table, numbered-within-id = section, numbered-action = \thesection.\arabic{table}, body-decls = \footnotesize, } \DeclareFloatType{algorithms} { sequence-class-id = tabalg, toc-extension = lot, caption-text = Algorithm, numbered-boolean = true, numbered-id = table, body-decls = \footnotesize, } \makeatletter \newcommand*\l@algorithms{\@dottedtocline{1}{1.5em}{2.3em}} \makeatother \renewcommand\listtablename{List of Tables and Algorithms} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % DECLARING FLOAT AREAS % % \DeclareFloatArea defines a float area (which can be referenced in % pagesetup2 instances below) % % Ensure that partial overlapping areas close each other! % % The example is for three columns. % % Actually, don't try to use additional float areas unless you update % the currently hardwired \top@areas and \bot@areas lists (in xo-new) % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % spanning all three columns \DeclareFloatArea {t13} { class-close-list = , all-close-list = {b13}, % don't want top and bottom floats max-float-num = 2, } \DeclareFloatArea {b13} { class-close-list = {t13,t12,t11,b11}, all-close-list = , max-float-num = 1, } % spanning two columns \DeclareFloatArea{t12} { class-close-list = , all-close-list = {t22}, % this is a must! partial span max-float-num = 1, } \DeclareFloatArea{t22} { class-close-list = {t11,b11}, % b12 still open all-close-list = {t12}, max-float-num = 1, } \DeclareFloatArea{b12} { class-close-list = {t11,b11}, all-close-list = {}, max-float-num = 1, } % this strange design doesn't have b22 % single columns \DeclareFloatArea {t11} { class-close-list = , all-close-list = , max-float-num = 2, } \DeclareFloatArea {b11} { class-close-list = {t11}, all-close-list = , max-float-num = 1, } \DeclareFloatArea {t21} { class-close-list = {t11,b11}, all-close-list = {t22}, % don't ask me why just to make a % change :-) max-float-num = 2, } \DeclareFloatArea {b21} { class-close-list = {t11,b11,t21}, all-close-list = , max-float-num = 1, } \DeclareFloatArea {t31} { class-close-list = {t11,b11,t21,b21}, all-close-list = {t22}, % we don't like this one max-float-num = 2, } \DeclareFloatArea {b31} { class-close-list = {t11,b11,t21,b21,t31,t22}, all-close-list = , max-float-num = 1, } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % DECLARING CAPTION ATTACHMENTS % % The buildfloat templates aren't yet real templates, i.e., nearly % everything is fixed with them. The only key they offer is the % distance between float body and caption. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \DeclareInstance{buildfloat}{default}{centeredabove} { body-caption-sep = 10pt, } \DeclareInstance{buildfloat}{figure}{centeredbelow} { body-caption-sep = 10pt, } % with bottomright the body-caption-sep key is the horizontal % separation \DeclareInstance{buildfloat}{t31}{bottomright} { body-caption-sep = 24pt, } \DeclareInstance{buildfloat}{t22}{bottomright} { body-caption-sep = 24pt, } \DeclareInstance{buildfloat}{t13}{bottomright} { body-caption-sep = 24pt, } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % DECLARING FOOTNOTE HANDLING % % The situation with footnotesetup is even worse, there are no usable % keys yet. But three different ``pseudo'' templates: std, ftnright, % and margin. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \DeclareInstance{footnotesetup}{mainmatterstyle}{margin}{} %\DeclareInstance{footnotesetup}{mainmatterstyle}{std}{} %\DeclareInstance{footnotesetup}{mainmatterstyle}{ftnright}{} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % DECLARING PAGE LAYOUT % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \raggedbottom \setlength\topskip{12pt} % for grid layout make this = \baselineskip % there is some bug which will otherwise show up \ShowGridtrue % show the grid \ShowGridfalse \DeclareInstance{pagesetup2}{normal}{std}{ %%%%%%%%%%%%%%%%%%%%%% % setting up columns: % column-num = 3, column-width = 156pt, column-sep = 25pt, column-height = 552pt, %%%%%%%%%%%%%%%%%%%%%% % constraining the float placement: % float-callout-constraint = after, bottom-float-footnote-constraint = forbidden, flush-float-callout-constraint = column, max-float-num =10, %%%%%%%%%%%%%%%%%%%%%% % list should pick from the above: % area-list = {t13,t12,t22,t11,b12,b11,t21,b21,t31,b31}, %%%%%%%%%%%%%%%%%%%%%% % footnote placement: % footnote-setup = mainmatterstyle, % % or inline: % % footnote-setup = \UseTemplate{footnotesetup}{std}{}, % %%%%%%%%%%%%%%%%%%%%%% % float area placement: % float-float-sep = 15pt, float-text-sep = 30pt minus 8pt, float-area-sep = 15pt, float-inline-sep = 6pt minus 2pt, %%%%%%%%%%%%%%%%%%%%%% % grid points? grid-point-sep = 12pt, } \DeclareInstance{pagesetup2}{frontmatter}{std}{ %%%%%%%%%%%%%%%%%%%%%% % setting up columns: % column-num = 2, column-width = 237.5pt, column-sep = 25pt, column-height = 552pt + 12pt, %%%%%%%%%%%%%%%%%%%%%% % constraining the float placement: % float-callout-constraint = after, bottom-float-footnote-constraint = forbidden, max-float-num =0, %%%%%%%%%%%%%%%%%%%%%% % list should pick from the above: % area-list = {}, %%%%%%%%%%%%%%%%%%%%%% % footnote placement: % footnote-setup = mainmatterstyle, %%%%%%%%%%%%%%%%%%%%%% % float area placement: % float-float-sep = 15pt, float-text-sep = 30pt minus 8pt, float-area-sep = 15pt, float-inline-sep = 6pt minus 2pt, %%%%%%%%%%%%%%%%%%%%%% % grid points? grid-point-sep = 12pt, } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Stuff for producing test pages %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newcount\bc \newcommand\startpar{\par\global\advance\bc1 [\the\bc] } \newcommand\dofigure[1]{\startpar callout (#1) to a figure. \aa\footnote{A footnote near callout #1.} \par \begin{figure} \ifcase\value{figure}\relax \or \includegraphics[angle=180,width=.7\columnwidth]{rahtz18.eps} \or \includegraphics[angle=90,width=.7\columnwidth]{rahtz18.eps} \or \includegraphics[angle=180,totalheight=4\baselineskip]{escher.eps} \or \includegraphics [width=.9\columnwidth]{rahtz18.eps} \else \ifodd\value{figure}\relax \includegraphics[totalheight=4\baselineskip]{escher.eps} \else \includegraphics[angle=180,totalheight=4\baselineskip]{escher.eps} \fi \fi \caption{Belongs to callout (#1)}\label{mylab:fig#1} \end{figure} } \newcommand\dospanfigure[3]{% \startpar callout (#3) to a figure. \aa\footnote{A footnote near callout #3.} \par \def\SPANCNT{#1} \begin{figure}[#2] \ifodd\value{figure}\relax \ifodd\value{page}\relax \includegraphics[width=#1\columnwidth]{outline.eps} \else \ifnum #1=3\relax \includegraphics [totalheight=4\baselineskip,width=2.5\columnwidth]{rahtz18.eps} \else \includegraphics [totalheight=4\baselineskip,width=1.5\columnwidth]{rahtz18.eps} \fi \fi \else \ifodd\value{page}\relax \includegraphics[width=1.3\columnwidth]{cat.eps} \else \includegraphics[width=#1\columnwidth]{outline2.eps} \fi \fi \caption{Belongs to callout (#3)}\label{mylab:fig#3} \end{figure}\par \def\SPANCNT{} } \newcommand\doalg[1]{\startpar callout (#1) to an algorithm.% \begin{algorithms} \caption{Belongs to (#1)} \ifnum #1<20\relax \includegraphics[totalheight=#1\baselineskip]{cat.eps} \else \includegraphics[totalheight=20\baselineskip]{cat.eps} \fi \end{algorithms}\par} \newcommand\dotable[1]{\par \par \global\advance\bc1 [\the\bc] callout (#1) to a table. \aa \par \begin{table} \caption{Belongs to callout (#1)}\label{mylab:tab#1} \includegraphics[width=\columnwidth]{europe.eps} \end{table} } \newcommand\bb{\startpar \aa\aa\aa \par} \newcommand\sample{% Infandum, re\-gi\-na, iu\-b\-es re\-no\-va\-re do\-lo\-rem, Troi\-a\-n\-as ut op\-es et la\-men\-ta\-bile re\-g\-num cru\-e\-rint Da\-nai; qua\-e\-que ip\-se mis\-er\-ri\-ma vi\-di, et qu\-o\-rum pa\-rs ma\-g\-na fui.} \newcommand\smallsample{% Infandum, re\-gi\-na, iubes renovare do\-lo\-rem, Troi\-a\-n\-as ut opes et la\-men\-ta\-bile regnum cru\-e\-rint Da\-nai; qua\-e\-que \ldots} \renewcommand\aa{\space\sample} \begin{document} \UseInstance{pagesetup2}{frontmatter} \listoffigures \columnbreak \listoftables \vfil Note the strange ordering above due to the way the areas are visually ordered---sorting isn't yet implemented. \UseInstance{pagesetup2}{normal} % \section{First section} \begin{figure}[t21] \frame{\parbox{\columnwidth}{ figure forced into t21 figure forced into t21 }} \caption{A special one} \end{figure} \dofigure2 \dofigure3 \dospanfigure{3}{t13}{4} \dofigure5 \dofigure6 \dospanfigure{3}{t13}{7} \dofigure8 \dofigure9 \doalg{10} \doalg{11} \doalg{12} \doalg{13} \doalg{14} \doalg{15} \doalg{16} \doalg{17} \doalg{18} \dofigure{19} \dofigure{20} \dospanfigure{2}{b12}{21} \dofigure{22} \dofigure{23} \dofigure{24} \dofigure{25} \flushfloats % this could be part of \section setup one day \section{Another section} \dofigure{26} \dofigure{27} \dofigure{28} \dofigure{29} \dofigure{30} \dofigure{31} \bb \bb \dotable{32} \dotable{33} \dotable{34} \dofigure{35} \dofigure{36} \bb\bb \bb \dospanfigure{2}{t22}{37} \dospanfigure{2}{b12}{38} \dospanfigure{2}{t12}{39} \dotable{40} \dofigure{41} \bb \bb \dofigure{42} \dospanfigure{2}{t12}{43} \bb \bb \bb \bb \bb \bb \dospanfigure{2}{t32}{44} %AREA DOES NOT EXIST! \dofigure{45} \bb\bb\bb\bb \dotable{46} \bb\bb\bb\bb\bb\bb\bb\bb\bb\bb\bb\bb\bb\bb\bb\bb \doalg{47} \bb\bb\bb\bb\bb\bb\bb\bb\bb \bb\bb\bb\bb\bb\bb\bb\bb\bb\bb\bb THE END % just to make sure we don't lose text \end{document}