Difference between revisions of "Command/ margindata"

From Wiki
Jump to navigation Jump to search
(Created page with "Documentation for \<i>margindata</i>")
 
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
<?xml version='1.0'?>
 
<!-- this file was generated on 2020-08-20T09:05 -->
 
 
<cd:commandgroup generated="yes" name="margindata" xmlns:cd="http://wiki.contextgarden.net/commanddoc/20200807">
 
<cd:commandgroup generated="yes" name="margindata" xmlns:cd="http://wiki.contextgarden.net/commanddoc/20200807">
<cd:shortdesc>
+
<cd:shortdesc><!-- a short command summary goes here -->
<!-- a short command summary goes here -->
+
The instances of  <tt>\<i>margindata</i></tt> are used for placing fragments outside of the regular running text.
The instances of  <tt>\<i>margindata</i></tt> are used for ...
 
 
</cd:shortdesc>
 
</cd:shortdesc>
 
<cd:sequence>
 
<cd:sequence>
Line 10: Line 7:
 
   </cd:sequence>
 
   </cd:sequence>
 
<cd:instances>
 
<cd:instances>
     <cd:constant value="inleftmargin"></cd:constant>
+
     <cd:constant value="inleftmargin">defined as {{cmd|definemargindata|2=[inleftmargin][left][margin=margin,width=\leftmarginwidth,style=,color=]}}</cd:constant>
     <cd:constant value="inrightmargin"></cd:constant>
+
     <cd:constant value="inrightmargin">defined as {{cmd|definemargindata|2=[inrightmargin][right][margin=margin,width=\rightmarginwidth,style=,color=]}}</cd:constant>
     <cd:constant value="inoutermargin"></cd:constant>
+
     <cd:constant value="inoutermargin">defined as {{cmd|definemargindata|2=[inoutermargin][outer][margin=margin,width=\outermarginwidth,style=,color=]}}</cd:constant>
     <cd:constant value="ininnermargin"></cd:constant>
+
     <cd:constant value="ininnermargin">defined as {{cmd|definemargindata|2=[ininnermargin][inner][margin=margin,width=\innermarginwidth,style=,color=]}}</cd:constant>
     <cd:constant value="inleftedge"></cd:constant>
+
     <cd:constant value="inleftedge">defined as {{cmd|definemargindata|2=[inleftedge][left][margin=edge,width=\leftedgewidth,style=,color=,category=edge]}}</cd:constant>
     <cd:constant value="inrightedge"></cd:constant>
+
     <cd:constant value="inrightedge">defined as {{cmd|definemargindata|2=[inrightedge][right][margin=edge,width=\rightedgewidth,style=,color=,category=edge]}}</cd:constant>
     <cd:constant value="inouteredge"></cd:constant>
+
     <cd:constant value="inouteredge">defined as {{cmd|definemargindata|2=[inouteredge][outer][margin=edge,width=\outeredgewidth,style=,color=,category=edge]}}</cd:constant>
     <cd:constant value="ininneredge"></cd:constant>
+
     <cd:constant value="ininneredge">defined as {{cmd|definemargindata|2=[ininneredge][inner][margin=edge,width=\inneredgewidth,style=,color=,category=edge]}}</cd:constant>
     <cd:constant value="atleftmargin"></cd:constant>
+
     <cd:constant value="atleftmargin">defined as {{cmd|definemargindata|2=[atleftmargin][left][margin=normal,width=\leftmarginwidth,style=,color=]}}</cd:constant>
     <cd:constant value="atrightmargin"></cd:constant>
+
     <cd:constant value="atrightmargin">defined as {{cmd|definemargindata|2=[atrightmargin][right][margin=normal,width=\rightmarginwidth,style=,color=]}}</cd:constant>
     <cd:constant value="inleft"></cd:constant>
+
     <cd:constant value="inleft">defined as {{cmd|definemargindata|2=[inleft][left][margin=margin,width=\leftmarginwidth,align=flushright]}}</cd:constant>
     <cd:constant value="inright"></cd:constant>
+
     <cd:constant value="inright">defined as {{cmd|definemargindata|2=[inright][right][margin=margin,width=\rightmarginwidth,align=flushleft]}}</cd:constant>
     <cd:constant value="inouter"></cd:constant>
+
     <cd:constant value="inouter">defined as {{cmd|definemargindata|2=[inouter][outer][margin=margin,width=\outermarginwidth,align=inner]}}</cd:constant>
     <cd:constant value="ininner"></cd:constant>
+
     <cd:constant value="ininner">defined as {{cmd|definemargindata|2=[ininner][inner][margin=margin,width=\innermarginwidth,align=outer]}}</cd:constant>
     <cd:constant value="inmargin"></cd:constant>
+
     <cd:constant value="inmargin">defined as {{cmd|definemargindata|2=[inmargin][left][margin=margin,width=\leftmarginwidth,align=flushright]}}</cd:constant>
     <cd:constant value="inother"></cd:constant>
+
     <cd:constant value="inother">defined as {{cmd|definemargindata|2=[inother][right][margin=margin,width=\rightmarginwidth,align=flushleft]}}</cd:constant>
     <cd:constant value="margintext"></cd:constant>
+
     <cd:constant value="margintext">defined as {{cmd|definemargindata|2=[margintext][left][margin=margin,width=\leftmarginwidth,align=flushright,stack=yes]}}</cd:constant>
 
   </cd:instances>
 
   </cd:instances>
 
<cd:variants>
 
<cd:variants>
Line 47: Line 44:
 
   </cd:command>
 
   </cd:command>
 
</cd:variants>
 
</cd:variants>
<cd:description>
+
<cd:description>Place a paragraph in the margin or edge region.
<!-- the long description of the command goes here -->
 
 
</cd:description>
 
</cd:description>
<cd:examples>
+
<cd:examples><cd:example title=""><texcode>
<!--  command example(s)
+
\inmargin{\externalfigure
<cd:example title="">
+
[hass23g]
</cd:example>
+
[width=\marginwidth]}
-->
+
</texcode>
</cd:examples>
+
 
 +
</cd:example><cd:example title="margintext example"><context source="yes">
 +
\setuppapersize[A8,landscape][A8,landscape]
 +
\setuplayout[leftmargin=2.5cm,
 +
            leftmargindistance=0.2cm,
 +
            backspace=2.9cm,
 +
            width=4cm,
 +
            rightmargin=0cm]
 +
\showframe
 +
 
 +
\starttext
 +
\margintext{I have discovered a truly
 +
            marvelous proof ...  but
 +
            this margin is too narrow
 +
            to contain it.}
 +
There is no \math{n > 2} to solve
 +
\startformula
 +
a^n + b^n = c^n.
 +
\stopformula
 +
\stoptext
 +
</context>
 +
 
 +
</cd:example><cd:example title="Use in titles">Hans wrote that "using inmargin inside a title is sort of unpredictable" and that for titles {{cmd|margintitle}} is the way to go. {{bug|margintitle is currently undocumented, which is why its example is included here.}}
 +
<context source="yes">
 +
\setuppapersize[A8,landscape][A8,landscape]
 +
\setuplayout[leftmargin=2.5cm,
 +
            leftmargindistance=0.2cm,
 +
            backspace=2.9cm,
 +
            width=4cm,
 +
            rightmargin=0cm]
 +
\showframe
 +
 
 +
\starttext
 +
\margintitle{a special command}
 +
\section{section title}
 +
\stoptext
 +
</context>
 +
</cd:example></cd:examples>
 
<cd:notes>
 
<cd:notes>
<!--  this is for special remarks that do not fit elsewhere, like discovered bugs in specific context versions
+
<cd:note author="[[User:Taco|Taco]] ([[User talk:Taco|talk]])" date="20:50, 20 August 2020 (CEST)">
<cd:note author="..." date="...">
+
In [[MkII]] {{cmd|setupmargindata}} was called <code>\setupinmargin</code>
</cd:note>
+
 
-->
+
</cd:note></cd:notes>
</cd:notes>
 
 
<cd:seealso>
 
<cd:seealso>
<!-- one or more of these:
 
<cd:commandref name="xx"></cd:commandref>
 
<cd:wikipage  page="xx"></cd:wikipage>
 
<cd:url        url="https://xx"></cd:url>
 
<cd:manual    pdf="xx"></cd:manual>
 
<cd:source    file="xx"></cd:source>
 
-->
 
 
<cd:commandref name="definemargindata" originator="system"></cd:commandref>
 
<cd:commandref name="definemargindata" originator="system"></cd:commandref>
 
<cd:commandref name="setupmargindata" originator="system"></cd:commandref>
 
<cd:commandref name="setupmargindata" originator="system"></cd:commandref>
 
<cd:commandref name="setupmarginframed" originator="system"></cd:commandref>
 
<cd:commandref name="setupmarginframed" originator="system"></cd:commandref>
<cd:source file="typo-mar.mkiv" originator="system"></cd:source>  
+
<cd:source file="typo-mar.mkiv" originator="system"></cd:source>
<cd:wikipage originator="system" page="Category:Structure"></cd:wikipage>  
+
<cd:wikipage originator="system" page="Category:Structure"></cd:wikipage>
</cd:seealso>
+
<cd:wikipage page="Layout"></cd:wikipage>
 +
<cd:commandref name="margintitle"></cd:commandref></cd:seealso>
 
</cd:commandgroup>
 
</cd:commandgroup>

Latest revision as of 09:14, 30 August 2020


\margindata

Summary

The instances of \margindata are used for placing fragments outside of the regular running text.

Instances

\inleftmargindefined as \definemargindata[inleftmargin][left][margin=margin,width=\leftmarginwidth,style=,color=]
\inrightmargindefined as \definemargindata[inrightmargin][right][margin=margin,width=\rightmarginwidth,style=,color=]
\inoutermargindefined as \definemargindata[inoutermargin][outer][margin=margin,width=\outermarginwidth,style=,color=]
\ininnermargindefined as \definemargindata[ininnermargin][inner][margin=margin,width=\innermarginwidth,style=,color=]
\inleftedgedefined as \definemargindata[inleftedge][left][margin=edge,width=\leftedgewidth,style=,color=,category=edge]
\inrightedgedefined as \definemargindata[inrightedge][right][margin=edge,width=\rightedgewidth,style=,color=,category=edge]
\inouteredgedefined as \definemargindata[inouteredge][outer][margin=edge,width=\outeredgewidth,style=,color=,category=edge]
\ininneredgedefined as \definemargindata[ininneredge][inner][margin=edge,width=\inneredgewidth,style=,color=,category=edge]
\atleftmargindefined as \definemargindata[atleftmargin][left][margin=normal,width=\leftmarginwidth,style=,color=]
\atrightmargindefined as \definemargindata[atrightmargin][right][margin=normal,width=\rightmarginwidth,style=,color=]
\inleftdefined as \definemargindata[inleft][left][margin=margin,width=\leftmarginwidth,align=flushright]
\inrightdefined as \definemargindata[inright][right][margin=margin,width=\rightmarginwidth,align=flushleft]
\inouterdefined as \definemargindata[inouter][outer][margin=margin,width=\outermarginwidth,align=inner]
\ininnerdefined as \definemargindata[ininner][inner][margin=margin,width=\innermarginwidth,align=outer]
\inmargindefined as \definemargindata[inmargin][left][margin=margin,width=\leftmarginwidth,align=flushright]
\inotherdefined as \definemargindata[inother][right][margin=margin,width=\rightmarginwidth,align=flushleft]
\margintextdefined as \definemargindata[margintext][left][margin=margin,width=\leftmarginwidth,align=flushright,stack=yes]

Settings instance

\MARGINDATA[...=...,...][...=...,...]{...}
referencereference
...=...,...inherits from \setupmargindata
...=...,...inherits from \setupmarginframed
{...}content

Description

Place a paragraph in the margin or edge region.

Examples

Example 1

\inmargin{\externalfigure
[hass23g]
[width=\marginwidth]}


margintext example

\setuppapersize[A8,landscape][A8,landscape]
\setuplayout[leftmargin=2.5cm,
             leftmargindistance=0.2cm,
             backspace=2.9cm,
             width=4cm,
             rightmargin=0cm]
\showframe

\starttext
\margintext{I have discovered a truly
            marvelous proof ...  but
            this margin is too narrow
            to contain it.}
There is no \math{n > 2} to solve
\startformula
a^n + b^n = c^n.
\stopformula
\stoptext


Use in titles

Hans wrote that "using inmargin inside a title is sort of unpredictable" and that for titles \margintitle is the way to go.


Bug report: margintitle is currently undocumented, which is why its example is included here. (See: Bug List)


\setuppapersize[A8,landscape][A8,landscape]
\setuplayout[leftmargin=2.5cm,
             leftmargindistance=0.2cm,
             backspace=2.9cm,
             width=4cm,
             rightmargin=0cm]
\showframe

\starttext
\margintitle{a special command}
\section{section title}
\stoptext

Notes

  • By Taco (talk) on 20:50, 20 August 2020 (CEST):
In MkII \setupmargindata was called \setupinmargin

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: