Hyphen-minus

From Wikipedia, the free encyclopedia

-
Hyphen-minus
In UnicodeU+002D - HYPHEN-MINUS (HTML -)
Different from
Different fromU+2010 UNICODE HYPHEN

U+2011 NON-BREAKING HYPHEN
U+2212 MINUS SIGN
U+2013 EN DASH

U+2014 EM DASH

The hyphen-minus - is the most commonly used type of hyphen, widely used in digital documents. It is the only hyphen character available on the QWERTY keyboard. Among other uses, as explained in the hyphen article, it can be inserted at the end of a line to break a word on a syllable boundary when the following syllable is printed on the next line. In programming languages and spreadsheets, it functions as the minus sign.[1] The name "hyphen-minus" is a Unicode invention;[citation needed] the character is referred to as a hyphen or a minus sign according to the context where it is being used. It is often called a "dash", though it is normally shorter than the dash characters.[a]

Description[]

-+
-+
hyphen-minus, plus, and minus signs
in proportional and monospaced fonts

In early monospaced font typewriters and character encodings, a single code/key was almost always used for hyphen, minus, various dashes, and strikethrough, since they all have a similar appearance.[2][failed verification] The current Unicode Standard specifies distinct characters for dashes, the minus sign, and various types of hyphen including the Unicode hyphen with code point U+2010 and the hyphen-minus with code point U+002D. When a hyphen is called for, the hyphen-minus is a common choice as it is well known, easy to enter on keyboards, required by many data formats and computer languages, and much more likely[citation needed] to render correctly. Though the Unicode Standard states that the U+2010 hyphen is "preferred" over the hyphen-minus,[3] the Standard itself uses the hyphen-minus as its hyphen character.[4]

In modern fonts the hyphen-minus is usually identical or very similar to the Unicode hyphen.[5]

In mathematical contexts that include the plus sign, use of the hyphen-minus in place of the standard minus sign results in an unattractive appearance. Unlike the standard minus sign, the hyphen-minus is generally smaller and at a different height than the horizontal line in the plus sign; see the image above.[b]

Further, many word processors will allow a word wrap after a hyphen-minus, though not after a minus sign.

Uses[]

Typing[]

This character is typed when a hyphen or a minus sign is wanted. Based on old typewriter conventions, it is common to use a pair -- to represent an em dash ,[6] and to put spaces around it  -  to represent an en dash .[citation needed] Some word processors automatically convert these to the correct dash. The character can also be typed multiple times to simulate a horizontal line (though on most typewriters repeated typing of the underscore will produce a connected line). Alternating the hyphen-minus with spaces produces a "dashed" line to indicate where paper is to be cut. Over-striking a section of text with these is used for strikethrough.

Programming languages[]

Most programming languages use the hyphen-minus for denoting subtraction and negation.[7][8] It is almost never used to indicate a range, due to ambiguity with subtraction. Generally other characters, such as the Unicode U+2212 MINUS SIGN are not recognized.

In some programming languages -- marks the beginning of a comment. Likewise, it can occasionally start the signature block. YAML uses a triple dash --- to end a section.

Command line[]

The character is often used when specifying command-line options, a convention mostly started by Unix. Options might be -x or -y; a user can specify both by using -xy. Various implementations of the getopt function allow two hyphen-minuses to specify "long" option names as --description, which are much easier to read while being much harder to memorize and write (recent software does not care about the number of hyphen-minuses, and either does not allow combinations of single-letter options or require the user to rearrange them so they do not match a long option). A double hyphen-minus by itself (followed by a space) indicates that there are no more options, which is useful when one needs to specify a filename that starts with a hyphen-minus. An option of just a hyphen-minus (followed by a space) may be recognized in lieu of a filename and indicates that stdin is to be read.

Encoding[]

The glyph has a code point in Unicode as U+002D - HYPHEN-MINUS; it is also in ASCII with the same value.

See also[]

  • -- (disambiguation)
  • Box-drawing characters including (U+2500), useful for drawing horizontal lines
  • Hyphen
  • Soft hyphen

Explanatory notes[]

  1. ^ In Lucida Sans Unicode, the hyphen-minus is identical to the en dash.
  2. ^ The precise relationships depend on typeface design choices that may differ between designers.

References[]

  1. ^ Jukka K. Korpela (2006). Unicode explained. O'Reilly. p. 382. ISBN 978-0-596-10121-3.
  2. ^ Fischer, Eric. "The Evolution of Character Codes, 1874-1968". CiteSeerX 10.1.1.96.678. Cite journal requires |journal= (help)
  3. ^ "The Unicode Standard, Version 13.0, Chapter 6.2" (PDF). 2020. General Punctuation § Dashes and Hyphens.
  4. ^ Korpela, Jukka. "Dashes and Hyphens § Typographic Usage". Retrieved 30 December 2020.
  5. ^ Marian, Jakub. "Hyphen, minus, en-dash, and em-dash: difference and usage in English". Retrieved 23 December 2020. A hyphen is usually very short (it has its own Unicode character, but you can use the hyphen-minus instead because it looks the same) ...
  6. ^ French, Nigel (2006). InDesign Type: Professional Typography with Adobe InDesign CS2. Adobe Press. p. 72. ISBN 9780321385444. Retrieved 4 July 2020.
  7. ^ Ritchie, Dennis (c. 1975). "C Reference Manual" (PDF). Bell Labs. Retrieved 7 December 2016.
  8. ^ Marlow, Simon (ed.). Haskell 2010 Language Report (PDF). Retrieved 7 December 2016.[page needed]

External links[]

  • The dictionary definition of - at Wiktionary
Retrieved from ""