This example illustrates how to create and edit pictures without
using the mouse.
For this example I'm going to use units. To do this, use the menu mnemonics
Alt-S G G. This will open up the
Grid Settings dialog box shown in
Figure 11.47. The Major Divisions
field should already have the focus, but if not, you can do
Alt-M. Set this value to 100. Press the
Tab key to move to the unit . Press the
b key to select bp. Press Tab or
Alt-S to select the
Sub-Divisions field. Set this value to 10.
Then press either Enter or Alt-O to
apply these settings and close the dialog box.
Figure 11.47: No Mouse Example--Grid Settings Dialog Box
Make sure that you don't have the grid lock on as some of the
co-ordinates that this example uses lie between tick marks.
Shift-F2 or Alt-S G L
toggles between setting the grid lock on and off.
Select the ||,
using either Ctrl-R or Alt-O R.
The rectangle forming the main part of the house will go from
(100bp, 100bp) to (250bp, 200bp). To move the mouse either press
F5 or use the menu mnemonic Alt-N G.
This will open up the dialog box shown in
Figure 11.48. Set the x field
to 100bp and the y field to 100bp. (You can
use the Tab key to move to the next focusable component, or you
can use Alt-X to select the x field
and Alt-Y to select the y field.)
Then press Enter or Alt-O.
Figure 11.48: No Mouse Example--Go To Co-Ordinate Dialog Box
Press F4 to emulate a mouse click. This will anchor the
rectangle at (100bp, 100bp). Then use either F5 or
Alt-N G to display the
Go To dialog box. Set the
x field to 250bp and the
y field to 200bp. Then press Enter or
Alt-O.
To complete the rectangle, press either Enter or F4.
(See Figure 11.49.)
Figure 11.49: No Mouse Example--Completed Rectangle
Let's make it a yellow brick house. To change the rectangle's
fill colour, we first need to switch to the select tool. To do this
either use Ctrl-P or use the menu mnemonic
Alt-O S.
To select the rectangle, use either F6 or
Alt-N K.11.1 Alternatively, you can use
Alt-N D which will show a dialog box
with a that you can use to select an object.
To change the fill colour use the menu mnemonic
Alt-E H F. This will open up
the dialog box shown in Figure 11.50.
Figure 11.50: No Mouse Example--Set Fill Colour Dialog Box
To select the Colour radio button,
either do Alt-L or press Tab until
the Colour button has the focus, and then
press Space.
The single colour selector will now be enabled. To change the
colour to yellow, you can do one of the following:
Press Tab until the yellow swatch
is selected, and then press Space.
Press Alt-R to select the
RGB panel and set the
Red field to 100, the
Green field to 100, the
Blue field to 0 and the
Alpha field to 100.
Press Alt-K to select the
CMYK panel and set the
Cyan field to 0, the
Magenta field to 0, the
Yellow field to 100, the
Black field to 0 and the
Alpha field to 100.
Then press Enter or Alt-O to apply the
fill colour and close the dialog box (see Figure 11.51).
Figure 11.51: No Mouse Example--Fill Colour Set
Next we need to construct a triangle for the roof. The
||
is needed for this, so either use Ctrl+Shift-L or use the menu
mnemonic Alt-O I.
The triangle vertices will be at (80bp, 100bp),
(175bp, 50bp) and (270bp, 100bp). Move to the first co-ordinate
using either F5 or
Alt-N G, and set the x
field to 80bp and the y field to 100bp in the
Go To... dialog box. Press Enter or
Alt-O to close the dialog box and move
the mouse to the required location, and press F4 to set the first
vertex.
Repeat the process for the second and third vertices, and press
Enter to complete the path. The path will automatically close.
(See Figure 11.52.)
Figure 11.52: No Mouse Example--Completed Triangle
Let's make the roof red. First switch to the select tool
using either Ctrl-P or Alt-O S.
Select the triangle using F6 or
Alt-N K.
Open the fill colour dialog box using the menu mnemonic
Alt-E H F.
Use Alt-L to select the
Colour radio button.
To set the colour to red either use the Tab key to move
the focus to the red colour swatch and press Space or use
Alt-R to select the
RGB tab and set the
Red field to 100, the
Green and Blue
fields to 0 and the Alpha field to 100.
Press Enter or Alt-O to set the
fill colour and close the dialog box. (See
Figure 11.53).
Figure 11.53: No Mouse Example--Triangle Fill Colour Set to Red
Now for the windows: press Ctrl-R or use the menu mnemonic
Alt-O R to select the rectangle tool.
Create four rectangles using the method described above with
opposing vertices at:
To change the fill colour of the window rectangles, you will
first need to switch to the select tool using either Ctrl-P
or Alt-O S.
It's more efficient to select all four of the window rectangles
and change their fill colour simultaneously, rather than setting
the fill colour individually. Since the four small rectangles are
at the of the , pressing Shift-F6 four times will
select these four rectangles.
Now use the menu mnemonic
Alt-E H F to set the fill colour
to white, following the same process as before to produce the
image shown in Figure 11.55.
Figure 11.55: No Mouse Example--Window Fill Colour Set
Now make a black rectangle with
opposing corners at (160bp, 200bp) and (190bp, 160bp) using the
same method as above, to produce the image shown in
Figure 11.56.
Figure 11.56: No Mouse Example--Completed House
To illustrate how to move objects using the keyboard, let's
now shift the house 100bp to the right and 50bp down. First make
sure you are using the select tool. Then select all the objects using
either Ctrl-A or Alt-E A.
Then either press F7 or use the menu mnemonic
Alt-E M. This will open up the dialog box
shown in Figure 11.57. Set the
x field to 100bp and the
y field to 50bp.
Figure 11.57: No Mouse Example--Move Dialog Box
To illustrate how to edit a path using only the keyboard,
let's make the roof a bit shallower. First deselect all the objects
using Ctrl+Shift-A or Alt-E D.
Press F6 repeatedly until the triangle is selected.
To enter edit mode, use either Ctrl-I or
Alt-E H E. You should now see the
path in edit mode. (See Figure 11.58.)
Figure 11.58: No Mouse Example--Edit Mode
Press F6 until the highest vertex is selected.
Press F3 to popup the edit path menu
(Figure 11.59).
Figure 11.59: No Mouse Example--Edit Path Menu
Press Alt-R to display the
dialog box shown in Figure 11.60.
Figure 11.60: No Mouse Example--Control Point Co-Ordinates Dialog Box
Set the y field to 120bp,
and press Enter.
Press Ctrl-I to exit edit path mode. The image should now
look like Figure 11.61.
Figure 11.61: No Mouse Example--Editing Finished
To illustrate how to create a using
the keyboard, let's add a label. First select the
text tool using either Ctrl-T or Alt-O T.
Press F5 or Alt-N G to display
the Go To... dialog box. Set the
x field to 200bp and the
y field to 100bp.
Press F4 to start the . You should now see a
small pale rectangle with a cursor, as illustrated in
Figure 11.62. Whilst this rectangle contains a
cursor, you can type in text or press F3 to display the
text area .
Figure 11.62: No Mouse Example--Creating a New Text Area
Type in the text House #1, then switch to the
select tool (using Ctrl-P or Alt-O S.)
The contains one of TeX's special characters,
namely the hash (#) character. This will cause a problem if you want
to save your image as a pgfpicture environment if the
|| is not enabled. If so, you will need
to modify the so that it has an alternative text to
be used if the image is saved in a LaTeX file. You can do this as
follows:
Press F6 to select the .
Press Ctrl+Shift-I or Alt-E X E
to display the Edit Text dialog box. Select the
Different button (either Tab to it and
press Space or use Alt-D.) This will enable
the alternate text field. Change the text to House \#1
(Figure 11.63).
Figure 11.63: No Mouse Example--Editing Text Area
Press Enter or Alt-O to update the
, and close the dialog box.
It would look better if the label was centred over the
house. In order to use the align function, it is necessary to
group all the objects that make up the house. This is done as
follows:
Assuming you created all the objects in the same order as
listing in this example, the should be at
the front of the , then the door, the four windows, the roof
and lastly the body of the house. You should still have the
selected, and nothing else. If not, deselect all
objects (Ctrl+Shift-A) and press F6 to select the .
Press F6 to deselect the and select
the next object in the (the door).
Press Shift-F6 to add the next object to the selection.
Keep pressing Shift-F6 until everything has been selected except
the .
Press Ctrl-G or Alt-T G to
group the selected objects.
Press Shift-F6 to add the to the selection.
Press Ctrl-G or Alt-T G to group
the selected objects.
Use the menu mnemonic
Alt-T J C to centre the
objects.
Press Ctrl-U or Alt-T U to
ungroup the objects. The image should now look like
Figure 11.64. Note that the house had to be grouped
and that group then grouped with the to
ensure that the individual house components maintained their
position relative to each other.
Figure 11.64: No Mouse Example--Text is Now Centred
If you want to save your image as a pgfpicture
environment, you will need to change the
||
settings to ensure that the in the LaTeX file remains centred. (Otherwise font differences may cause the text
to appear slightly off centre.) To do this:
Ensure that the is selected.
Use the menu mnemonic
Alt-E X F A H to
display the Horizontal Anchor Setting dialog box.
If the doesn't already have the focus,
press Alt-A.
Press c or use the arrow keys to set the
horizontal setting to Centre.
Press Enter or Alt-O to apply the settings
and close the dialog box.
(Note that you don't need to do this if the menu item
TeX/LaTeX->Settings->Auto Adjust Anchor is selected as it will
automatically update the anchor when you align the text area.)