IF THERE were an evolutionary tree of pastries, gingerbread's history would begin in the roots. Already a popular confection in earliest Roman and Greek times, it was made from honey, rye flour, oil, ground nuts and ginger root. Gingerbread was one of the few Mediterranean pastries that wasn't honey-soaked and cloyingly sweet.

In the Middle Ages, gingerbread was eaten in the Germanic and Slavic fiefdoms. Very similar to the Roman and Greek versions, it was called lebkuchen -- "life cookies." It was sold year round at fairs and festivals. Young men, after their hard week's work, would escort their ladies to these welcome diversions from the harsh realities of medieval life. In proof and celebration of their love and devotion, they bought lebkuchen hearts or men high-lighted with brightly colored icings or enscribed with promises of eternal devotion.

Those "cookies" were not hung on tree boughs, however. They were often three feet long, depending on the size of the young man's wallet. Such large cookies required intricately carved wooden planks to serve as cookie cutters. After the dough was mixed, the bakers would roll it over the well-floured planks and tip them into the slab of hot stone that served as the oven's floor. p

On a more seasonal basis, gingerbread was even then used as a decoration for Christmas trees in an age when glass ornaments and tinsel were still unknown. They were easily made, fun to decorate and could be eaten and enjoyed long after the tree had burned in the fireplace and warmed the house.

When the Germanic and Slavic immigrants arrived in the United States, rye flour was unavailable and wheat was cheap anyway. Because wheat was so cheap, nuts, which in Europe had substituted for scarce flours, were unnecessary. Molasses was more economical as a sweetener than honey because large quantities of it were being imported from the Caribbean sugar colonies by Massachusetts rum distillers. As a result, American gingerbread has since been made with molasses, wheat flour and sugar.

There are two kinds of American gingerbread doughs: those that are sweet and crisp and those that are bready and dry. This recipe is a combination of the two. It is sweet enough to be flavorful but bready enough to endure the rigors of hanging on a string.

When mixed, the dough will be sticky and soft. The recipe calls for either dark molasses (for a medium-light dough) or dark plus blackstrap (for darker, richer dough). Shortening can be substituted for butter; use the same quantity. In such a spicy dough, the difference in taste will be slight. GINGERBREAD RECIPE 3/4 cup butter or shortening 2 cups granulated white sugar 2 eggs 1/2 cup dark molasses or 1/4 cup each of blackstrap and dark molasses 2 teaspoons vinegar 1/2 teaspoon salt 3 teaspoons powdered ginger 1/2 teaspoon cinnamon 1/4 teaspoon ground cloves 1 1/2 teaspoons baking soda 3 1/2 cups flour Royal Icing: 2 egg whites 3 or more cups confectioner's sugar 1 teaspoon lemon juice

Let the butter soften before adding sugar. If you are using shortening, no softening is necessary. The dough made with shortening can be used immediately, but the butter dough should be refrigerated 1/2 hour to make it firm.

Add all the sugar, eggs, molasses and vinegar. Blend until smooth.Add the spices, blend, then add the baking soda and begin mixing in the flour. Add the flour in thirds, mixing thoroughly after each addition.

Choose a cool spot to roll out the dough. The best surface for rolling out gingerbread or any pastry or cookie dough is wooden (butcher block or plywood). gDo not be afraid of using too much flour. Any excess can be brushed off the dough after it has been rolled out. A new 4-inch paint brush serves this purpose well.

Do not roll in only one direction. Form the dough into a ball or cylinder, coating it lightly with flour. Roll it gently and evenly without smashing the edges of the dough. Turn at right angles and roll again. Keep turning and moving the dough until it is 1/4-inch thick. Roll it out to its final thickness, about 1/8-inch, keeping it as uniform as possible.

Once the dough is ready, run a spatula under it to free it from the bench top. Then when you cut out the cookies, they will not be stuck to the rolling surface. Cut all the cookies, then transfer each to the tray by running the spatula under the length of each.

After each roll-out, scrape the table to keep the dough from sticking the next time.

Set the oven at 325 degrees 1/2 hour before you start baking. Do not remove the cookies until the dough has baked firm. Otherwise, they will fall off their strings. To tell if it is done, press the dough lightly in the center with your finger. The dent should bounce back. This means they are done but not that they will be crisp. Leave them in for 5 more minutes to achieve the proper crispness.

To prepare the cookies for hanging, you can cut a hole in the top of each when the dough is raw or when it is semi-baked. The hole must be cut larger in the raw dough than in the semi-baked dough because the rising dough will fill it in. Use the end of an unfluted pastry tube or a plastic straw. In small, light cookies, you can bake a loop of string directly into the dough. Just lift the top half of the cookie with the spatula and slide the ends of the string under half of the cookie. As a result, the string will be imbedded sufficiently to hold even on rainy days (when the dough softens from the humidity).

If you wish to make chewy gingerbread cookies just for eating, set the oven at 350 degrees (about 15 minutes) and bake only until firm, not crisp. By keeping them tightly covered in a tin, they will stay moist and chewy. For extra softness, try storing an apple with them. If you want to make them crisp again, bake the cookies at 275 degrees for about 10 minutes.

While the cookies are cooling, prepare the royal icing. Whip the egg whites in a mixer until almost stiff. Add the sugar and lemon juice slowly while beating. The final product should be thick yet fluffy. Stiffness gives the royal icing strength; fluffiness gives it a smooth, attractive sheen when it dries. For decorating and for the snow around a gingerbread house, make the meringue moderately stiff. For the mortar holding walls and roof of gingerbread houses together, make a stiff meringue.

Divide the icing among 5 bowls. Color 4 to your taste and leave the 5th white. Keep all 5 bowls well covered while you're working with the icing because on crisp wintry days the low humidity will dry it out. Make icing tubes following the instructions in the Joy of Cooking, page 673. Fill each tube halfway and seal by folding down the open ends, first from both sides and then the end. Cut holes in the tips of the tubes. Small holes will not make straight lines, but if you press hard you will get a beautiful, ruffled effect, used by chefs in making canapes. Larger holes are much easier to work with. If you want a thick, straight line, just pull the end of the tube farther away from the cookie you're decorating and let the line fall farther. Don't decorate with the end of the tube touching the cookie: it makes a messy, uneven line. The icing has to fall onto what you're decorating to look natural.

Sometimes an icing tube loses its capacity to make a line -- the icing shoots off to the side. That's because the end of the tube has distorted itself. One of its sides has slipped and partially closed the end of the tube. In that case, take the scissors and trim the end without enlarging the hole too much.

Depending on the humidity, the icing takes several hours to dry to the touch and 4 hours to dry enough to handle . . . at that point, they are ready to hang from the tree.