TransWikia.com

Using coffin class to set-up page geometry

TeX - LaTeX Asked on March 13, 2021

I have a specific page geometry that I would like to create for my odd pages using the coffin class. I have been playing around with it, but I am not understanding the documentation for connecting coffins together. Any help would be great!

Why is my odd page text not staying on the first page?

edited MWE:

documentclass[10pt]{article}   
usepackage{xcoffins}
usepackage{graphicx}
usepackage{calc}
usepackage{xcolor}

usepackage{ifthen,changepage}
usepackage{nopageno} % supress page number

usepackage[papersize={8in,8in}, top=1in, textwidth=6in, marginratio=1:1 ]{geometry}
usepackage{atbegshi}

AtBeginShipout{AtBeginShipoutAddToBox{%  shipout even and odd pages title and figures
            checkoddpage
        ifthenelse{boolean{oddpage}}{TypesetCoffinFrameOx}{TypesetCoffinFrameEx}}
    }

NewCoffinFrameOx
NewCoffinFrameOddx
NewCoffinFigRT
NewCoffinFigRM
NewCoffinFigL
NewCoffinFigM
NewCoffinFigR

NewCoffinFrameEx
NewCoffinFrameEvenx

%%%%%%%%%   set figures width/height  plus height of text area
newlength{imageLMR}
setlength{imageLMR}{1in} % height and width of the figures, max =2in <<<<<<<<<<<<
newlength{imageRM}
setlength{imageRM}{1.5in}
newlength{imageRT}
setlength{imageRT}{2.5in}

newlength{textH}
setlength{textH}{6in} % height of text area, min =3imageW  <<<<<<<<<<<<
%%%%%%%%%%%%%

begin{document}
    setlength{parindent}{0pt}

SetVerticalCoffinFrameOddx{textH}{color{green!10}rule{textH}{textH}}

SetVerticalCoffinFigRT{imageRT}{% top right
    fbox{includegraphics[height=imageRT,width=imageRT]{01}}
}

SetVerticalCoffinFigRM{2.8in}{% middle right
    fbox{includegraphics[height=imageRM,width=2.8in]{3-1}}
}

SetVerticalCoffinFigL{imageLMR}{% leftmost bottom
    fbox{includegraphics[height=imageLMR,width=imageLMR]{1aries}}
}

SetVerticalCoffinFigM{imageLMR}{% midmost bottom
    fbox{includegraphics[height=imageLMR,width=imageLMR]{Ctetrahedron}}
}

SetVerticalCoffinFigR{imageLMR}{% rightmost bottom
    fbox{includegraphics[height=imageLMR,width=imageLMR]{1aries}}
}

%%%%**************** V gap in figures
newlength{Vgap}
setlength{Vgap}{(textH -imageLMR-imageRM-imageRT)/2}

%%%%%%********************* assembly of odd pages

JoinCoffinsFrameOddx[r,t]FigRT[r,t]% top right
JoinCoffins*FrameOddx[r,t]FigRM[r,t](0pt,-imageRT-Vgap)

JoinCoffins*FrameOddx[r,b]FigR[r,b] %bottom row
JoinCoffins*FrameOddx[FigR-l,FigR-b]FigM[r,b]
JoinCoffins*FrameOddx[FigM-l,FigM-b]FigL[r,b]

JoinCoffins*FrameOx[l,t]FrameOddx[l,t]

%%%%************************

    
SetVerticalCoffinFrameEvenx{textwidth}{color{white}rule{textwidth}{textH}}

newlength{Hoffset}
setlength{Hoffset}{oddsidemargin}


% *************** even pages
%JoinCoffins*FrameEvenx[hc, t]Lyricx[hc,b](0pt,baselineskip)
JoinCoffins*FrameEx[hc,vc]FrameEvenx[l,t](Hoffset,-baselineskip)   
%*********************************************  
    
hspace{2ex} % H offset
begin{minipage}{3in-5ex}
sffamily{huge I. Fireyes}  textit{Full of light; Reveal the way.}

vspace{0.15cm}

{footnotesizetextbf{Mercenarium Function:} When you sing I. Fireyes, you may choose and discard any number of cards from your hand (you do not have to discard any if you do not wish to). After this, draw cards from the deck until you are holding the maximum of (5) non-hymn cards.}

vspace{0.15cm}

{footnotesize If this hymn causes a player to draw the last card in the deck before they are holding (5) non-hymn cards, the game enters singularity (meaning that the deck, hymnal, and discard pile are shuffled together, see textcolor{red}{“Singularity” p. xx}) and the player then continues to draw from the singularity deck until they are holding 5 cards. After singing this hymn, discard it.}

vspace{0.15cm}

{footnotesize If the game enters singularity for any other reason, the effect of I. Fireyes becomes “Draw (5) cards.”}
end{minipage}

newpage

begin{minipage}{3in-5ex}
{footnotesizetextbf{Dragonfruit Meanings:}
textbf{Authority} / Charge, Attraction, Influence / Patience}

vspace{0.15cm}

{footnotesize Fireyes represents the gathering of energy before great movement; the act of preparation, of planning, or of cultivating the skills and resources needed to affect meaningful change in the world. It represents leadership and asks us to reflect on the true nature of power; as well as the responsibility of action that comes to those who have cultivated themselves (to have authority is to have both power and duty). It describes the tendency for power to accumulate: As resources and respect build, so too the creative capacities of its sovereignty. Its alteration suggests that the way to cultivate authority is through patience – though taking the time to wait, to learn, and to listen.}

vspace{0.15cm}

{footnotesize textbf{Aces} are textbf{LEADERS}: “The Adept” archetype; Individuals with material power and sources of inspiration or resentment in those around them. Their influence allows them to affect the world in good and bad ways even through small actions. Their powers are amplified by technology, represented in their illustrations as legendary artifacts.}
end{minipage}

newpage

hspace{8ex} % H offset
vspace*{fill}
begin{center}
    begin{minipage}{textwidth-16ex}
          centering
    {huge textbf{Lyrics}}

        vspace{1cm}

textit{Foreign melodies, who is telling these}
textit{animated, complicated fugues?}
textit{Form a symphony, out of your sympathies,}
textit{if you'd please tell us what we should do.}

vspace{0.5cm}

textit{Hidden in the deepest forest,}
textit{there's a quiet, constant chorus,}
textit{led by men, with eyes, of fire.}
textit{Their chanting's only getting stronger;}
textit{they'll all burn if they're much longer;}
textit{cast into, the funeral pyre.}

vspace{0.5cm}

textit{Animosity is unbecoming,}
textit{overwhelmed as you may feel.}
textit{Color crossed with destiny,}
textit{you'll be satisfied with what the light reveals.}

vspace{0.5cm}

textit{Hidden in the deepest forest,}
textit{there's a quiet, constant chorus}
textit{led by men with eyes of fire,}
textit{as they ignite that funeral pyre.}
textit{Their chanting's only getting stronger.}
textit{They'll all burn if they're much longer,}
textit{but they afford their apathy to}
textit{the fire in their eyes.}
end{minipage}
end{center}
vfill
clearpage


end{document}

odd page geometry

One Answer

I think this is close of what you have in mind.

After filling the boxes with the content (SetVerticalCoffin) you start with the joins one by one, compiling each time to see if they align properly. So in the first step you will have only

    JoinCoffinsFrameOddx[r,t]FigRT[r,t]% top right
    JoinCoffins*FrameOx[l,t]FrameOddx[l,t]  % always the last line

The first line joins the top right corner of the top figure with the top right corner of the 6x6in greenish rule that define the text area.

The last line joins the assembly to the collector box that will by typeset by atbegshi at shipout.

Then you continue adding the remaining figures one by one.

I recommend you to follow the example of the xcoffin manual. It is simple and shows everything you need to know.

% !TeX TS-program = pdflatex

documentclass[10pt]{article}   
usepackage{xcoffins}
usepackage{graphicx}
usepackage{calc}
usepackage{xcolor}

usepackage{kantlipsum}% dummy tex

usepackage{ifthen,changepage}
usepackage{nopageno} % supress page number

usepackage[papersize={8in,8in},top=1in, textwidth=6in, marginratio=1:1 ]{geometry}
usepackage{atbegshi}

AtBeginShipout{AtBeginShipoutAddToBox{%  shipout figures of odd pages 
    checkoddpage
    ifthenelse{boolean{oddpage}}{TypesetCoffinFrameOx}{}}
}

NewCoffinFrameOx
NewCoffinFrameOddx
NewCoffinFigRT
NewCoffinFigRM
NewCoffinFigL
NewCoffinFigM
NewCoffinFigR

%%%%%%%%%   set figures width/height  plus height of text area
newlength{imageLMR}
setlength{imageLMR}{1in} % height and width of the figures
newlength{imageRM}
setlength{imageRM}{1.5in}
newlength{imageRT}
setlength{imageRT}{2.5in}

newlength{textH}
setlength{textH}{6in} % height & width of text area= 8in-2*1in  <<<<<<<<<<<<
%%%%%%%%%%%%%

begin{document}
setlength{parindent}{0pt}

%********************************************* set  the content of  odd pages  
SetVerticalCoffinFrameOddx{textH}{color{green!10}rule{textH}{textH}} % change to white in final version
 
SetVerticalCoffinFigRT{imageRT}{% top right
includegraphics[height=imageRT,width=imageRT]{example-image-a}
}

SetVerticalCoffinFigRM{2.8in}{% middle right
includegraphics[height=imageRM,width=2.8in]{example-image-b}
}

SetVerticalCoffinFigL{imageLMR}{% leftmost bottom
includegraphics[height=imageLMR,width=imageLMR]{example-image-c}
}

SetVerticalCoffinFigM{imageLMR}{% midmost
includegraphics[height=imageLMR,width=imageLMR]{example-grid-100x100pt}
}

SetVerticalCoffinFigR{imageLMR}{% rightmost
includegraphics[height=imageLMR,width=imageLMR]{example-image}
}

%%%%**************  V gap   in figures
newlength{Vgap} 
setlength{Vgap}{(textH -imageLMR-imageRM-imageRT)/2} % V offset 2 gaps distributed beteween 3 images

%*********************************************  assembly the content of  odd pages 
JoinCoffinsFrameOddx[r,t]FigRT[r,t]% top right
JoinCoffins*FrameOddx[r,t]FigRM[r,t](0pt,-imageRT-Vgap)

JoinCoffins*FrameOddx[r,b]FigR[r,b] %bottom row
JoinCoffins*FrameOddx[FigR-l,FigR-b]FigM[r,b]
JoinCoffins*FrameOddx[FigM-l,FigM-b]FigL[r,b]

JoinCoffins*FrameOx[l,t]FrameOddx[l,t]  
%*********************************************  

hspace{2ex} % H offset
begin{minipage}{3in-5ex}   
sffamily{huge I. Fireyes}  textit{Full of light; Reveal the way.} 

vspace{0.15cm} 

{footnotesizetextbf{Mercenarium Function:} When you sing the Fireyes hymn, you may select and discard any number of cards from your hand (you do not have to discard any if you do not wish to). After this, draw cards from the deck until you are holding the maximum of (5) non-hymn cards.}

vspace{0.15cm}

{footnotesize If Fireyes causes a player to draw the last card in the deck before they are holding (5) non-hymn cards, the game enters singularity (meaning that the deck, hymnal, and discard pile are shuffled together, see “Singularity” p. xx) and then continues to draw from the singularity deck until they are holding 5 cards.}

vspace{0.15cm}

{footnotesize If the game enters singularity for any other reason, the effect of the Fireyes hymn becomes “Draw (5) cards.}

vspace{0.15cm}

{footnotesizetextbf{Dragonfruit Core Meaning / Secondary Themes / Alteration:}
textbf{Authority} / Charge, Attraction, Influence / Patience
(color/geometry: Fire textbf{yellow tetrahedron}) (card value: textbf{Ace}) (astrological sign: textbf{Aries})}

9. kant[9]
end{minipage}

newpage

begin{minipage}{3in-5ex}
{footnotesize Fireyes represents the gathering of energy before great movement. It symbolizes the act of preparation, of planning, or of cultivating the skills and resources needed to affect meaningful change in the world. It represents leadership and asks us to reflect on the true nature of power.}

vspace{0.15cm}

{footnotesize Its core meaning (Authority) alludes to the responsibility of action that comes to those who have cultivated greatness within them; to have authority is to have both power and duty. Its secondary themes (Charge, Attraction, and Influence) elicit the image of an individual whose skills, resources, or charisma empowers them to trigger great change in the material world; authority draws people to it, giving the authority figure a great deal of influence on the actions of others. Its alteration (Patience) suggests that the way to cultivate authority is through patience – though taking the time to learn, to work hard, and to listen to others.}

vspace{0.15cm}

{footnotesizetextbf{Aces} are textbf{LEADERS}: “The Adept”. Authority figures. Aces are sources of inspiration or jealousy in those around them. Their influence allows them to affect the world even through small actions. Their powers are amplified by technology, represented in their illustrations as legendary artifacts.}

end{minipage}

clearpage
end{document}

out4

Correct answer by Simon Dispa on March 13, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP