~/plaintextfiles.com/lessons/typography.md|
[←]

Wrapping and typography

Once you have your sentences, lines and paragraphs in order and once you have got comfortable with how you break lines more liberally than you would in a word processor or with pen and paper, we move on to specific characters that have quirks of their own. But before that we need to quickly discuss text wrapping -- a feature that is quite hard to ignore.

Text wrapping

When you write plain text you may notice that your editor is starting new lines for you. This does not always happen. Some editors let you keep writing a really long line that stretches far beyond your screen, forcing you to keep scrolling rightwards. Other editors do not allow that because scrolling horizontally can be cumbersome and can feel unnatural. In such cases they automatically move your text onto a new line when you type all the way to the edge of your application window or screen.

In a word processor the mock sheet of paper tells it when to move to the next line. Since a plain text editor has no such paper, text gets moved onto a new line when based on your application window or screen, i.e., when there is physically no space left to type more text on a line without scrolling horizontally.

But this method of the computer creating new lines is purely visual. The computer does not modify your file by inserting a return/new line character as you would have done if you had wanted to start a new line yourself. That is the structural difference between your computer automatically starting a new line versus you choosing to do that. When the computer does this we call it ‘wrapping’.

There are times when an application wraps by inserting a new line character just as you would have done yourself, but this type of wrapping is something you have to set up in your text editor if you want it to work that way. Right now, we do not have to worry about types of wrapping.

Keeping it simple

In the last lesson we saw how a word processor adds formatting to line breaks as you type, which a plain text file does not do. But those Word processors do not stop at lines. They also add formatting to quotation marks or lists as you type as well. This may seem convenient, but really this is mostly just unnecessary. It is as if two people were writing the same document.

Plain text files do neither of these things. A text editor when working with plain text stores exactly what you type. When you type a list by yourself, you will quickly realise that the computer taking over was not all that convenient anyway.

Bad typographic habits

When you type a quote in English, you can type ‘smart’ quotes where the quotation marks curl towards one side or other, as seen around the word smart in this sentence. Or you can type 'dumb' quotes that do not curl at all and the opening and closing quotes look alike, as around the word dumb in this sentence.

Technically, smart quotes are the proper ones to use. But typing them needs multiple keys (e.g., on macOS you need to hit opt + ] to type an opening single quotation mark and opt + shift + ] to type a closing single quotation mark) so most people simply hit the ' key and move on. Word processors correct this, plain text files do not. This is a good thing -- remember we said in a previous lesson that plain text is transparent and predictable -- not only because it means the file always contains whatever you typed but also because you can type a dumb inverted comma when you actually mean to, e.g. 5'9" means five minutes and nine seconds or five feet and nine inches. Making these quotes smart actually makes the text incorrect and most word processors make this incorrect change unprompted.

Similar things happen with the en dash which is – if you type it straight up (e.g., option + - on macOS) or -- if you type it in plain text. Or with em dashes which is — in appearance (e.g., option + shift + - on macOS) or --- in plain text. Multiple hyphens are clearer too -- you may have already noticed how this website employs multiple hyphens for en dashes by design.

But what if you want smart quotes and dashes in your document? You do not need to change them. When you convert from plain text to a PDF or Word file, this change is automatically made for you. We will learn more about this in a later lesson but for now just know that you can type more simply and more predictably with plain text.

Tabs and spaces

It is worth talking about tab spaces separately because of how often we use them in plain text. We almost never use tabs in word processors.

Think of a tab as four spaces. Some people prefer two while others prefer as many as eight. For most use cases four spaces is a sensible default. This is what a tab looks like:    and although you can hit the tab key on your keyboard to insert an actual tab -- which is different from four spaces -- it is strongly recommended that you insert four actual spaces anyway.

The reason for this is simple: some people may have their tabs set to 2 spaces while others to 4 and still others to 8. Exceptional individuals may have used their highly capable text editors to set some odd number of spaces instead. The end result of this being the same file will look differently spaced depending on how many spaces are set up to mean one tab. Instead, in the true spirit of plain text, use the more fundamental character of the two: us a simple space so that four spaces is always four spaces on anybody’s computer.

Keep in mind you can still type the tab key, but you can set your text editor up to insert four space characters instead of one chimeric tab character. How this is done varies by application, so check the manual or documentation for your text editor. Most operating system default applications may not offer this feature.


This document is part of the plain text lesson plan. If you are ready, you can proceed to the next lesson.