Changes

Jump to navigation Jump to search
89 bytes added ,  20:12, 8 June 2020
m
no edit summary
< [[Visuals]] |
 
== Cropping text ==
There are some rare cases in which it is useful to truncate a line of text and discard some of it.
=== <tt>\limitatetext</tt> ===
A bit more beautiful alternative for the previous command is <tt>\{{cmd|limitatetext</tt>}}.
This command takes care of '''word''' boundaries, so that only complete words will
appear in the final (cropped) text.
Both commands have their range of application.
<tt>\{{cmd|limitatetext</tt> }} is more robust (using grouping tokens like<tt>\{{cmd|underbar</tt> }} is possible), while <tt>\{{cmd|doboundtext</tt> }} works better
on text that cannot be hyphenated.
=== <tt>\limitatefirstline</tt> ===
In ConTeXt versions newer than 07.09.2005 there is also a command
called <tt>\{{cmd|limitatefirstline</tt>}}, which acts nearly like <tt>\{{cmd|doboundtext</tt>}},
but at a more robust level. This macro first tries to break the given text
at character level. It uses nearly the same breaking mechanism as <tt>\{{cmd|limitatetext</tt>}},
so it shares the problem with nonbreakable text.
But in contrast to <tt>\{{cmd|limitatetext</tt> }} it has a second mechanism, that is only used,
if the prior one fails or if the result of breaking is wasting too much space.
This fail safe mechanism "simply" clips (no breaking at all) the text to the desired
</context>
There is also similar facility for verbatim text in [[Verbatim_with_line_breaks]] and [[Wrapping]] section. == See also == * If you meant to crop a page ''to'' some text, see {{cmd|startTEXpage}}
{{Getting started navbox}}[[Category:Basics]][[Category:Graphics]]

Navigation menu