Thanks for coming to InDesignSecrets.com, the world's #1 resource for all things InDesign!

6 ways to type the Pi symbol in InDesign

My youngest son informed me today that we are 10 days from Pi day (in the US). 3.14.2014…get it? Anyway, I know that Pi holds a special place in David’s heart, so here is a list of 6 ways to type the Pi symbol in InDesign. Granted, methods 2-6 are much harder than number 1, but read on, you might learn something!

Don't forget to add a drop shadow to your Pi symbol to make it extra fancy.

Don’t forget to add a drop shadow to your Pi symbol to make it extra fancy.

1. The easy way, (for those who like to do things the easy way), is to just type option+p on a Mac, or alt+227 on the numeric keypad on Windows. This is assuming you are on a US keyboard. Possibly/probably different in the rest of the world.

2. Use the Glyphs panel. Choose Window > Type and Tables > Glyphs, and choose “Greek” from the drop down menu at the top. Then you should be able to find the pi symbol a few rows down in the panel. Double-click on the symbol to insert it at the current text insertion point.

The Glyphs panel

The Glyphs panel

3. Admittedly, this one is twisted (CS6 or later required): Click inside a text frame, and choose Type > Fill With Placeholder Text while holding down the command key (Mac) or ctrl key (Windows). In the Place Holder Options dialog box, choose Greek from the drop down list, and click the OK button. Greek text will be generated, and chances are, there will be a pi symbol somewhere in the mix. Delete everything except the Pi symbol. Admittedly, not very efficient!

ScreenSnapz003

4. Use Peter Kahrel’s free “Compose” script. This script makes entering various accented characters and diacritics easy. Install the script, double-click on the script in the Scripts panel, type “pg” (p for pi, g for greek), and click OK. Yes, this is overkill for just typing pi, but if you frequently need to enter accented and foreign characters, you need this script. Works in InDesign CS3 and newer.

5. Both the Mac OS and Windows offer software “keyboard layouts” in various languages that you can use to access foreign characters. Install a Greek keyboard layout, and use it to enter Greek characters. To get started on a Mac, choose System Preferences > Keyboard > Input Sources. On Windows 7, choose Control Panel > Clock, Language, and Region > Change keyboards or other input methods.

6. If your reason for typing the Pi symbol is because you need to type complex math equations in InDesign, then you need MathMagic. This is a very slick, efficient way to enter complex Math equations in InDesign.

That’s it. Happy Pi day!

Tags
Related Articles
Comments

10 Comments on “6 ways to type the Pi symbol in InDesign

    • Another way involving GREP styles. Make a character style that is only the font “symbol”. Then make a paragraph style that calls a GREP style to use the newly created character style to look for the phrase \sp\s .

      The only catch to this is that there has to be a space before and after the letter p. It is unlikely in most western alphabet languages that the letter p by itself would be part of a regular sentence.

  1. Oh Keith, this is great! Of course, even pi day is somewhat North American because in many countries they would write March 14 as “14/3″ rather than 3/14. For them, I recommend July 22 (because 22/7 is a pretty good approximation for π)

    (And, given that, isn’t that funny that it’s Alt-227 to type pi?)

  2. For me it’s ALT-03C0

    But for the life of me I can’t get it to input to InDesign, although I can select it from the glyph panel…

  3. Here is, in my opinion, the easiest way to type in any glyph that you can’t reach on your standard keyboard. As usual in InDesign, you have to perform just a few steps beforehand, but the benefit is enormeous:

    1. Look up the “Unicode value” in the Glyphs panel. (Example: “pi” = 03C0. Don’t worry about the letter “C” – the Unicode value is a hexadecimal one where the letters A to F can be used.)

    2. Open you standard text editor, create a new file and name it “pi.jsx”. (Yes, “jsx”, not “txt”, neither “rtf”.) Save it on the desktop.

    3. Write the following line of text in this file (without the quotes, but with the semicolon, and note that it’s case-sensitive, so pay attention to lowercase or uppercase letters:

    “app.selection[0].contents=String.fromCharCode(0x03C0);”

    Save and close the file.

    4. Switch to InDesign, open the Scripts panel, right-click on the folder “User” and choose “Show in Finder”/”Show in Explorer”. (Or is it “Reveal in …”? I don’t know since InDesign can’t be switched to other UI languages, grrrrr…)

    5. In the shown folder “User”, there is a sub-folder called “Scripts panel”. Open this folder and copy your text file “pi.jsx” into it.

    6. Return to InDesign. You can already insert a “pi” now by double-clicking on the script “pi.jsx”. But, this is not the end yet:

    7. Open the Keyboard Shortcuts (Edit -> Keyboard Shortcuts), choose the “product area” “Scripts”, scroll down to “User:pi.jsx” and assign a handy shortcut in – important! – context “Text”. That’s it! From now, you just type a “pi” with your keyboard shortcut.

    8. If you consider that great and want to enter other characters as well, here is the easiest way how to do that:

    8.1 Right-click on “pi.jsx” in your Scripts panel and choose “Edit script”. A program called “Extend Script Toolkit” opens.
    8.2 In Extend Script Toolkit, choose “Save As” and rename to e.g. “minus_sign.jsx”.
    8.3 Change the four characters “03C0″ to “2212″. Save the file and close ExtendScript Toolkit. That’s it!

    Cheers,
    Rudi

    • Rudy, very nice! You can avoid editing the script for every single character by using a trick: use the script’s *name* to indicate the Unicode! That would look like

      if (app.documents.length > 0 && app.selection[0].hasOwnProperty(‘baseline’))
      {
      unicode = parseInt(app.activeScript.displayName.match(/([0-9A-F]*)\.jsx?$/i)[1],16);
      if (unicode > 0) app.selection[0].contents=String.fromCharCode(unicode); else alert (‘Invalid Unicode value “‘+unicode);
      }

      – save copies as “pi_3c0.jsx” to insert pi or “beta_3b2.jsx” for a beta, or something entirely else such as “peace_262e.jsx” to insert a Peace symbol.

  4. Note to anyone using Jongware’s script: You need to straighten the quotes (our site makes all the quotes curly).

    Jongware: This is great! Is there any way to make it use GID (glyph ID) instead of Unicode? There are many characters (such as special ornaments) that can only be found using GID in the current font.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>