2

If I use < to represent the setting "align left" and > to represent the setting "align right" what symbol should I use for "align center"? Is there any de facto standard for this? The symbol has to be an ASCII character the user can type on a US keyboard layout.

Context

I am working on the command line interface of a console application for Unix-like operating systems that can output pseudographical tables, like so:

┌─────┬─────┬────────┬─────┐
│ PID │ TTY │  TIME  │ CMD │
├─────┼─────┼────────┼─────┤
│ 8580│pts/1│00:00:00│  ps │
├─────┼─────┼────────┼─────┤
│28075│pts/1│00:00:01│ zsh │
└─────┴─────┴────────┴─────┘

The application can be told to align the text in each column left, right or center. To make it do that the user gives it the command line option -align LIST where LIST is a list of words "left", "right" or "center" where each word corresponds to one column, e.g., -align 'left left right center'.

I found that having to write each word in full takes too much effort. I intend to introduce l (a small L), r and c as shortcuts (which has precedent in LaTeX) but I also want to offer another, more graphical set of shortcut characters that would be easier to understand at a glace, say, when reading a shell script. Since using <, > for "left" and "right" respectively seems inevitable I am looking for the third unknown symbol to go with those two.

  • 1
    How about - or ^? – kontur Nov 23 '15 at 21:20
  • 2
    Or pipe |. I'd mix pipe with brackets, like bookends. [ | ] – Kip Nov 24 '15 at 0:12
  • + looks nice and symmetrical: <+>. I would use letters, like in Latex table formatting: l c r. Pipe (|) means vertical divider (bar), & is column separator. – Stefan Jun 22 at 7:54
2

Maybe "|"? (That's shift-backslash.)

1

^ might be read as 'up'

| might be read as 'concatenate' or 'OR' or a cell boundary

How about using #

1

< means "left-side padding is smaller than right-side padding"
> means "left-side padding is larger than right-side padding"
So to express "left-side padding is equal to right-side padding", I would use =.

It has the benefit of already being related to < and >, and it looks roughly similar but with clear differences. It also doesn't imply any other direction (like up or down), but rather a balance, which is precisely what we want.

Other symbols I might consider are #, *, ¤, and _, but I think that = would be the most obvious in context.

  • 1
    The equals sign = looks a bit like two lines of text – justified ones. Even though justification is not (yet) to be supported, | and other vertical characters, incl. ! and $, seem more appropriate, at least by graphic analogy. The generic currency symbol ¤ is neither easy to type nor in US-ASCII. – Crissov Nov 24 '15 at 20:12
  • @Crissov maybe I'm misunderstanding, but how would you ever justify text in a CLI (especially since there hasn't even been mention of multi-line support)? Using a thin, vertical character (even if they are "centered") for a horizontal setting seems like it would be less effective. My bad on ¤, though. – Jacob Raihle Nov 25 '15 at 8:41
  • You could justify with multiple space characters instead of one. It won’t be useful most of the time, though. – Crissov Nov 25 '15 at 19:40
1

What about

< T >

or

< ǁ >

  • Could you add some reasoning why T or || would be a good choice? – locationunknown Nov 25 '15 at 10:04
  • Sure, it visually looks like center of something. – FrankL Dec 11 '15 at 12:22
0

You should go for one of the keys close by.

enter image description here

A good example for this is Mac Text Editor. The shortcuts in the editor for text alignment are as below. If you check the keyboard, the three keys { } | lie together in a similar way.

enter image description here

It is important to understand that, text formatting shortcuts can be dependent on the OS. For example, Evernote keeps the text alignment shortcuts similar to Microsoft Office for their Windows version (source) while it provides shortcuts similar to MacOS Text Editor for Mac users (source).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.