What is word wrap feature

From Wikipedia, the free encyclopedia

Line breaking, also known as word wrapping, is breaking a section of text into lines so that it will fit into the available width of a page, window or other display area. In text display, line wrap is continuing on a new line when a line is full, so that each line fits into the viewable window, allowing text to be read from top to bottom without any horizontal scrolling. Word wrap is the additional feature of most text editors, word processors, and web browsers, of breaking lines between words rather than within words, where possible. Word wrap makes it unnecessary to hard-code newline delimiters within paragraphs, and allows the display of text to adapt flexibly and dynamically to displays of varying sizes.

Soft and hard returns[edit]

A soft return or soft wrap is the break resulting from line wrap or word wrap (whether automatic or manual), whereas a hard return or hard wrap is an intentional break, creating a new paragraph. With a hard return, paragraph-break formatting can (and should) be applied (either indenting or vertical whitespace). Soft wrapping allows line lengths to adjust automatically with adjustments to the width of the user’s window or margin settings, and is a standard feature of all modern text editors, word processors, and email clients. Manual soft breaks are unnecessary when word wrap is done automatically, so hitting the «Enter» key usually produces a hard return.

Alternatively, «soft return» can mean an intentional, stored line break that is not a paragraph break. For example, it is common to print postal addresses in a multiple-line format, but the several lines are understood to be a single paragraph. Line breaks are needed to divide the words of the address into lines of the appropriate length.

In the contemporary graphical word processors Microsoft Word and OpenOffice.org, users are expected to type a carriage return (↵ Enter) between each paragraph. Formatting settings, such as first-line indentation or spacing between paragraphs, take effect where the carriage return marks the break. A non-paragraph line break, which is a soft return, is inserted using ⇧ Shift+↵ Enter or via the menus, and is provided for cases when the text should start on a new line but none of the other side effects of starting a new paragraph are desired.

In text-oriented markup languages, a soft return is typically offered as a markup tag. For example, in HTML there is a <br> tag that has the same purpose as the soft return in word processors described above.

Unicode[edit]

The Unicode Line Breaking Algorithm determines a set of positions, known as break opportunities, that are appropriate places in which to begin a new line. The actual line break positions are picked from among the break opportunities by the higher level software that calls the algorithm, not by the algorithm itself, because only the higher level software knows about the width of the display the text is displayed on and the width of the glyphs that make up the displayed text.[1]

The Unicode character set provides a line separator character as well as a paragraph separator to represent the semantics of the soft return and hard return.

0x2028 LINE SEPARATOR
* may be used to represent this semantic unambiguously
0x2029 PARAGRAPH SEPARATOR
* may be used to represent this semantic unambiguously

Word boundaries, hyphenation, and hard spaces[edit]

The soft returns are usually placed after the ends of complete words, or after the punctuation that follows complete words. However, word wrap may also occur following a hyphen inside of a word. This is sometimes not desired, and can be blocked by using a non-breaking hyphen, or hard hyphen, instead of a regular hyphen.

A word without hyphens can be made wrappable by having soft hyphens in it. When the word isn’t wrapped (i.e., isn’t broken across lines), the soft hyphen isn’t visible. But if the word is wrapped across lines, this is done at the soft hyphen, at which point it is shown as a visible hyphen on the top line where the word is broken. (In the rare case of a word that is meant to be wrappable by breaking it across lines but without making a hyphen ever appear, a zero-width space is put at the permitted breaking point(s) in the word.)

Sometimes word wrap is undesirable between adjacent words. In such cases, word wrap can usually be blocked by using a hard space or non-breaking space between the words, instead of regular spaces.

Word wrapping in text containing Chinese, Japanese, and Korean[edit]

In Chinese, Japanese, and Korean, word wrapping can usually occur before and after any Han character, but certain punctuation characters are not allowed to begin a new line.[2] Japanese kana, letters of the Japanese alphabet, are treated the same way as Han Characters (Kanji) by extension, meaning words can, and tend to be broken without any hyphen or other indication that this has happened.

Under certain circumstances, however, word wrapping is not desired. For instance,

  • word wrapping might not be desired within personal names, and
  • word wrapping might not be desired within any compound words (when the text is flush left but only in some styles).

Most existing word processors and typesetting software cannot handle either of the above scenarios.

CJK punctuation may or may not follow rules similar to the above-mentioned special circumstances. It is up to line breaking rules in CJK.

A special case of line breaking rules in CJK, however, always applies: line wrap must never occur inside the CJK dash and ellipsis. Even though each of these punctuation marks must be represented by two characters due to a limitation of all existing character encodings, each of these are intrinsically a single punctuation mark that is two ems wide, not two one-em-wide punctuation marks.

Algorithm[edit]

Word wrapping is an optimization problem. Depending on what needs to be optimized for, different algorithms are used.

Minimum number of lines[edit]

A simple way to do word wrapping is to use a greedy algorithm that puts as many words on a line as possible, then moving on to the next line to do the same until there are no more words left to place. This method is used by many modern word processors, such as OpenOffice.org Writer and Microsoft Word.[citation needed] This algorithm always uses the minimum possible number of lines but may lead to lines of widely varying lengths. The following pseudocode implements this algorithm:

SpaceLeft := LineWidth
for each Word in Text
    if (Width(Word) + SpaceWidth) > SpaceLeft
        insert line break before Word in Text
        SpaceLeft := LineWidth - Width(Word)
    else
        SpaceLeft := SpaceLeft - (Width(Word) + SpaceWidth)

Where LineWidth is the width of a line, SpaceLeft is the remaining width of space on the line to fill, SpaceWidth is the width of a single space character, Text is the input text to iterate over and Word is a word in this text.

Minimum raggedness[edit]

A different algorithm, used in TeX, minimizes the sum of the squares of the lengths of the spaces at the end of lines to produce a more aesthetically pleasing result. The following example compares this method with the greedy algorithm, which does not always minimize squared space.

For the input text

AAA BB CC DDDDD

with line width 6, the greedy algorithm would produce:

------    Line width: 6
AAA BB    Remaining space: 0
CC        Remaining space: 4
DDDDD     Remaining space: 1

The sum of squared space left over by this method is 0^{2}+4^{2}+1^{2}=17. However, the optimal solution achieves the smaller sum 3^{2}+1^{2}+1^{2}=11:

------    Line width: 6
AAA       Remaining space: 3
BB CC     Remaining space: 1
DDDDD     Remaining space: 1

The difference here is that the first line is broken before BB instead of after it, yielding a better right margin and a lower cost 11.

By using a dynamic programming algorithm to choose the positions at which to break the line, instead of choosing breaks greedily, the solution with minimum raggedness may be found in time O(n^{2}), where n is the number of words in the input text. Typically, the cost function for this technique should be modified so that it does not count the space left on the final line of a paragraph; this modification allows a paragraph to end in the middle of a line without penalty. It is also possible to apply the same dynamic programming technique to minimize more complex cost functions that combine other factors such as the number of lines or costs for hyphenating long words.[3] Faster but more complicated linear time algorithms based on the SMAWK algorithm are also known for the minimum raggedness problem, and for some other cost functions that have similar properties.[4][5]

History[edit]

A primitive line-breaking feature was used in 1955 in a «page printer control unit» developed by Western Union. This system used relays rather than programmable digital computers, and therefore needed a simple algorithm that could be implemented without data buffers. In the Western Union system, each line was broken at the first space character to appear after the 58th character, or at the 70th character if no space character was found.[6]

The greedy algorithm for line-breaking predates the dynamic programming method outlined by Donald Knuth in an unpublished 1977 memo describing his TeX typesetting system[7] and later published in more detail by Knuth & Plass (1981).

See also[edit]

  • Non-breaking space
  • Typographic alignment
  • Zero-width space
  • Word divider
  • Word joiner

References[edit]

  1. ^ Heninger, Andy, ed. (2013-01-25). «Unicode Line Breaking Algorithm» (PDF). Technical Reports. Annex #14 (Proposed Update Unicode Standard): 2. Retrieved 10 March 2015. WORD JOINER should be used if the intent is to merely prevent a line break
  2. ^ Lunde, Ken (1999), CJKV Information Processing: Chinese, Japanese, Korean & Vietnamese Computing, O’Reilly Media, Inc., p. 352, ISBN 9781565922242.
  3. ^ Knuth, Donald E.; Plass, Michael F. (1981), «Breaking paragraphs into lines», Software: Practice and Experience, 11 (11): 1119–1184, doi:10.1002/spe.4380111102, S2CID 206508107.
  4. ^ Wilber, Robert (1988), «The concave least-weight subsequence problem revisited», Journal of Algorithms, 9 (3): 418–425, doi:10.1016/0196-6774(88)90032-6, MR 0955150.
  5. ^ Galil, Zvi; Park, Kunsoo (1990), «A linear-time algorithm for concave one-dimensional dynamic programming», Information Processing Letters, 33 (6): 309–311, doi:10.1016/0020-0190(90)90215-J, MR 1045521.
  6. ^ Harris, Robert W. (January 1956), «Keyboard standardization», Western Union Technical Review, 10 (1): 37–42.
  7. ^ Knuth, Donald (1977), TEXDR.AFT, retrieved 2013-04-07. Reprinted in Knuth, Donald (1999), Digital Typography, CSLI Lecture Notes, vol. 78, Stanford, California: Center for the Study of Language and Information, ISBN 1-57586-010-4.

External links[edit]

  • Unicode Line Breaking Algorithm

Knuth’s algorithm[edit]

  • «Knuth & Plass line-breaking Revisited»
  • «tex_wrap»: «Implements TeX’s algorithm for breaking paragraphs into lines.» Reference: «Breaking Paragraphs into Lines», D.E. Knuth and M.F. Plass, chapter 3 of _Digital Typography_, CSLI Lecture Notes #78.
  • Text::Reflow — Perl module for reflowing text files using Knuth’s paragraphing algorithm. «The reflow algorithm tries to keep the lines the same length but also tries to break at punctuation, and avoid breaking within a proper name or after certain connectives («a», «the», etc.). The result is a file with a more «ragged» right margin than is produced by fmt or Text::Wrap but it is easier to read since fewer phrases are broken across line breaks.»
  • adjusting the Knuth algorithm to recognize the «soft hyphen».
  • Knuth’s breaking algorithm. «The detailed description of the model and the algorithm can be found on the paper «Breaking Paragraphs into Lines» by Donald E. Knuth, published in the book «Digital Typography» (Stanford, California: Center for the Study of Language and Information, 1999), (CSLI Lecture Notes, no. 78.)»; part of Google Summer Of Code 2006
  • «Bridging the Algorithm Gap: A Linear-time Functional Program for Paragraph Formatting» by Oege de Moor, Jeremy Gibbons, 1997

Other word-wrap links[edit]

  • the reverse problem — picking columns just wide enough to fit (wrapped) text (Archived version)
  • «Knuth linebreaking elements for Formatting Objects» by Simon Pepping 2006. Extends the Knuth model to handle a few enhancements.
  • «a Knuth-Plass-like linebreaking algorithm … The *really* interesting thing is how Adobe’s algorithm differs from the Knuth-Plass algorithm. It must differ, since Adobe has managed to patent its algorithm (6,510,441).»[1]
  • «Line breaking» compares the algorithms of various time complexities.

Updated: 08/02/2020 by

Word wrap may refer to any of the following:

1. Sometimes called a run around and wrap around, word wrap is a feature in text editors and word processors. It moves the cursor to the next line when reaching the end without requiring you to press Enter. For example, in the picture below, as each section shrinks, the sentence is wrapped, so it doesn’t extend past the border. You can see a live example of how text wraps by resizing the browser window on this page.

Word wrap

  • Live example of word wrap
  • Why is word wrapping used?
  • Turning off word wrap.
  • Why would someone turn off word wrap?
  • How to wrap text at a certain number of characters.

Live example of word wrap

In textarea fields, the cursor automatically moves to the next line when it reaches the edge of the box. You can test this in the textarea below.

Why is word wrapping used?

Word wrapping is used to help contain text within an area and to prevent text from being cut off or missed. For example, all of the text on this page is wrapped in an HTML div tag for easy reading. If there were no word wrapping, you would have to scroll horizontally (left-to-right) instead of vertically (up and down) on any long line of text.

Turning off word wrap

Word wrap button examples

Word wrap is often set up by default and can be turned off by enabling hyphenation, clicking the word wrap button, or adjusting the program’s settings. The picture shows an example of what a word wrap button may look like or resemble for programs that have the option.

Note

If word wrap is disabled, when typing, the line of text continues horizontally on the same line until Enter is pressed.

Why would someone turn off word wrap?

When working with files that contain long lines of text, it may be easier to view and find text with word wrap turned off. For example, if you had a .csv file with several values per line, you can see the beginning of each row more easily if you disable word wrap.

How to wrap text at a certain number of characters

You can use our text tool to wrap any text at a certain length. For example, if you wanted to wrap your text at 100 character length you can paste your text into the tool and enter «100» into the «wrap text at» section.

2. In Microsoft Excel and other spreadsheet programs, word wrap is more commonly called Wrap Text.

Alignment, Soft return, Text wrap, Word, Word processor terms

What Does Word Wrap Mean?

Word wrap is a word processing feature that forces all text to be confined within defined margins. When a line of text is filled, the word processor automatically moves the text to the next line, so the user doesn’t have to press the return key after every line. Word wrap also occurs if the document’s margins are changed.

Techopedia Explains Word Wrap

Word wrap is a text editor or word processor feature that breaks lines between words to adjust them within specified margins. This action is performed on the fly; if the user changes the margin, the line is automatically repositioned to ensure that the text is within margins and is visible.

Breaks that occur as a result of word wrapping are called soft returns, while hard returns create new paragraphs. Soft returns are placed at the end of complete words or following the punctuation at the end of a sentence. Words without hyphens may also be wrapped to the following line using soft hyphens.

Word wrapping is performed using algorithms. It is generally implemented based on minimum word length to provide the best appearance and readability.

Last Update: Jan 03, 2023

This is a question our experts keep getting from time to time. Now, we have got the complete detailed explanation and answer for everyone, who is interested!


Asked by: Mr. Christian Erdman

Score: 4.1/5
(54 votes)

Sometimes referred to as a run around and wrap around, word wrap is a feature in text editors and word processors. It moves the cursor to the next line when reaching the end without requiring you to press Enter .

How do I wrap text in Notepad?

Step 1: Open Notepad. Step 2: Click the Format tab at the top of the window. Step 3: Select the Word Wrap option from this menu. Note that this setting persists through different files, and as you open and close Notepad.

What is word wrap in word?

: a word processing feature that automatically transfers a word for which there is insufficient space from the end of one line of text to the beginning of the next.

What is word wrap example?

An example of word wrap is the automatic moving of the words on a long line of words to fit the words within a cell on a spreadsheet. A word processing feature that moves words to the next line automatically as you type based on the current right margin setting. … Words exceeding the margins are set to begin a new line.

How do I turn off word wrap in Notepad?

  1. Click the Windows “Start” button.
  2. Enter “Notepad” into the search box and double-click the application from the list of search results that appears. The Notepad application opens.
  3. Click “Format” from the main menu in Notepad to display the formatting drop-down menu. …
  4. Click “Word Wrap” to remove line endings.

28 related questions found

What is the purpose of word wrap?

Most word processing programs use word wrap to keep the text within the default margins of the page. Without the word wrap feature, text would continue on one line until the user pressed «Enter» or «Return» to insert a line break.

What is the extension of file with which Notepad document is saved?

Features. Notepad is a text editor, i.e., an app specialized in editing plain text. It can edit text files (bearing the «. txt» filename extension) and compatible formats, such as batch files, INI files, and log files.

Where can you find the wrap text option in a word document?

Go to Picture Tools > Format > Wrap Text. Choose a layout.

What is word wrap Class 9?

Word wrapping is a process by which the word which comes at the end of the line. is automatically moved onto a line in order to keep the text within the margins.

What are the 4 alignment options?

There are four main alignments: left, right, center, and justified.

What is word wrap and alignment What are the types of alignment?

Alignment: Alignment refers to the way text is arranged in the document between the margins. In horizontal alignment, paragraphs of text can be left aligned (flush against the left margin), right aligned (flush against the right margin), or centered (each line within the paragraph centered between the margins).

What is difference between format and editing?

Answer: Editing refers to making quick modification to a document using editing tools such as find and replace spelling and grammar checkers,copy and paste or undo redo features. Formatting refers to changing the appearance of text in a document such as text formatting or page formatting or paragraph formatting.

How do you wrap text in EditPlus?

Whilst in EditPlus > Tools > Preference > File > Settings & syntax > Word Wrap > Tick “Enable word wrap” > OK > Apply > OK.

How do you make lines in Notepad?

Follow the below steps to try it out:

  1. Open your Notepad++ by double-clicking the shortcut or searching it through the Windows search feature. …
  2. Click on the View menu in the menu bar and choose the Word Wrap option on the list. …
  3. This will adjust the lines according to your Notepad++ window size.

How do I get rid of Word Wrap?

Right-click the control for which you want to enable or disable text wrapping, and then click Control Properties on the shortcut menu. Click the Display tab. Select or clear the Wrap text check box.

What do you mean by previewing a document Class 9?

)In word processing, previewing refers to formatting a document for the printer, but then displaying it on the display screen instead of printing it. Previewing allows you to see exactly how the document will appear when printed.

What is text alignment Class 9?

Text alignment is a word processing software feature that allows users to horizontally align text on a page/document. It enables the composition of a text document using different text positioning on the whole or selected part of a page.

Is used for finding and replacing words in text?

Find and Replace helps you to find words or formats in a document and can let you replace all instances of a word or format. This is particularly handy in long documents. To use Find and Replace, use the shortcut Ctrl+H or navigate to Editing in the Home tab of the ribbon, then choose Replace.

How do I open an embedded document?

Launch Microsoft Word. When adding attachments to an existing Word document, click the “File” tab, click “Open,” and then browse to and double-click the Word file. Scroll to the place in the document where the attachment should go and press the “Enter” key for a line break press “Ctrl-Enter” to add a new page.

How do I wrap text around a picture in Word 2010?

To wrap text around an image:

  1. Select the image. The Format tab will appear.
  2. Click the Format tab.
  3. Click the Wrap Text command in the Arrange group.
  4. Select the desired menu option. The text will adjust based on the option you have selected. …
  5. Move the image around to see how the text wraps for each setting.

How do you clear the formatting in Word?

Clear formatting from text

  1. Select the text that you want to return to its default formatting.
  2. In Word: On the Edit menu, click Clear and then select Clear Formatting. In PowerPoint: On the Home tab, in the Font group, click Clear All Formatting .

How do I save a .TXT file without an extension?

When you save the file, just put the file name in double quotes, e.g. «johns. bat» will save the file as johns. bat with no . txt extension.

How do you remove .txt extension?

txt, we remove its file extension by performing the following steps.

  1. Right-click the file (not the shortcut).
  2. Select Rename in the menu.
  3. Erase the . txt from myfile. txt and press Enter .
  4. Click Yes on the warning about the file becoming unusable if you’re sure you want to delete the file name extension.

How do I convert a Notepad file?

How TO CONVERT NOTEPAD BACK TO DOCUMENT FILES That are legible

  1. Launch Word and open the text file. …
  2. Click File, and then click Save As. …
  3. Open the menu next to Save As Type, and then select Word Document to select the . …
  4. Click Save to perform the conversion.

Table of Contents

  1. What is a word wrap feature?
  2. What is word wrap in Word?
  3. What is the purpose of word wrap feature of MS Word?
  4. What is the meaning of wrap text?
  5. What is the function of wrap text?
  6. What is text wrapping give example?
  7. What is text wrapping and anchoring?
  8. What is text wrapping 9?
  9. What is text wrapping in open office?
  10. What is the difference between text wrapping and anchoring in open office writer?
  11. What is the difference between anchoring and text wrapping?
  12. How can you set text to wrap automatically in Calc?
  13. How do you warp text in Open Office Calc?
  14. How do I justify WPS?
  15. How do you add bullets to WPS?
  16. How do I get the WPS ruler?
  17. How do I get rid of WPS gridlines?

: a word processing feature that automatically transfers a word for which there is insufficient space from the end of one line of text to the beginning of the next.

What is word wrap in Word?

Word wrap is a word processing feature that forces all text to be confined within defined margins. When a line of text is filled, the word processor automatically moves the text to the next line, so the user doesn’t have to press the return key after every line.

What is the purpose of word wrap feature of MS Word?

Word wrap is the additional feature of most text editors, word processors, and web browsers, of breaking lines between words rather than within words, where possible.

What is the meaning of wrap text?

Text wrap is a feature supported by many word processors that enables you to surround a picture or diagram with text. The text wraps around the graphic. Text wrap is also called text flow.

What is the function of wrap text?

1. In Microsoft Excel and other spreadsheet programs, Wrap Text is a feature that shows all information in a cell, even if it overflows the cell boundary.

What is text wrapping give example?

text wrapping is a feature supported by many of word processor that allow us to surround a the picture or a diagram with a text.

What is text wrapping and anchoring?

Text wrapping is making the text reflow along the boundaries of the frame or the object. When you insert an image over text, the text normally wraps itself around the frame of the image (which is usually rectangular) but not the image itself (which can have a contour).

What is text wrapping 9?

Answer: Word wrapping is a process by which the word which comes at the end of the line. is automatically moved onto a line in order to keep the text within the margins.

What is text wrapping in open office?

The Wrap setting determines the relation between the text and the graphic. Several possibilities are provided: No Wrap. With this option the text is placed above and below the image but not around it.

What is the difference between text wrapping and anchoring in open office writer?

Anchoring refers to the reference point for the graphics. Text wrapping refers to the relation of graphics to surrounding text, which may wrap around the graphic on one or both sides, be overprinted behind or in front of the graphic, or treat the graphic as a separate paragraph or character.

What is the difference between anchoring and text wrapping?

1. Text wrapping is a feature that enables you to surround a picture or diagram with a text. 2. Anchoring is the use of irrelevant information, such as the purchase price of a security, as a reference for evaluating an unknown value of a financial instrument.

How can you set text to wrap automatically in Calc?

For those wanting to wrap all of their already existing cells in a spreadsheet, simply execute Ctrl + A , following by Ctrl + C , and finally Ctrl + V . You can use Format > Cells > Alignment to have a variety of effects including Wrap text automatically .

How do you warp text in Open Office Calc?

Wrap Text in OpenOffice.org Spreadsheet Cells

  1. Select the cell or cells with the text you want to wrap.
  2. Right-click and select Format Cells.
  3. Click the alignment tab.
  4. In the Properties area, check the Automatic line break box.
  5. Click OK.

How do I justify WPS?

You can now open WPS Office on your mobile and check your fonts out. As you can see, the text is aligned to the left margin meaning that not all of the text will align to the right margin. Include your email address to get a message when this question is answered. ; Click the Justify button to justify your text.

How do you add bullets to WPS?

Insert Bullets A simple way just go to Home > Bullets Button. If you want to set other bullet styles, please click the drop-down arrow which is next to the Bullets Button. Select More Bullets, it will pop up a Bullets and Numbering dialog box.

How do I get the WPS ruler?

Show or Hide Ruler in Writer 2016 Choose the Ruler check box in the View tab to display the ruler in the main window of Writer 2016. 1. Drag the Hanging Indent marker to change the starting position of all lines except the first line.

How do I get rid of WPS gridlines?

Show or Hide Gridlines in WPS Writer 2016 Step 1: Select the View Gridlines check box in the View tab and the gridlines will be shown on the screen. Step 2: Deselect the Gridlines check box to remove the gridlines.

Понравилась статья? Поделить с друзьями:
  • What is word wrap around
  • What is word wide web
  • What is word wars
  • What is word vomit
  • What is word verification