Documentation
Publicon
User Guide
Getting Started
Creating Palettes and Buttons
You can make customized buttons and palettes to enter complicated expressions with a single click.
Buttons are versatile objects that perform an action when you click them. For example, a hyperlink is a special kind of button. The most common use of buttons is for pasting expressions, and typically within a free-floating palette.
To create a button that pastes an expression:
1. Choose Insert
Palette
1 Row 1 Column. A blank single-button palette is pasted into your document.
2. Move the cursor into the button to select the placeholder (
) if it is not already selected and enter the expression you want the button to paste.
A button's expression or template can contain a filled placeholder, indicated by the \[SelectionPlaceholder] character (
). This signifies that whatever text is currently selected in the document will be inserted at the position of the
when you click the button. To enter a
, use the keyboard alias
spl
. If no text is selected when you click the button, the placeholder remains empty.
3. Select the cell bracket and choose Format
Generate Palette from Selection.
The button is now an active as a free-floating palette. Clicking the button causes the expression in it to be pasted into your document at the position of the cursor. Multiple buttons can be combined into one palette, which can be saved like any other Publicon document for future use.
To create a palette:
1. Choose a template from Insert
Palette. For this example we chose "3 Rows 1 Column".
2. An array of buttons is pasted into the document. Insert the expressions you want into each button. You can use
to go from one button to the next.
3. Select the cell containing the palette.
5. Choose Format
Generate Palette from Selection. A separate window containing the palette will appear.
Click any button in the palette to paste its contents into your current document at the position of the cursor.
Editing buttons
Once you have created a button, you can edit it (before turning it into a palette) by selecting its contents and choosing Edit
Button. This opens a dialog box for editing various parameters of the button. You should expect to use this rarely because any buttons that do more than simply paste their contents require a certain level of expertise with the underlying syntax of cells and notebooks.
Of the button styles listed in the style pop-up, "Paste" and "None" result in the same paste action, which is the most common reason for creating palettes in Publicon. "StyleApply" executes CellWriteStyle, a powerful function at the heart of all of Publicon's document palettes. "StyleApplyWithVerification" tests to see if the target document's style sheet matches the style name listed in the title cell of the palette's embedded style sheet. The actual style being applied must be provided within double quotes and braces in the ButtonData field as the simplest argument form taken by CellWriteStyle, such as {"Section"} for example. Both of "StyleApply" and "StyleApplyWithVerification" are intended primarily for the creation of document palettes and not for casual use. To execute any special function in a button, Evaluator should be set to Automatic.
"ConvertCharacter" is a button style that allows the character within the button to be converted to a different character when exported to HTML or
. The button should be left inactive, as the button structure is simply being exploited as a container for the alternate character information. The conversion rules for the characters are specified in the ButtonData field. Follow these steps to configure this conversion method in your text:
1. Choose Insert
Palette
1 Row 1 Column. A blank single-button palette is pasted into your document.
2. Select the entire contents of this template cell and paste it in your text where you need to convert a character.
3. Select the placeholder (
) and type the character as it will appear in your Publicon document.
4. Double click the inserted character and choose Edit
Button.
5. In the dialog box, choose "ConvertCharacter" from the Button Style menu and set Evaluator to Automatic.
6. In the ButtonData field, set up your conversion rule, for
, HTML, or both:
{"TeX"
"\mycharmacro"}
or
{"HTML"
"&myentity;"}
or
{"TeX"
"\mycharmacro", "HTML"
"&myentity;"}
7. Leave the "Always Active" setting off and Click "OK".