Difference between revisions of "Command/setupmargindata"

From Wiki
Jump to navigation Jump to search
m (compile example)
 
(One intermediate revision by the same user not shown)
Line 6: Line 6:
 
== [[Help:Reference|Syntax]] (autogenerated) ==
 
== [[Help:Reference|Syntax]] (autogenerated) ==
 
<syntax>setupmargindata</syntax>
 
<syntax>setupmargindata</syntax>
 
== [[Help:Reference|Syntax]] ==
 
<table cellspacing="4" cellpadding="2" class="cmd">
 
  <tr>
 
    <td colspan="2" class="cmd">\setupmargindata<span class="first" style="color:red;">[...]</span><span class="second" >[...,...=...,...]</span></td>
 
  </tr>
 
  <tr valign="top" class="first">
 
    <td class="cmd">[...]</td>
 
    <td>left right number </td>
 
  </tr>
 
  <tr valign="top" class="second">
 
    <td class="cmd">[[Command/keyword:location|location]]</td>
 
    <td>[[Command/value:flushleft|flushleft]] [[Command/value:flushright|flushright]] [[Command/value:both|both]] </td>
 
  </tr>
 
  <tr valign="top" class="second">
 
    <td class="cmd">[[Command/keyword:style|style]]</td>
 
    <td>[[Command/value:normal|normal]] [[Command/value:bold|bold]] [[Command/value:slanted|slanted]] [[Command/value:boldslanted|boldslanted]] [[Command/value:type|type]] [[Command/value:cap|cap]] [[Command/value:small...|small...]] [[Command/value:command|command]] </td>
 
  </tr>
 
  <tr valign="top" class="second">
 
    <td class="cmd">[[Command/keyword:before|before]]</td>
 
    <td>[[Command/value:command|command]] </td>
 
  </tr>
 
  <tr valign="top" class="second">
 
    <td class="cmd">[[Command/keyword:after|after]]</td>
 
    <td>[[Command/value:command|command]] </td>
 
  </tr>
 
  <tr valign="top" class="second">
 
    <td class="cmd">[[Command/keyword:align|align]]</td>
 
    <td>[[Command/value:inner|inner]] [[Command/value:outer|outer]] [[Command/value:left|left]] [[Command/value:right|right]] [[Command/value:middle|middle]] [[Command/value:normal|normal]] [[Command/value:no|no]] [[Command/value:yes|yes]] </td>
 
  </tr>
 
  <tr valign="top" class="second">
 
    <td class="cmd">[[Command/keyword:line|line]]</td>
 
    <td>[[Command/value:number|number]] </td>
 
  </tr>
 
  <tr valign="top" class="second">
 
    <td class="cmd">[[Command/keyword:distance|distance]]</td>
 
    <td>[[Command/value:dimension|dimension]] </td>
 
  </tr>
 
  <tr valign="top" class="second">
 
    <td class="cmd">[[Command/keyword:separator|separator]]</td>
 
    <td>[[Command/value:text|text]] </td>
 
  </tr>
 
  <tr valign="top" class="second">
 
    <td class="cmd">[[Command/keyword:width|width]]</td>
 
    <td>[[Command/value:dimension|dimension]] </td>
 
  </tr>
 
  <tr valign="top" class="second">
 
    <td class="cmd">[[Command/keyword:distance|distance]]</td>
 
    <td>[[Command/value:dimension|dimension]] </td>
 
  </tr>
 
  <tr valign="top" class="second">
 
    <td class="cmd">[[Command/keyword:stack|stack]]</td>
 
    <td>[[Command/value:yes|yes]] [[Command/value:no|no]] </td>
 
  </tr>
 
  <tr valign="top" class="second">
 
    <td class="cmd">[...,...=...,...]</td>
 
    <td>see [[Command/setupframed|\setupframed]] </td>
 
  </tr>
 
</table>
 
  
 
== Description ==
 
== Description ==
  
Stack option is used to emulate LaTeX's marginpars (they're considered floats, hence the resulting margin notes do not overlap).
+
Stack option is used to emulate LaTeX’s marginpars (they’re considered floats, hence the resulting margin notes do not overlap).
  
 
The first bracket can be used to provide different setups for different margin text types. It defines which type of text the following parameters apply to. So the following code defines that any text placed in the margin using <code>\inright{...}</code> will be slanted:
 
The first bracket can be used to provide different setups for different margin text types. It defines which type of text the following parameters apply to. So the following code defines that any text placed in the margin using <code>\inright{...}</code> will be slanted:
 +
 
<texcode>
 
<texcode>
 
\setupmargindata[right][style=slanted]
 
\setupmargindata[right][style=slanted]
Line 76: Line 18:
  
 
The previous code does <i>not</i> alter the location of the <code>\inmargin</code> command. To do that you would use:
 
The previous code does <i>not</i> alter the location of the <code>\inmargin</code> command. To do that you would use:
 +
 
<texcode>
 
<texcode>
 
\setupmargindata[location=right,style=slanted]
 
\setupmargindata[location=right,style=slanted]
Line 84: Line 27:
 
The following code inserts text in the right-hand page margin:
 
The following code inserts text in the right-hand page margin:
  
<texcode>
+
<context  source="yes">
\setupmargindata[inmargin][location=right]
+
\setuppapersize[A6,landscape]
 +
\setupmargindata[inmargin][location=right,style=italic]
  
 
\starttext
 
\starttext
Line 94: Line 38:
 
adjust your margins to accommodate the type.
 
adjust your margins to accommodate the type.
 
\stoptext
 
\stoptext
</texcode>
+
</context>
  
  

Latest revision as of 14:53, 19 March 2024

\setupmargindata

Syntax (autogenerated)

\setupmargindata[...,...][...=...,...]
[...,...]name
strutyes no auto cap fit line default character
commandoneargument
widthdimension
alignsee \setupalign
anchorregion text
locationleft right inner outer
methodtop line first depth height
categorydefault edge
scopelocal global
optiontext paragraph
marginlocal normal margin edge
distancedimension
hoffsetdimension
voffsetdimension
dydimension
bottomspacedimension
thresholddimension
linenumber
stackyes continue
stylestyle command
colorcolor


Description

Stack option is used to emulate LaTeX’s marginpars (they’re considered floats, hence the resulting margin notes do not overlap).

The first bracket can be used to provide different setups for different margin text types. It defines which type of text the following parameters apply to. So the following code defines that any text placed in the margin using \inright{...} will be slanted:

\setupmargindata[right][style=slanted]

The previous code does not alter the location of the \inmargin command. To do that you would use:

\setupmargindata[location=right,style=slanted]

Example

The following code inserts text in the right-hand page margin:

\setuppapersize[A6,landscape]
\setupmargindata[inmargin][location=right,style=italic]

\starttext
This is an example of a simple margin note set in the slanted font
of the document. If used correctly, the note \inmargin{Here is a
simple margin note.} should print on the side with the command
\type {\inmargin} placed in the text. You will of course want to
adjust your margins to accommodate the type.
\stoptext


See also

Help from ConTeXt-Mailinglist/Forum

All issues with: