yex.box.Leader
yex.box.Leader(glue=None, vertical=False, doc=None, name=None, ch=' ', **kwargs)
#
Lines of dots across the middle of an index or whatever.
At present this is only a wrapper for Glue, so all leaders will be blank.
Attributes:
| Name | Type | Description |
|---|---|---|
glue |
Glue
|
the glue we're wrapping.
If the constructor is given |
vertical |
bool
|
True if this Leader is vertical, False (which is the default) if it's horizontal. |
name |
str or None
|
the name to be displayed in showbox. If you leave this as None, no glue will be supplied; however, if name is None and glue is a str, name will be taken from that str. |
length |
yex.box.rule.Dimen or None
|
the length of this box (which is the width if we're horizontal, and the height if we're vertical), overriding the glue. This is None unless we've been through wrapping. |
Source code in yex/box/leader.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | |
__getstate__()
#
The value, in terms of simple types.
Usually
- "ch": self.ch
- "leader": self.glue
- "vertical": self.vertical
However, if we're horizontal and self.ch is a single space:
since Leaders occur all over the place in the final output, where they're almost always finite with no stretch or shrink, we represent that as a special case: just the integer size of the space.
Otherwise, this is the same as the getstate() of the glue.
Source code in yex/box/leader.py
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | |