TransWikia.com

Desired page Geometry

TeX - LaTeX Asked on February 19, 2021

I would like help setting up the geometry of a page that looks like this:

odd page geometry

even page geometry

Specifications:

  • page geometry is 8 in by 8 in
  • images on odd page need to be no larger than 2 inches wide
  • paragraph text should be centered and take up no more than 4 inches of text width
  • image can be placed in bottom right corner of page that is the same size as the other images
  • even pages only have a title and a centered paragraph of text.

I would include a MWE, but so far they are so far from these images that I do not think that they would help anyone. I have tried messing with multicol and just played around with floats, but to no avail. Any help is greatly appreciated!

EDIT: Here is a MWE:

documentclass[twoside, openany]{book}
usepackage[paperheight=7.5in,paperwidth=7.5in,left=1in,right=1in,top=1in,bottom=1in]{geometry}
usepackage[hidelinks]{hyperref}
usepackage{graphicx}
usepackage{tipa}
usepackage{xcolor}
usepackage{wrapfig}
usepackage{float}
usepackage{subfiles}
usepackage{enumitem}
usepackage[none]{hyphenat}
usepackage[font=small,labelfont=bf]{caption}

%usepackage{graphicx}
usepackage{subfig}

begin{document}

section{0. The Fool}

Many masks; No mind.

fbox{begin{minipage}[t]{0.4textwidth}vspace{0pt}
includegraphics[width=0.4textwidth]{place}

vspace{.1cm}

includegraphics[width=0.4textwidth]{place}

vspace{.1cm}

includegraphics[width=0.4textwidth]{place}

vspace{.1cm}

includegraphics[width=0.4textwidth]{place}
end{minipage}%
}%
%hspace{-1in}

fbox{begin{minipage}[t]{0.6textwidth}vspace{0pt}
textbf{Mercenarium Function:} The Fool is summoned into play. It has a face value of (L), and no suit. The Fool is not a Mercenary and cannot be bought.

When The Fool is summoned, roll the Fool die and place it on the card. The number rolled determines the strength of The Fool’s aura; if a 4 is rolled, then The Fool is considered to have 4 dots on every edge. The Fool blocks all suits in aura ties. If (0) appears on The Fool die, all captures involving The Fool are annihilations. The player who controls The Fool may use their turn action to re-roll the Fool die. Whenever The Fool captures an enemy card, the player who controls The Fool must re-roll the Fool die.

If The Fool is moved by the effects of III. Optimo, IX. The Shade, or XI. Visionaire, its die value remains the same.

textbf{Dragonfruit Core Meaning / Secondary Themes / Alteration:}
textbf{Lessons} / Ignorance, Toil, Anxiety / THE FOX
(color/geometry: indigo sphere) (card value: textbf{L}) (astrological sign: textbf{eye of horus})

The Fool represents suffering and ignorance, and the masks that we hide behind for protection. It calls towards unresolved trauma, recurring struggles, and lessons that we have yet to learn. It contains the keys to liberation.

Its core meaning (Lessons) suggests opportunities for growth that we do not recognize or take advantage of, which forces us to relive painful trials. Its secondary themes (Ignorance, Toil, Anxiety) elicit the most difficult parts of life, in which our perspectives punish us for things that we have no control over. Its alteration (THE FOX) means a flash of awareness – a sudden recognition – that lets us laugh at, savor, and alchemize our pain into something better.

textbf{Lords} represent textbf{LESSONS}: “The Fool.” These cards present opportunities to transmute pain or discomfort into spiritual growth. When Lords appear, they give us a chance to reflect on the ways we can improve or balance our energy within their sphere.
end{minipage}}



end{document}

New code from answer. What am I doing wrong to get four images on the left?

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

usepackage{ifthen,changepage} % check odd or even page
usepackage{nopageno} % supress page number

%%%%%%%  FOR TESTING  ONLY, comment for final version
%usepackage{showframe}  %added
%renewcommand*ShowFrameColor{color{red}}    %added

usepackage[% main page specs
 papersize={8in,8in}, %specs
 textwidth=4in,  %specs
 marginratio=1:1
 ]{geometry}

%usepackage{kantlipsum} % dummy text

usepackage{atbegshi}

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

NewCoffinFrameOx
NewCoffinFrameEx

NewCoffinFrameOddx
NewCoffinFrameEvenx

NewCoffinFigTop
NewCoffinFigMid
NewCoffinFigMed
NewCoffinFigBottom
NewCoffinFigRight
NewCoffinTitlex


%%%%%%%%%   set figures width/heigth  plus height of text area
newlength{imageW}
setlength{imageW}{1.6in} % heigth and width of the figures, max =2in <<<<<<<<<<<<
newlength{textH}
setlength{textH}{6in} % heigth of text area, min =3imageW  <<<<<<<<<<<<
%%%%%%%%%%%%%

begin{document}
    setlength{parindent}{0pt}
    
SetVerticalCoffinFigTop{imageW}{% upper figure
    includegraphics[height=imageW,width=imageW]{example-image-a}
}

SetVerticalCoffinFigMid{imageW}{% middle figure
    includegraphics[height=imageW,width=imageW]{example-image-b}
}

SetVerticalCoffinFigMed{imageW}{% other middle figure
    includegraphics[height=imageW,width=imageW]{example-image-c}
}

SetVerticalCoffinFigBottom{imageW}{% lower figure
    includegraphics[height=imageW,width=imageW]{example-image-c}
}

SetVerticalCoffinFigRight{imageW}{% lower right figure
    includegraphics[height=imageW,width=imageW]{example-grid-100x100pt}
}   
    
%********************************************* set & assembly the content of even and odd pages 
SetVerticalCoffinFrameOddx{textwidth}{color{white}rule{textwidth}{textH}}    
SetVerticalCoffinFrameEvenx{textwidth}{color{white}rule{textwidth}{textH}}

%%%%%%  FOR TESTING  ONLY, comment for final version
%SetVerticalCoffinFrameOddx{textwidth}{fboxsep = 0pt framebox{color{red!10}rule{textwidth}{textH}}} 
%SetVerticalCoffinFrameEvenx{textwidth}{fboxsep = 0pt framebox{color{blue!10}rule{textwidth}{textH}}}
%%%%%% 

SetVerticalCoffinTitlex{2in}{% title, the same in odd and even pages
 sffamily Large centering 0. The Fool
 }

newlength{Hoffset}
setlength{Hoffset}{oddsidemargin}

newlength{Hgap}
%setlength{Hgap}{(pagewidth -textwidth -2imageW)/4} % H offset to  text equally distributed


% *************** odd pages 
JoinCoffins*FigTop[hc,t]Titlex[hc,b](0pt,baselineskip)
JoinCoffins*FrameOddx[l,t]FigTop[r,t](-Hgap,0pt)
JoinCoffins*FrameOddx[l,vc]FigMid[r,vc](-Hgap,0pt)
JoinCoffins*FrameOddx[l,vc]FigMed[r,vc](-Hgap,0pt)
JoinCoffins*FrameOddx[l,b]FigBottom[r,b](-Hgap,0pt)
JoinCoffins*FrameOddx[r,b]FigRight[l,b](Hgap,0pt)
JoinCoffins*FrameOx[r,t]FrameOddx[l,t](Hoffset,-baselineskip)

% *************** even pages
JoinCoffins*FrameEvenx[hc, t]Titlex[hc,b](0pt,baselineskip)
JoinCoffins*FrameEx[hc,vc]FrameEvenx[l,t](Hoffset,-baselineskip)   
%*********************************************  
    
hspace{2ex} % H offset
begin{minipage}{textwidth-5ex}
textbf{Mercenarium Function:} The Fool is summoned into play. It has a face value of (L), and no suit. The Fool is not a Mercenary and cannot be bought.

When The Fool is summoned, roll the Fool die and place it on the card. The number rolled determines the strength of The Fool’s aura; if a 4 is rolled, then The Fool is considered to have 4 dots on every edge. The Fool blocks all suits in aura ties. If (0) appears on The Fool die, all captures involving The Fool are annihilations. The player who controls The Fool may use their turn action to re-roll the Fool die. Whenever The Fool captures an enemy card, the player who controls The Fool must re-roll the Fool die.

If The Fool is moved by the effects of III. Optimo, IX. The Shade, or XI. Visionaire, its die value remains the same.

textbf{Dragonfruit Core Meaning / Secondary Themes / Alteration:}
textbf{Lessons} / Ignorance, Toil, Anxiety / THE FOX
(color/geometry: indigo sphere) (card value: textbf{L}) (astrological sign: textbf{eye of horus})

The Fool represents suffering and ignorance, and the masks that we hide behind for protection. It calls towards unresolved trauma, recurring struggles, and lessons that we have yet to learn. It contains the keys to liberation.

%Its core meaning (Lessons) suggests opportunities for growth that we do not recognize or take advantage of, which forces us to relive painful trials. Its secondary themes (Ignorance, Toil, Anxiety) elicit the most difficult parts of life, in which our perspectives punish us for things that we have no control over. Its alteration (THE FOX) means a flash of awareness – a sudden recognition – that lets us laugh at, savor, and alchemize our pain into something better.

%textbf{Lords} represent textbf{LESSONS}: “The Fool.” These cards present opportunities to transmute pain or discomfort into spiritual growth. When Lords appear, they give us a chance to reflect on the ways we can improve or balance our energy within their sphere.
end{minipage}

newpage
hspace{8ex} % H offset
begin{minipage}{textwidth-16ex}
    3. stuff
end{minipage}

end{document}

One Answer

Let's see if I have correctly interpreted your requirements. Besides the minipage, other tools are required.

The best tool I know of for putting figures and text in specific places of a page is the xcoffins package.

In a nutshell, it puts the contents in special boxes that have multiple handles. The handles allow the boxes to be joined together precisely and, if necessary, to add X Y offsets.

The tool behaves almost like a layout design program (no GUI) in the sense that the content is independent of the geometric settings and also allows you to specify its place on the page using their relative positions, in a similar way to the specifications put into your question.

For the odd page there are six boxes (called coffins): 4 figures, the title and a frame that serves as a collector for the other boxes.

For the even page only one box is needed, as the title is reused, it is just placed in a different place.

After joining the boxes with the appropriate offsets, the result is placed as a text object at the current insertion point. This is done with the help of the atbegshi package which inserts the assembly for the odd or even pages in the shipout.

The text itself is included in minipages. A manual chosen offset shifts the text horizontally inside the minipage.

You can play with the template changing textH, the text height of the frame, and imageW, the figure width and height, or textwidth to see how the assembly accommodates itself.

For a "final" version please comment the two lines marked as FOR TESTING ONLY. This will eliminate the black frame and the background colors. (or set color{white})

I am sorry for not seeing your MWE while working in the solution. (Anyway I could not compile it).

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

usepackage{ifthen,changepage} % check odd or even page
usepackage{nopageno} % supress page number

%%%%%%%  FOR TESTING  ONLY, comment for final version
%usepackage{showframe}  %added
%renewcommand*ShowFrameColor{color{red}}    %added

usepackage[% main page specs
 papersize={8in,8in}, %specs
 textwidth=4in,  %specs
 marginratio=1:1
 ]{geometry}

usepackage{kantlipsum} % dummy text

usepackage{atbegshi}

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

NewCoffinFrameOx
NewCoffinFrameEx

NewCoffinFrameOddx
NewCoffinFrameEvenx

NewCoffinFigTop
NewCoffinFigMed
NewCoffinFigBottom
NewCoffinFigRight
NewCoffinTitlex


%%%%%%%%%   set figures width/heigth  plus height of text area
newlength{imageW}
setlength{imageW}{1.6in} % heigth and width of the figures, max =2in <<<<<<<<<<<<
newlength{textH}
setlength{textH}{6in} % heigth of text area, min =3imageW  <<<<<<<<<<<<
%%%%%%%%%%%%%

begin{document}
    setlength{parindent}{0pt}
    
SetVerticalCoffinFigTop{imageW}{% upper figure
    includegraphics[height=imageW,width=imageW]{example-image-a}
}

SetVerticalCoffinFigMed{imageW}{% middle figure
    includegraphics[height=imageW,width=imageW]{example-image-b}
}

SetVerticalCoffinFigBottom{imageW}{% lower figure
    includegraphics[height=imageW,width=imageW]{example-image-c}
}

SetVerticalCoffinFigRight{imageW}{% lower right figure
    includegraphics[height=imageW,width=imageW]{example-grid-100x100pt}
}   
    
%********************************************* set & assembly the content of even and odd pages 
SetVerticalCoffinFrameOddx{textwidth}{color{white}rule{textwidth}{textH}}    
SetVerticalCoffinFrameEvenx{textwidth}{color{white}rule{textwidth}{textH}}


%%%%%%  FOR TESTING  ONLY, comment for final version
SetVerticalCoffinFrameOddx{textwidth}{fboxsep = 0pt framebox{color{red!10}rule{textwidth}{textH}}} 
SetVerticalCoffinFrameEvenx{textwidth}{fboxsep = 0pt framebox{color{blue!10}rule{textwidth}{textH}}}
%%%%%% 

SetVerticalCoffinTitlex{2in}{% title, the same in odd and even pages
 sffamily Large centering Title goes here   second line
 }

newlength{Hoffset}
setlength{Hoffset}{oddsidemargin}

newlength{Hgap}
setlength{Hgap}{(paperwidth -textwidth -2imageW)/4} % H offset to  text equally distributed


% *************** odd pages 
JoinCoffins*FigTop[hc,t]Titlex[hc,b](0pt,baselineskip)
JoinCoffins*FrameOddx[l,t]FigTop[r,t](-Hgap,0pt)
JoinCoffins*FrameOddx[l,vc]FigMed[r,vc](-Hgap,0pt)
JoinCoffins*FrameOddx[l,b]FigBottom[r,b](-Hgap,0pt)
JoinCoffins*FrameOddx[r,b]FigRight[l,b](Hgap,0pt)
JoinCoffins*FrameOx[r,t]FrameOddx[l,t](Hoffset,-baselineskip)

% *************** even pages
JoinCoffins*FrameEvenx[hc, t]Titlex[hc,b](0pt,baselineskip)
JoinCoffins*FrameEx[hc,vc]FrameEvenx[l,t](Hoffset,-baselineskip)   
%*********************************************  
    
hspace{2ex} % H offset
begin{minipage}{textwidth-5ex}
    1. kant[1]
end{minipage}

newpage
hspace{8ex} % H offset
begin{minipage}{textwidth-16ex}
    3. kant[3]
end{minipage}

end{document}

figures width&height = 1.6in, text height = 6in

A

figures width&height = 1.0in, text height = 4in

B

textwidth= 3in

C

UPDATE How to add another figure on the left side

1 - Create and fill the box for the new figure (obvious).

2 - Calculate the vertical gap to equally distribute 4 figures = (text height - 4 * image height)/3 . (4 figures, so 3 vertical gaps are needed)

Note: the maximum image width&height is text height/number of figures, so the vertical gap remains >= 0 .

3 - Make the joins incorporating each new figure with an increasing vertical offset with respect to the origin.

% !TeX TS-program = pdflatex

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

usepackage{ifthen,changepage} % check odd or even page
usepackage{nopageno} % supress page number

%%%%%%%  FOR TESTING  ONLY, comment for final version
%usepackage{showframe}  %added
%renewcommand*ShowFrameColor{color{red}}    %added

usepackage[% main page specs
 papersize={8in,8in}, %specs
 textwidth=4in,  %specs
 marginratio=1:1
 ]{geometry}

usepackage{kantlipsum} % dummy text

usepackage{atbegshi}

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

NewCoffinFrameOx
NewCoffinFrameEx

NewCoffinFrameOddx
NewCoffinFrameEvenx

NewCoffinFigTop
NewCoffinFigMed
NewCoffinFigBottom
NewCoffinFigRight
NewCoffinTitlex
    
NewCoffinFigPlus %added fourth fig 

%%%%%%%%%   set figures width/height  plus height of text area
newlength{imageW}
setlength{imageW}{1.2in} % height and width of the figures, max = text height/number of  fig <<<<<<<<<<<<
newlength{textH}
setlength{textH}{6in} % heigth of text area, min =3imageW  <<<<<<<<<<<<
%%%%%%%%%%%%%

begin{document}
    setlength{parindent}{0pt}
    
SetVerticalCoffinFigTop{imageW}{% upper figure
    includegraphics[height=imageW,width=imageW]{example-image-a}
}

SetVerticalCoffinFigMed{imageW}{% middle figure
    includegraphics[height=imageW,width=imageW]{example-image-b}
}

SetVerticalCoffinFigBottom{imageW}{% lower figure
    includegraphics[height=imageW,width=imageW]{example-image-c}
}

SetVerticalCoffinFigRight{imageW}{% lower right figure
    includegraphics[height=imageW,width=imageW]{example-grid-100x100pt}
}   

SetVerticalCoffinFigPlus{imageW}{% fourth fig on left side  ADDED
    includegraphics[height=imageW,width=imageW]{example-grid-100x100pt}
}  
    
%********************************************* set & assembly the content of even and odd pages 
SetVerticalCoffinFrameOddx{textwidth}{color{white}rule{textwidth}{textH}}    
SetVerticalCoffinFrameEvenx{textwidth}{color{white}rule{textwidth}{textH}}


%%%%%%  FOR TESTING  ONLY, comment for final version
SetVerticalCoffinFrameOddx{textwidth}{fboxsep = 0pt framebox{color{red!10}rule{textwidth}{textH}}} 
SetVerticalCoffinFrameEvenx{textwidth}{fboxsep = 0pt framebox{color{blue!10}rule{textwidth}{textH}}}
%%%%%% 

SetVerticalCoffinTitlex{2in}{% title, the same in odd and even pages
 sffamily Large centering Title goes here   second line
 }

newlength{Hoffset}
setlength{Hoffset}{oddsidemargin}

newlength{Hgap}
setlength{Hgap}{(paperwidth-textwidth -2imageW)/4} % H offset to  text equally distributed

newlength{Vgap} % added
setlength{Vgap}{(textH -4imageW)/3} % V offset 3 gaps distributed beteween 4 images

% *************** odd pages >> changed to add another figure
JoinCoffins*FigTop[hc,t]Titlex[hc,b](0pt,baselineskip)
JoinCoffins*FrameOddx[l,t]FigTop[r,t](-Hgap,0pt)
JoinCoffins*FrameOddx[l,t]FigMed[r,t](-Hgap,-Vgap-imageW)
JoinCoffins*FrameOddx[l,t]FigBottom[r,t](-Hgap,-2Vgap-2imageW)
JoinCoffins*FrameOddx[l,t]FigPlus[r,t](-Hgap,-3Vgap-3imageW) %ADDED

JoinCoffins*FrameOddx[r,b]FigRight[l,b](Hgap,0pt)
JoinCoffins*FrameOx[r,t]FrameOddx[l,t](Hoffset,-baselineskip)

% *************** even pages
JoinCoffins*FrameEvenx[hc, t]Titlex[hc,b](0pt,baselineskip)
JoinCoffins*FrameEx[hc,vc]FrameEvenx[l,t](Hoffset,-baselineskip)   
%*********************************************  
    
hspace{2ex} % H offset
begin{minipage}{textwidth-5ex}
    1. kant[1]
end{minipage}

newpage
hspace{8ex} % H offset
begin{minipage}{textwidth-16ex}
    3. kant[3]
end{minipage}

end{document}

figures width&height = 1.2in, text height = 6in

x4

Correct answer by Simon Dispa on February 19, 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