Home | Tips | Library | Other Authors | Other WP Sites | Writer's Links | Contact | Site Map | Donate |
![]() Toolbox for WordPerfect |
||
Macros, tips, and
templates for Corel® WordPerfect® for Windows® |
Page updated Jul 31, 2025 |
|
BRACKETS - Mark or enclose blocks of selected text with large square brackets | ||
Related topics- External site: Create a pull quote (with a macro that creates a text box containing pre-selected text) - a WordPerfect Universe post (July 3, 2025)
|
Purpose and uses Brackets.wcm is a WordPerfect 9 (and later version) customizable macro that creates an "outdented" table -- i.e., a table that extends into the margins -- with a large, full-height left and/or right border that simulates a large square bracket ( "[" and/or "]" ). See screen shots below. It can be used to set off text for special purposes, such as to format "pull quotes" or editorial comment, or to indicate that several characters are speaking simultaneously in theater and opera manuscripts. [Note that you can also have "indented" brackets, as shown in the screen shots below.] If text is selected first, the text will be automatically inserted into the table with the bracket(s). You can also create indented and non-indented brackets: Screen shot: Screen shot: Note:
While WordPerfect can apply outdented vertical borders to paragraphs with Format, Paragraph, Border/Fill, the borders are simple vertical lines. They do not simulate square brackets. However: To create and quickly apply a vertical line (paragraph border) rather than a bracket see the tips in this footnote on the Graphic Tips page. This might be a preferred alternative to the Brackets macro for some purposes. Three versions of the bracket table can be created with a simple setting in the macro: left bracket only, both left and right brackets, and right bracket only. Note that the table's text column (a single cell) is aligned on the vertical page margins with other document text at the table's location; it is just the brackets that are outdented from the margin. Outdenting is the default, but it is optional. The macro can also be customized to produce different bracket styles and colors. Simple instructions are given in the redlined User Modification Area of the macro's code. For some tips on creating large curly brackets {"braces"} see the Tips section below. How to use the macro Step 1. (OPTIONAL) Set the desired type of table (e.g., left bracket only, right bracket only, or both left and right bracket), the width of the "bracket," and several other options in the redlined User Modification Area of the macro file. (You can edit the macro file with Tools, Macro, Edit.) By default the width of the brackets (line plus space) is set to 0.067 inches wide (0.17cm), which is the typical minimum width of a table column when created manually; you can set it to more `(or even slightly less) than this amount. [Metric users can change the default setting for the bracket width from inches to centimeters.] When you are finished making changes, click Save & Compile on the macro toolbar. Alternative to editing the macro's code: Since the bracketed text effect is created with a WordPerfect table, you can just right-click on the resulting bracketed text in the document and choose (e.g.) Format, Table, Table position on page:. Then test using different position settings there (e.g., Center). See also the Tips section below. Step 2. Play the macro (with Tools, Macro, Play or <Alt+F10>) in a test document with various left and right page margin settings to see how it works. You can undo things with Edit, undo or <Ctrl+Z>.
If you select text before playing the macro, it will be automatically inserted (with cut and paste) into the table. If you don't select text, the macro will create a table at the current cursor location, and you can then copy (or type) text into the table. The table will expand downward as needed to accommodate your text. Page margins are automatically adjusted just before the table begins and then restored to their previous values just after the table ends. Thus you can use the macro regardless of the page margins in effect at that point. Tips☼ You can see how the table will look in print with File, Print Preview, or with View, Guidelines, Tables (unchecked). For the latter, be sure to also uncheck View, Table Gridlines. (For more on Guidelines vs. Gridlines: http://wptoolbox.com/tips/Gridline.html.) ☼ You can always adjust left and/or right margins to create a greater indent of the material with a new page margin just before the [Tbl On] code (visible in Reveal Codes view) and restored to the current setting just after the [Tbl Off] code. Such indented tables might be useful
for "pull quotes," editorial comments, or other design considerations.
Alternative method to setting new margins to create a smaller indented and centered table: • First, set the vOutdent value to 0 (zero) in the User Modification Area in the macro's code. Save and exit the macro with the Save & Compile button on the Macro Toolbar (or just use File, Save). • Next, create the bracket table by playing the macro. • Right-click inside the table's text column. • Choose Format, Table (tab), Table position on page: Center. • Finally, set the text Column width to whatever value you desire with Format, Column (tab), Column width. ☼ An easy way to copy just the contents of the text column is to place your cursor at the top of the cell before all text and format codes. Hold down the <Shift> key and scroll down (or use the PgDn or Arrow keys) to select the text. Use <Ctrl+C> to copy the cell contents to the clipboard. Paste the contents wherever needed. ☼ An easy way to delete the entire table is to simply delete the [Tbl On] code in the Reveal Codes pane. ☼ A table can be selected, (everything from the [Tabl Def] code to the [Tbl Off] code in Reveal Codes) copied, and pasted into a text box (you probably will need to adjust the box's size by dragging the borders to accommodate the table) and the box can be dragged to another position. The box's [default] border can then be removed with a selection on the context menu that pops up when you right-click the box. The box can then be positioned anywhere on the page and "anchored" to a specific character or paragraph (to "follow" the text there if you add or delete material above that material's location), or to a particular page location. A text box's default setting is to anchor it to the current paragraph so it "travels" with that paragraph. Related tip: Once the table is inside a text box, it will show up in Reveal Codes as a single [Box] code which can be deleted or selected, copied, and pasted into any page or any other document (in which case, it probably will need a Position adjustment: right-click on the box itself in the document area and use the context menu to edit the box's properties). ☼ An easy way to find color values for the bracket lines and fills is to click Format, Font, Color and pass your cursor slowly over the color palette, taking note of the RGB values which you can use in the User Modification Area. ☼ You can also create large "curly" brackets (a.k.a., braces) with the WordPerfect Equation Editor. Here's a thread on WordPerfect Universe that explains the tecnique and has a downlad .zip file (from Derek Duke) with both a left and right brace you can use in any document. Related tips
• Since they are images inside boxes, they can be selected (right-clicked) and dragged into position, then resized (and thinned/thickened) using the drag handles. • Right-click on the image or double-click on the [Box] code and you can set the text Wrap tool to force the adjacent text to the right (for the left brace) and to the left (for the right brace). • You can adjust the size of one of the boxes with the drag handles, then use the Size tool's measurements for that box in the other box to give you exact symmetry. • If you put such a custom brace and some text inside a borderless text box (Insert, Text box), set the Text box's Position to Paragraph, then drag it into the margin area, you can use it for margin notes/quotes that point to a specific line in the document. See this example. (The box's border, position, etc., can be set using the context menu that appears when you right-click on the text box.) • You can select the box (if it is not selected, right-click on it and choose Select Box) and make a QuickWord from it so you can use it anytime. It will appear in the same spot as when it was created but it can be dragged to a new position and resized. ☼ Yet another way to achieve something like the same effect is to use TextArt, a feature that is available in most versions of WordPerfect Office if Presentations was installed (under the Insert, Graphic/Pictures menu). As a demonstration, the author used it
to create a large, right-brace ("curly" bracket or "brace") that can span
multiple lines. See this screen
shot. (It prints better than it looks on screen.) You probably will
need to experiment with TextArt to get the effect you want.
It was done using Courier New as the TextArt font for the right brace (two keys to the right of the "p" on the keyboard), and with all TextArt options set to "None" (i.e., no fills, outlines, etc., but using Very High Smoothness). After exiting the TextArt module, you can use the drag handles of the selected graphic [Box] to squeeze the brace symbol horizontally to make it thin, and drag it vertically to span the required number of lines of text in the document. Related tips • The [Box] code that holds the brace can be set to "Attach to: Paragraph" as the Position (double-click on the [Box] code), so it will remain with the adjacent text. • You can select the box (if it is not selected, right-click on it and choose Select Box) and make a QuickWord from it so you can use it anytime. It will appear in the same spot as when it was created but it can be dragged to a new position and resized. ☼ You can also use a single vertical line (paragraph border) rather than a curly bracket. See the tips in this footnote on the Graphic Tips page. Known limitations • The macro is for WordPerfect 9 and later versions. • The macro cannot be played inside an existing table or inside existing columns. A message will appear to alert you of this fact and then the macro will abort. [For columns, you can copy a table into a column (everything from the [Tbl On] to the [Tbl Off] codes, including those codes, in Reveal Codes). |
|
Footnote 1 [...continued from above:] For keyboard lovers: Format, Paragraph, Double Indent (repeat these on the same paragraph or text selection for greater indentation). Note that this adjusts only indentation using tab stops. If you want to include precise measurement values for the indentation and/or add other formatting, see the other methods below. For style lovers: Create a custom Character style. Use the Styles Editor to either - (1)
insert new left and right page
margins (Format, Margins on the Editor's menu bar)
or - (2) use new left and right paragraph adjustments (Format, Paragraph, Format; then set the Left/Right margin adjustment). The first method will set indentation to an amount relative to the edges of the page. The second sets the indentation relative to the existing page margins. You can add other formatting such as line spacing, italics, etc. Once created, you can apply the style to any selection of text. Note that such newly created styles apply to just the current document; to save them for future use see the custom styles page. [One advantage to such a style over the macro below is that it should not produce any spurious extra hard return.] For macro lovers: Purpose This macro sets new left or right paragraph margin adjustments (or both) for a selection of text (without brackets), and optionally sets new line spacing for that selection. It then returns the margins and line spacing to the current defaults (i.e., those that existed before the selected text was adjusted by the macro). The user can specify exact margin adjustments in increments of 1/1000th of an inch (.001"), as well as the (optional) line spacing (e.g., 1.25) for the selection. See the MODIFICATIONS area below. It also works on selected text inside headers, footers, text boxes, footnotes, endnotes, columns, and table cells, if the user-selected margin adjustments are not so large that they cause the adjusted material to exceed the area allotted for text and margins. Notes Depending on how the material is selected, there might be an extra hard return left in the document after the macro plays, but this should be fairly obvious. If desired, open Reveal Codes and delete the extra hard return. You can make several versions of this macro with different settings for different purposes. To make them easily accessible see http://wptoolbox.com/tips/EasyPlay.html [To copy this code into your WordPerfect program to create a working macro, see here.] // Macro code begins // Indent margins.wcm (Jan 30, 2013) by Barry MacDonnell // = = = USER MODIFICATIONS HERE = = = // ** Enter your desired Left/Right Margin adjustments here ** vLeftMarginAdj:=1.33" // (default = 0.0") vRightMarginAdj:=1.33" // (default = 0.0") // ** Enter your desired line spacing here (without inch marks) ** vLineSpace:=1.0 // (default = 1.0; suggest 1.25 for a test) // = = = END MODIFICATIONS HERE = = = // Main macro begins here: // Display a warning message if needed: If(?BlockActive=False) Messagebox(;;"Select some text first!") Quit Endif // Sets new margin adjustments at beginning of selection: BookmarkCreate("Temp_IM_Bookmark") BookmarkBlock("Temp_IM_Bookmark") PosBlockTop MarginAdjustLeft (AmtToAdjust: vLeftMarginAdj) MarginAdjustRight (AmtToAdjust: vRightMarginAdj) vCurrentLineSpacing:=?LineSpacing LineSpacing(Spacing: vLineSpace) BookmarkBlock("Temp_IM_Bookmark") PosBlockBottom SelectOff BookmarkDelete("Temp_IM_Bookmark") // Restores the current document margins at end of selection: // (204=HRt; 202=HRt-SPg; 3283=LftMargAdj; 3539=RgtMarjAdj; 467=LnSpacing) If(?RightCode={204;202}) PosCharNext Else HardReturn Endif LineSpacing(Spacing: vCurrentLineSpacing) MarginAdjustLeft (AmtToAdjust: 0") MarginAdjustRight (AmtToAdjust: 0") // Remove any extra hard return after the last adjustments (if possible): If(?LeftCode={204;202}) PosCharPrevious If(?LeftCode={3283;3539;467}) // (left adj, right adj, or line space code) DeleteCharNext // (delete the extra hard return) Endif Endif // Exit: Quit // Macro code ends |