Difference between revisions of "Command/setupmarginblocks"

From Wiki
Jump to navigation Jump to search
Line 68: Line 68:
  
 
<texcode>
 
<texcode>
 +
\setuplayout[
 +
    backspace=4cm,
 +
    leftmarginwidth=2cm,
 +
    width=fit,
 +
]
 +
 
\setupmarginblocks[
 
\setupmarginblocks[
  top={\vfill},
+
    location=left,
  bottom=,
+
    width=\leftmarginwidth,
 +
    top=\vfilll,
 +
    bottom=,
 
]
 
]
 +
 +
\definemarginblock[demoblock][state=start]
 +
 +
\definefloat
 +
  [marginfigure]
 +
  [figure]
 +
  [default=margin]
 +
 +
\starttext
 +
 +
\dorecurse{10}{
 +
\startplacemarginfigure[reference=#1]
 +
\framed[width=\leftmarginwidth,height=3cm,background=color,backgroundcolor=darkyellow]{#1}
 +
\stopplacemarginfigure
 +
See \in[#1]. \samplefile{tufte}
 +
}
 +
 +
\dorecurse{10}{
 +
\startmarginblock[demoblock]
 +
\framed[width=\leftmarginwidth,height=5cm,background=color,backgroundcolor=darkred]{#1}
 +
\stopmarginblock
 +
See \in[#1]. \samplefile{tufte}
 +
}
 +
 +
% One left, flush.
 +
\flushallmarginblocks[1]
 +
\stoptext
 
</texcode>
 
</texcode>
  

Revision as of 16:42, 10 March 2022

\setupmarginblocks

Syntax (autogenerated)


Syntax

\setupmarginblocks[...,...=...,...]
location inmargin left middle right
style normal bold slanted boldslanted type cap small... command
width dimension
align flushleft middle flushright no
top command
inbetween command
bottom command
left command
right command
before command
after command

Description

Example

By default, the marginblocks are flushed to the top. In case you want to flush all marginblocks to the bottom, you can do this:

\setuplayout[
    backspace=4cm,
    leftmarginwidth=2cm,
    width=fit,
]

\setupmarginblocks[
    location=left,
    width=\leftmarginwidth,
    top=\vfilll,
    bottom=,
]

\definemarginblock[demoblock][state=start]

\definefloat
   [marginfigure]
   [figure]
   [default=margin]

\starttext

\dorecurse{10}{
\startplacemarginfigure[reference=#1]
\framed[width=\leftmarginwidth,height=3cm,background=color,backgroundcolor=darkyellow]{#1}
\stopplacemarginfigure
See \in[#1]. \samplefile{tufte}
}

\dorecurse{10}{
\startmarginblock[demoblock]
\framed[width=\leftmarginwidth,height=5cm,background=color,backgroundcolor=darkred]{#1}
\stopmarginblock
See \in[#1]. \samplefile{tufte}
}

% One left, flush.
\flushallmarginblocks[1]
\stoptext

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: