请输入您要查询的百科知识:

 

词条 Non-breaking space
释义

  1. Uses and variations

     Non-breaking behavior  Non-collapsing behavior    Width variation  

  2. Encodings

  3. Keyboard entry methods

  4. See also

  5. Notes

  6. References

{{short description|In computer text processing, a space character that prevents an automatic line break at its position}}{{redirect-distinguish|⍽|␣|⌴}}

In word processing and digital typesetting, a non-breaking space (" "), also called no-break space, non-breakable space (NBSP), hard space, or fixed space,{{NoteTag|The use of the term "fixed space" for no-break space is strongly discouraged, as it is confusable with the term "fixed-width space".}} is a space character that prevents an automatic line break at its position. In some formats, including HTML, it also prevents consecutive whitespace characters from collapsing into a single space.

In HTML, the common non-breaking space, which is the same width as the ordinary space character, is encoded as   or  . In Unicode, it is encoded as U+00A0.

Non-breaking space characters with other widths also exist.

Uses and variations

Despite having layout and uses similar to those of whitespace, it differs in contextual behavior.[1][2]

Non-breaking behavior

Text-processing software typically assumes that an automatic line break may be inserted anywhere a space character occurs; a non-breaking space prevents this from happening (provided the software recognizes the character). For example, if the text "100 km" will not quite fit at the end of a line, the software may insert a line break between "100" and "km". An editor who finds this behaviour undesirable may choose to use a non-breaking space between "100" and "km". This guarantees that the text "100 km" will not be broken: if it does not fit at the end of a line, it is moved in its entirety to the next line.

Non-collapsing behavior

A second common application of non-breaking spaces is in plain text file formats such as SGML, HTML, TeX and LaTeX, whose rendering engines are programmed to treat sequences of whitespace characters (space, newline, tab, form feed, etc.) as if they were a single character (but this behavior can be overridden). Such "collapsing" of whitespace allows the author to neatly arrange the source text using line breaks, indentation and other forms of spacing without affecting the final typeset result.[3][4]

In contrast, non-breaking spaces are not merged with neighboring whitespace characters when displayed, and can therefore be used by an author to simply insert additional visible space in the resulting output without using spans styled with peculiar values of the CSS “white-space” property. Conversely, indiscriminate use (see the recommended use in style guides), in addition to a normal space, gives extraneous space in the output.

Width variation

Other non-breaking variants, defined in Unicode:

  • {{unichar|202f|NARROW NO-BREAK SPACE|html=|note=NNBSP}}. It was introduced in Unicode 3.0 for Mongolian,[5] to separate a suffix[6] from the word stem without indicating a word boundary. It is also required for big punctuation in French, sometimes inaccurately referred to as ”double punctuation“ (before ;, ?, !, »,  and after «, ; today often also before :) and Russian (before em dashes [—]), and in German between multi-part abbreviations (e.g. ”z. B.“, ”d. h.“, ”v. l. n. r.“)[7]. When used with Mongolian, its width is usually one third of the normal space; in other contexts, its width is about 70% of the normal space but may resemble that of the thin space (U+2009), at least with some fonts.[8]. Also starting from release 34 of Unicode Common Locale Data Repository (CLDR) the NNBSP is used in numbers as thousands group separator for French locale [9].
  • {{unichar|2007|FIGURE SPACE|nlink=Figure space|html=}}. Produces a space equal to the figure (0–9) characters.
  • {{unichar|2060|WORD JOINER|nlink=Word joiner|html=|note=WJ}}: encoded in Unicode since version 3.2. The word-joiner does not produce any space, and prohibits a line break at its position.

Encodings

FormatRepresentation of non-breaking space
Unicode and ISO/IEC 1064600A0|NO-BREAK SPACE}}
UTF-8C2}}{{nbsp}}{{code|A0}}
ISO/IEC 8859 (1-16) / ECMA-94A0}}
Windows code pages: 1250, 1251, 1252, 1253, 1254, 1255, 1256, 1257, 1258A0}}
KOI8-R, KOI8-U9A}}
EBCDIC41}} – RSP, Required Space
DOS code pages: 437, 850, 851, 852, 853, 855, 856, 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 869FF}}
HTML (including Wikitext) }} (character entity reference)
{{code| }} or {{code| }} (numeric character references)
TeX~}} (tilde)
HP Roman-8, HP Roman-9A0}}
LICS9A}}
ASCII, ISO/IEC 646Not available

Unicode defines several other non-break space characters. See #Width variation. Encoding remarks:

  • Word joiner, encoded in Unicode 3.2 and above as U+2060, and in HTML as {{code|⁠}} or {{code|⁠}}.
  • Byte order mark (BOM), U+FEFF, which may be interpreted as a "zero width no-break space", a deprecated alternative to word joiner.

Keyboard entry methods

It is rare for national or international standards on keyboard layouts to define an input method for the non-breaking space. An exception is the Finnish multilingual keyboard, accepted as the national standard SFS 5966 in 2008. According to the SFS setting, the non-breaking space can be entered with the key combination AltGr + Space.[10]

Typically, authors of keyboard drivers and application programs (e.g., word processors) have devised their own keyboard shortcuts for the non-breaking space. For example:

System/applicationEntry method
Microsoft WindowsAlt|0|1|6|0}} or {{key press|Alt|2|5|5}} (doesn't always work)
macOSOpt|Space}}
Linux or Unix using X11Compose}}, {{key press|Space}}, {{key press|Space}} or {{key press|AltGr|Space}}
AmigaOSAlt|Space}}
GNU EmacsCtrl|X}} {{key press|8}} {{key press|Space}}
VimCtrl|K}}, {{key press|Space}}, {{key press|Space}}; or {{key press|Ctrl|K}}, {{key press|Shift|N}}, {{key press|Shift|S}}
Dreamweaver, LibreOffice, Microsoft Word,
OpenOffice.org (since 3.0)
Ctrl|Shift|Space}}
FrameMaker, LyX (non-Mac), OpenOffice.org (before 3.0),
WordPerfect
Ctrl|Space}}
Mac Adobe InDesignOpt|Cmd|X}}

Apart from this, applications and environments often have methods of entering unicode entities directly via their code point, e.g. via the Alt Numpad input method. (Non-breaking space has code point 255 decimal (FF hex) in codepage 437 and codepage 850, and code point 160 decimal (A0 hex) in codepage 1252.)

See also

  • Hyphens in computing, for information about hard and non-breaking hyphens
  • List of XML and HTML character entity references
  • Non-breaking hyphen
  • Punctuation
  • Sentence spacing in digital media
  • Space (punctuation)
    • Zero-width space, a non-spacing break
  • Widows and orphans
  • Non-printing character in word processors

Notes

{{NoteFoot}}

References

1. ^{{Cite journal |doi = 10.3998/3336451.0013.105|title = Justify Just or Just Justify|journal = The Journal of Electronic Publishing|volume = 13|year = 2010|last1 = Elyaakoubi|first1 = Mohamed|last2 = Lazrek|first2 = Azzeddine}}
2. ^{{cite web |url=http://www.chicagomanualofstyle.org/qanda/data/faq/topics/SpecialCharacters.html |title=Special Characters |publisher=The Chicago Manual of Style Online}}
3. ^{{Citation | chapter-url = http://www.w3.org/TR/1999/REC-html401-19991224/struct/text.html#h-9.1 | publisher = W3 | date = 1999-12-24 | title = HTML 4.01 | chapter = Structure}}.
4. ^{{Citation | chapter-url = http://www.w3.org/TR/CSS21/text.html#white-space-prop | publisher = W3 | title = CSS 2.1 | chapter = Text}}.
5. ^ISO/IEC 10646-1:1993/FDAM 29:1999(E)
6. ^Mongolian NNBSP-connected suffixes
7. ^{{cite web |url=http://www.verlagsherstellung.de/fileadmin/fbmedien_bmp/downloads/Abschlussarbeiten/Zweisprachige_Mikrotypografie_Amelie_Solbrig_VH-02.pdf |title=Zweisprachige Mikrotypografie |last1=Solbrig |first1=Amelie |date=30 January 2008 |website= |publisher=Hochschule für Technik, Wirtschaft und Kultur Leipzig |access-date=10 June 2018 |quote=Alle Abkürzungen mit Binnenpunkten werden im Deutschen mit einem gFL [geschütztes flexibles Leerzeichen] spationiert. [...] Die englische Schreibweise sieht keine Abstände zwischen einzelnen Buchstaben vor. Nach einem Binnenpunkt folgt demnach ohne gFL sofort der nächste Buchstabe. |language=German| archiveurl=https://web.archive.org/web/20160311073646/http://www.verlagsherstellung.de/fileadmin/fbmedien_bmp/downloads/Abschlussarbeiten/Zweisprachige_Mikrotypografie_Amelie_Solbrig_VH-02.pdf | archivedate=2016-03-11 |page=58 (PDF p. 113) }}
8. ^{{cite web |title=Writing Systems and Punctuation |url=https://www.unicode.org/versions/Unicode7.0.0/ch06.pdf |work=The Unicode Standard 7.0 |publisher=Unicode Inc. |year=2014 |accessdate=2014-11-02}}
9. ^{{cite web |title=CLDR Chart: Numbers |url=https://www.unicode.org/cldr/charts/dev/by_type/numbers.symbols.html#a1ef41eaeb6982d}}
10. ^{{Citation | last = Kotoistus | url = http://www.csc.fi/sivut/kotoistus/nappaimisto.htm | title = Uusi näppäinasettelu | place = CSC – IT Center for Science | language = Finnish, English | date = 2006-12-28 | type = presentation | trans-title = Status of the new keyboard layout | deadurl = yes | archiveurl = https://web.archive.org/web/20110727024039/http://www.csc.fi/sivut/kotoistus/nappaimisto.htm | archivedate = 2011-07-27 | df = }}. Drafts of the Finnish multilingual keyboard.
{{DEFAULTSORT:Non-Breaking Space}}Spatie#Harde spatie

3 : Control characters|Whitespace|Unicode formatting code points

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/9/29 15:22:12