Difference between revisions of "Compound words"

From Wiki
Jump to navigation Jump to search
m (fix last table line)
(retry, using prose and a buffer instead)
Line 4: Line 4:
 
This dash can be placed between two | characters, for example |-|.
 
This dash can be placed between two | characters, for example |-|.
  
When || is typed, the default intra word dash is used, which is <context>||</context>.
+
When || is typed, the default intra word dash is used, which is <context>||</context>. You can configure this with <cmd>setuphyphenmark</cmd>
 
 
  \setuphyphenmark[sign=..]
 
  
 
The || is also used in word combinations like (intra)word, which is typed as (intra|)|word.
 
The || is also used in word combinations like (intra)word, which is typed as (intra|)|word.
 
The mechanism is not foolproof but it serves most purposes. In case the hyphenation is
 
The mechanism is not foolproof but it serves most purposes. In case the hyphenation is
 
incorrect you can hyphenate the first word of the composed one by hand: (in\-tra|)|word.
 
incorrect you can hyphenate the first word of the composed one by hand: (in\-tra|)|word.
 +
 +
Another use of || is the processing of subsentences. The symbol that surrounds a subsentence varies
 +
depending on the current language settings, as controlled by <cmd>setuplanguage</cmd>. When you use |<| and |>| to indicate the subsentence, the proper symbol will be used automatically.
 +
 +
<context>
 +
\startbuffer
 +
a |<|as explained below|>| conflirtaneous \dots
 +
\stopbuffer
 +
 +
\typebuffer
 +
 +
\getbuffer
 +
</context>
  
 
The main reason behind this mechanism is that TeX doesn’t really know how to hyphenate
 
The main reason behind this mechanism is that TeX doesn’t really know how to hyphenate
Line 38: Line 49:
 
\VL \ShowComposed intra|=|word  \VL\LR
 
\VL \ShowComposed intra|=|word  \VL\LR
 
\VL \ShowComposed intra|'|word  \VL\LR
 
\VL \ShowComposed intra|'|word  \VL\LR
\VL \ShowComposed |<|subsentence|>| \VL\LR
 
 
\HL
 
\HL
 
\stoptable
 
\stoptable
 
</context>
 
</context>

Revision as of 09:35, 16 February 2008

Composed words

Words consisting of two separate words are often separated by an intra word dash, as in x-axis. This dash can be placed between two | characters, for example |-|.

When || is typed, the default intra word dash is used, which is . You can configure this with \setuphyphenmark

The || is also used in word combinations like (intra)word, which is typed as (intra|)|word. The mechanism is not foolproof but it serves most purposes. In case the hyphenation is incorrect you can hyphenate the first word of the composed one by hand: (in\-tra|)|word.

Another use of || is the processing of subsentences. The symbol that surrounds a subsentence varies depending on the current language settings, as controlled by \setuplanguage. When you use |<| and |>| to indicate the subsentence, the proper symbol will be used automatically.

The main reason behind this mechanism is that TeX doesn’t really know how to hyphenate composed words and how to handle subsentences. TeX know a lot about math, but far less about normal texts. Using this command not only serves consistency, but also makes sure that TeX can break compound words at the right places. It also keeps boundary characters at the right place when a breakpoint is inserted.

The table below is an extended version of the table in the "big manual". In the third column, you see what the possible line breaks in the word would be, and the output that would come from that.