What is a vertical tab? - character-encoding

What was the original historical use of the vertical tab character (\v in the C language, ASCII 11)?
Did it ever have a key on a keyboard? How did someone generate it?
Is there any language or system still in use today where the vertical tab character does something interesting and useful?

Vertical tab was used to speed up printer vertical movement. Some printers used special tab belts with various tab spots. This helped align content on forms. VT to header space, fill in header, VT to body area, fill in lines, VT to form footer. Generally it was coded in the program as a character constant. From the keyboard, it would be CTRL-K.
I don't believe anyone would have a reason to use it any more. Most forms are generated in a printer control language like postscript.
#Talvi Wilson noted it used in python '\v'.
print("hello\vworld")
Output:
hello
world
The above output appears to result in the default vertical size being one line. I have tested with perl "\013" and the same output occurs. This could be used to do line feed without a carriage return on devices with convert linefeed to carriage-return + linefeed.

Microsoft Word uses VT as a line separator in order to distinguish it from the normal new line function, which is used as a paragraph separator.

In the medical industry, VT is used as the start of frame character in the MLLP/LLP/HLLP protocols that are used to frame HL-7 data, which has been a standard for medical exchange since the late 80s and is still in wide use.

It was used during the typewriter era to move down a page to the next vertical stop, typically spaced 6 lines apart (much the same way horizontal tabs move along a line by 8 characters).
In modern day settings, the vt is of very little, if any, significance.

The ASCII vertical tab (\x0B)is still used in some databases and file formats as a new line WITHIN a field. For example:
In the .mer file format to allow new lines within a data field,
FileMaker databases can use vertical tabs as a linefeed (see https://support.microsoft.com/en-gb/kb/59096).

I have found that the VT char is used in pptx text boxes at the end of each line shown in the box in oder to adjust the text to the size of the box.
It seems to be automatically generated by powerpoint (not introduced by the user) in order to move the text to the next line and fix the complete text block to the text box. In the example below, in the position of §:
"This is a text §
inside a text box"

A vertical tab was the opposite of a line feed i.e. it went upwards by one line. It had nothing to do with tab positions. If you want to prove this, try it on an RS232 terminal.

similar to R0byn's experience, i was experimenting with a Powerpoint slide presentation and dumped out the main body of text on the slide, finding that all the places where one would typically find carriage return (ASCII 13/0x0d/^M) or line feed/new line (ASCII 10/0x0a/^J) characters, it uses vertical tab (ASCII 11/0x0b/^K) instead, presumably for the exact reason that dan04 described above for Word: to serve as a "newline" while staying within the same paragraph. good question though as i totally thought this character would be as useless as a teletype terminal today.

I believe it's still being used, not sure exactly. There might be even a key combination of it.
As English is written Left to Right, Arabic Right to Left, there are languages in world that are also written top to bottom. In that case a vertical tab might be useful same as the horizontal tab is used for English text.
I tried searching, but couldn't find anything useful yet.

Related

Special unicode characters in TButton.Caption (instead of icons)

Is it possible to enter from keyboard special Unicode characters, link the ones below?
U+2603 ☃ SNOWMAN
U+2604 ☄ COMET
U+2605 ★ BLACK STAR
U+2606 ☆ WHITE STAR
U+2607 ☇ LIGHTNING
U+2608 ☈ THUNDERSTORM
U+2609 ☉ SUN
U+260A ☊ ASCENDING NODE
U+260B ☋ DESCENDING NODE
I would like for example to have buttons with up/down arrows in them, without loading images.
I have tried entering Alt+08593 on keyboard but other character (than the expected arrow) will be inserted.
Update:
The reason for this is LAZINESS. I am too lazy to search for icons or create my own icons. For example you can simply replace the notorious 'save' floppy disk icon. Just take a look at: 💾. BAM! Nice. Right?
Update:
It seems some characters such as 📗 (green book = 128215) are not accepted by Delphi, with copy/paste.
Update:
There is nice component that allows you to put unicode chanracters in a image list:
https://github.com/EtheaDev/IconFontsImageList
The Delphi IDE won't accept ALT key codes that high. A couple of alternatives:
Paste the text from somewhere else.
Enter the numeric code directly in the .dfm file.
As an example of the second approach, try this in your .dfm file for the button caption property:
Caption = #8592#8593#8594#8595
You also mention Green Book U+1F4D7. That is from outside the BMP, and hence encoded with a surrogate pair:
Caption = #55357#56535
My guess is that as soon as you want your glyphs to be shown in colour, or at a different size, you will find that using text makes this impossible. You are also likely to encounter fonts that don't contain glyphs for the characters you select. So you will find that using images is the most robust approach.
Or, alternatively, if you had a table of the decimal values:
9731 ☃ SNOWMAN
9732 ☄ COMET
9733 ★ BLACK STAR
9734 ☆ WHITE STAR
9735 ☇ LIGHTNING
9736 ☈ THUNDERSTORM
9737 ☉ SUN
9738 ☊ ASCENDING NODE
9739 ☋ DESCENDING NODE
then you can use the keyboard as follows in Delphi.
To change the caption of Button1 to be the snowman:
Press Alt+F12 to edit the form as text
Press Ctrl+E to enter incremental search mode
Type Button1, or as much of it as is required to locate the definition of Button1
To the right of the Caption = property definition (I'm assuming VCL here) enter # followed by the relevant Unicode value, e.g. #9731
Caption = #9731
If you want text as well as the snowman, the character code goes outside quotes, so e.g.
Caption = 'Snowman = '#9731
More info on the # syntax (which is more commonly entered in Delphi source, rather than in the text view of form files) can be found by reading about control strings, as they are actually called, in the online documentation.

Delphi IDE Line Length

In Delphi 7 IDE, do the lines need to be a given length? I see a gray line in some Delphi code I'm working with, and it looks like ever line ends right before it.
It's called the right margin. It is intended as a guide to help you avoid writing lines that are too long and exceed your coding standards. You can switch it off from the Editor Options, as I have done here:
It's just a guide to line length. Some people don't like long lines because they can be hard to read on different resolutions or when doing comparisons.
That gray line is called the margin.
You can set its visibility and position in the Editor Properties at the Display tab in the Margin and gutter groupbox.
The margin is a visual assistent. The standard position is 80 characters, which defaults to the maximum unscrolled size of many source formatting output media, such as the one used here at Stack Overflow. Originally, it had something to do with the paper width on (matrix) printers. Maybe it still does.

How to insert special characters when writing to a text file with LaTex

This is my first post here. I can usually find what I'm looking for using questions other people have asked, but this time I'm stumped. Please can anyone help?
I'm trying to get Latex to generate a text file every time it is compiled (this bit I can do). I need the text file to have the following format
text text
I have found out how to output a text file from LaTex, but I can't get it to insert a tab, only a space. A post here on StackOverflow shows how to include the backslash character in the text output using the following code:
\makeatletter
\immediate\write\outputfile{text \#backslashchar text}
\makeatother
I'm sure that something similar must work for inserting a tab, but I can't find a solution.
If anyone here knows how to do this I would be very, very grateful.
Many thanks!
There is no counterpart to the concept of a tab in (La)TeX, except when you are aligning the columns in a table. If what you meant by a tab is indentation at the beginning of a paragraph, that is considered a matter of design. Namely, the \parindent parameter specifies the distance that each paragraph should be indented. There is no 'tab' character that occupies the initial position of each paragraph.
However, you can forcefully insert a space in an arbitrary position. For example, use \hspace{distance}, where distance can be something like '3em' (3 times the width of m) or '1cm'.

How to fully justify texts programmatically (Delphi)?

How can I fully justify a block of text (like MS Word does, not only on the right and not only on the left but on both sides)?
I want to justify some texts (mainly arabic text) adjusted to certain screen size (some handheld device screen actually, and its text viewer doesn't have this function) and save this text as justified. So I can reload and reuse it again elsewhere.
(The problem with MS word is, that if you copy the justified text from MS Word and paste it to another editor it'll copy it un-justified).
Update : for now I'm thinking of doing it like this:
get-a-word
get-word-width
add-word-to-total-Word and add-Word-width-to-total-word-width
check if total-Word-width = myscreen-width then continue
else if total-Word-width is between myscree-wdith and (myscreen-width -3) then
add-spaces-To-total-word until it = myscreen-width
This is what I'm thinking now, but I put this question up and hope to see if there is a better solution, or somebody else already implemented it.
PS: I hope I have made my question clear and I'm sorry for bad expression if there is.
edit1 : changed the title to make it more clear.
If you want to justify plain text, you can only add extra spaces to the lines to get them align on the left and right. Unfortunately the character widths differ in fonts; so doing it this way will only work for a certain font, unless you limit yourself to monospaced fonts where all characters have the same size.
If you want a result like in Word, adding spaces won't cut it. Word will not add spaces, but stretch and shrink the existing spaces. This information is lost when you copy and paste it into another app.
Either way, justifying is an optimization problem. If you are interested in a good solution and its implementation: have a look a TeX. For an implementation that works on plain text with monospaced fonts have a look at par
There are some API calls that may help:
ExtTextOut and GetCharacterPlacement
Look at the GCP_JUSTIFY flag for GetCharacterPlacement
ExtTextOut is used by Canvas.TextRect
The problem you are going to face is always going to be differences in the rendering of the font. Word handles full justification by adjusting kerning as well as adjusting the number of pixels between words by a few (either way). The end result is lined up both margins. This pixel adjustment is done BOTH ways, and as evenly as possible.
To properly handle this in your portable device you will have to also perform the same algorithm for the display of the text there.
If this is not possible, then the ONLY way you can even get somewhat close would be to add whitespace between words.
As has been pointed out in other answers Word does full justification by stretching the existing spaces often by very small amounts. This is only possible if you have full control over how your text is drawn on the screen (which word - or any other windows program has).
You only real option in this regard would be to implement your own text viewer on the platform you are targeting. Eg you would need to draw the text on the screen yourself (any platform that allows games should allow you to draw on the screen). However this seems like an awful lot of trouble to get justified text.
Sorry couldn't be of more help.

How do I prevent LaTeX from padding spaces between paragraphs so that next section begins at top of next page?

I have a two-column paper where space restrictions are very tight.
I just looked at my last version of the manuscript and saw that the upper half contains a figure (as expected), but in the lower half there is a lot of vertical space between paragraphs (enough to squeeze 10 more lines), and that LaTeX probably added it so that in the beginning of the next page a new numbered section will begin at the top of the page.
I know there's a way to adjust this so LaTeX doesn't try so hard, but I'm not sure how. any help? Thanks!
The parameter that controls inter-paragraph spacing is called \parskip(See Paragraph Spacing ). You set it (with "rubber" values) using something like:
\setlength{\parskip}{1cm plus4mm minus3mm}
The defualt value of \parskip is class dependent. The "plus" and "minus" parts tell TeX how much it can adjust the value to improve the layout (that is they make the spacing elastic, thus the "rubber" designation). Reducing (or eliminating) the "plus" part of the rubber might help.
Watch out though, you can cause other layout artifacts if you constrain TeX too much.
Other things to think about:
The widow and club penalties probably apply section headings, and may be affecting TeX's layout choices (see https://stackoverflow.com/questions/512967/how-can-one-keep-a-section-from-being-at-the-end-of-a-page-in-latex for a discussion).
You may also want to consider messing with \baselineskip which controls the allowed spacing between lines of text and can also have rubber values.
This is a common problem, and there are probably some fairly sophisticated treatments already prepared on CTAN.
\vfill before the new section worked perfectly for me.

Resources