About
Shop
LaTeX
Software
Books
Gallery
News
Contact
Blog
Settings
Latest news 2019-12-05: new blog post "RSS Feeds and Other Notifications."
Previous: A Poster  Up: Step-by-Step Examples  Next: A Brochure  


A Newspaper

This example illustrates how to use FlowframTk to create a class or package based on the flowfram package, using non-standard shaped frames. The aim is to produce the document shown in Figure 11.79.

  1. In this example, my newspaper is going to be on A4 portrait paper, with a normal font size of 12pt, so the first thing to do is to select the paper size and orientation using Settings->Paper->A4 and Settings->Paper->Portrait, and set the value of the LaTeX normal size font, using the Settings->Configure TeX/LaTeX Settings dialog box (see Figure 11.49). Select 12 from the drop-down list.

    news1
    Figure 11.49: Newspaper Example--Setting the LaTeX Normal Font Size

  2. The 12pt font size has a corresponding \baselineskip of 14.5pt. For this example, it is more practical to have a grid that has intervals of this size, as it gives a guide as to how many lines there will be in each frame.11.1 Therefore I set the grid to have 145pt major divisions with 10 subdivisions. This means that each minor tick mark is at a distance of 14.5pt (one \baselineskip) from its neighbour. To do this select Settings->Grid->Grid Settings, and enter the values as shown in Figure 11.50.

    news2
    Figure 11.50: Newspaper Example--Setting the Grid

  3. To help reduce rounding errors, I'm also going to set the storage unit to 1pt. To do this select Settings->Configure Image Settings and change the storage unit in the Control Points tab, as shown in Figure 11.51.

    newsunit
    Figure 11.51: Newspaper Example--Setting the Storage Unit

  4. Next set the typeblock. This nominally defines the paper margins, although it is possible to define frames outside this area. I used 58pt margins on all sides. To do this, select TeX/LaTeX->Flow Frames->Set Typeblock which will display the dialog box shown in Figure 11.52. Enter the values shown and click on Okay or press Enter to continue. You should now see a pale grey rectangle displayed on the canvas denoting the typeblock.

    news3
    Figure 11.52: Newspaper Example--Setting the Typeblock

  5. The newspaper is going to have a static frame along the top of the typeblock that will contain the title of the paper. This isn't going to have a border, but we will need to draw a rectangle to define the frame's bounding box. So select the rectangle tool and draw a rectangle with opposing corners at (58pt,58pt) and (536.5pt,145pt). You should now see something like Figure 11.53.

    news4
    Figure 11.53: Newspaper Example--Title Frame

  6. Switch to the select tool, and select this rectangle. Select TeX/LaTeX->Flow Frames->Set Frame and enter the values shown in Figure 11.54(a). Note that the Border field has been set to None. The frame contents should be:
    \begin{center}
    \bfseries\Huge
    Fairy Tale Times
    \end{center}
    \hfill Issue 2. 7 December 2005.
    
    This can be set by clicking on the Edit button, which will open the mini TeX editor, shown in Figure 11.54(b).

       
     news5 news5b  
     (a) (b)  
    Figure 11.54: Newspaper Example--Assigning Flowframe Data to Title Frame: (a) frame setup; (b) setting the frame contents

  7. Below the title, there will be two columns each with its own heading. I am going to make separate frames for the headings, and since the headings will be in a larger font, I shall give their frames a height of twice the \baselineskip. Select the rectangle tool, and make two rectangles with opposing corners at:
    • (58pt, 159.5pt) and (290pt, 188.5pt)
    • (304.5pt, 159.5pt) and (536.5pt, 188.5pt)
    You should now see something like Figure 11.55.

    news6
    Figure 11.55: Newspaper Example--Left and Right Heading Frames Added

  8. Switch to the select tool, and select the left hand frame, and assign the flowframe data shown in Figure 11.56. The frame contents contains the section command:
    \section{Killer Wolf on the Loose}
    
    This is again set using the Edit button to open the TeX editor.

    news7
    Figure 11.56: Newspaper Example--Assigning Flowframe Data to Left Heading Frame

  9. Do the same for the right hand rectangle, but call it rightheading. The frame contents contains the section command:
    \section{Tragic Wall Accident}
    

  10. The left hand column is going to angle around underneath the right hand column, as it will have more text in it. Select the closed line tool and make a polygon with vertices at (58pt, 203pt), (58pt, 507.5pt), (536.5pt, 507.5pt), (536.5pt, 420.5pt), (290pt, 420.5pt) and (290pt, 203pt) as shown in Figure 11.57.

    news8
    Figure 11.57: Newspaper Example--Added L Shaped Frame

  11. Switch to the select tool, and select this L shaped polygon, and assigned the flowframe data shown in Figure 11.58. Note that the Alignment field has been set to Top to ensure that if there is insufficient text to fill the frame, all blank space will go at the bottom of the frame, and thus help to keep the frame's shape. I used Parshape rather than Shapepar to define the frame's shape as I don't want it to shrink and grow to fit the text.

    The frame contents are quite long. You can either set the text in FlowframTk or use one of flowfram's commands in the document. Here's the full text:

    The authorities are warning of a killer wolf on the
    loose. He has so far devoured an old grandmother and
    two pig brothers. He is described as being furry with
    big eyes and big teeth.
    
    On Monday this week he broke into a house, and devoured
    an old lady. He then disguised himself as the old lady
    in order to deceive her granddaughter. Luckily for the little
    girl a woodsman arrived in time to rescue her. Parents are
    being cautioned not to let their children wander about on
    their own, and to remind them not to talk to strangers.
    
    The next day the wolf struck again, this time targeting two
    pig brothers who had most incautiously made their dwellings
    on the cheap using inadequate materials. The wolf also made
    an attempt on the third pig brother, but was unable to break
    into his house.
    
    Police are appealing to the public for witnesses, and remind
    people to keep their doors securely fastened at all times.
    
    ``Always ask to see identification,'' said one police advisor,
    ``and invest in improving the general security of your property.''
    

    news9
    Figure 11.58: Newspaper Example--Assigning Flowframe Data to L Shaped Frame

  12. I'm going to illustrate the story in the right hand column. The image egg.png is supplied with the flowfram package but is also available in the examples subdirectory of FlowframTk's installation directory. Use Bitmap->Insert Bitmap to insert the bitmap on the canvas. This will initially appear in the top left hand corner of the canvas. Move it over to the location shown in Figure 11.59, either by dragging it or by using Edit->Move By and specifying a horizontal (x) displacement of 472.8pt and a vertical (y) displacement of 206pt.

    news10
    Figure 11.59: Newspaper Example--Added Image

  13. Set the flowframe data shown in Figure 11.60 to this bitmap. Note that you must set the Border setting to As Shown, otherwise the bitmap will not appear in the document.

    news11
    Figure 11.60: Newspaper Example--Assigning Flowframe Data to Bitmap

  14. Next comes the right hand frame. This is a polygon with a stepped area that goes around the bitmap. Select the closed line tool, and construct a polygon with vertices at: (304.5pt, 203pt), (304.5pt, 406pt), (536.5pt, 406pt), (536.5pt, 290pt), (478.5pt, 290pt), (478.5pt, 261pt), (464pt, 261pt), (464pt, 232pt), (478.5pt, 232pt) (478.5pt, 217.5pt), (493pt, 217.5pt) and (493pt, 203pt) as shown in Figure 11.61.

    news12
    Figure 11.61: Newspaper Example--Added Right Hand Polygon

  15. Switch to the select tool, select this polygon and assign the flowframe data shown in Figure 11.62. Note that the Shape field has been set to Parshape and the Alignment field has been set to Top. Again, the contents of the frame are quite long and can either be set using FlowframTk or using on of flowfram's commands in the document. I'm going to set the contents using FlowframTk, as above. The text is as follows:
    An egg person tragically fell from a six foot wall 
    yesterday afternoon and was smashed to pieces. The 
    king's cavalry rushed to the scene, but regretted 
    that they were unable to help him.
    
    Humpty Dumpty was believed to be sitting on the wall 
    when he fell.  Police have ruled out foul play, but
    are advising people not to play on high walls, 
    particularly those vulnerable members of the population 
    suffering from eggshell syndrome.
    
    \small\em
    Exclusive interview with one of the King's men on page 6.
    

    news13
    Figure 11.62: Newspaper Example--Assigning Flowframe Data to Right Hand Polygon

  16. I'm going to add an L-shaped segment between the left and right blocks to clearly delineate them. Switch to the open line tool, and construct a path with vertices at: (297.25pt, 159.5pt), (297.25pt, 413.25pt) and (536.5pt, 413.25pt) as shown in Figure 11.63. (You'll need to switch off the grid lock.)

    news14
    Figure 11.63: Newspaper Example--Added L Shaped Divider

  17. Switch to the select tool, select this new path and assign the flowframe data shown in Figure 11.64. Make sure that you have set the Border field to As Shown.

    news15
    Figure 11.64: Newspaper Example--Assigning Flowframe Data to L Shaped Divider

  18. Next comes a horizontal divider to separate the top two columns from the bottom columns (which will be created later). Select the open line tool, and construct a line with end points at: (58pt, 514.75pt) and (536.5pt, 514.75pt) as shown in Figure 11.65.

    news16
    Figure 11.65: Newspaper Example--Added Horizontal Divider

  19. Switch to the select tool, select this line and assign the flowframe data shown in Figure 11.66.

    news17
    Figure 11.66: Newspaper Example--Assigning Flowframe Data to Horizontal Divider

  20. Next comes another header frame. Select the rectangle tool, and construct a rectangle with opposing corners at: (58pt, 522pt) and (536.5pt, 551pt) as shown in Figure 11.67.

    news18
    Figure 11.67: Newspaper Example--Added Lower Header

  21. Switch to the select tool, select this rectangle, and assign the flowframe data as shown in Figure 11.68. The frame contents is another sectioning command:
    \section{Relief as Missing Sheep Finally Return Home}
    

    news19
    Figure 11.68: Newspaper Example--Assigning Flowframe Data to Lower Header

  22. At the bottom of the page, I want to have two columns, with the text flowing from the left hand column into the right hand column. This means that these frames need to be flow frames. Select the rectangle tool, and construct two rectangles with opposing corners at:
    • (58pt, 565.5pt) and (290pt, 783pt)
    • (304.5pt, 565.5pt) and (536.5pt, 783pt)
    as shown in Figure 11.69.

    news20
    Figure 11.69: Newspaper Example--Added Lower Left and Right Rectangles

  23. Switch to the select tool, select the left lower rectangle and assign the flowframe data shown in Figure 11.70. Similarly for the right hand lower rectangle.

    news21
    Figure 11.70: Newspaper Example--Assigning Flowframe Data to Lower Left Rectangle

  24. I also want to have an image in the lower left hand frame. This is going to be slightly more complicated as flow frames can not be assigned a shape like the static and dynamic frames. The image I'm going to use is called sheep.png and is provided with the flowfram package, but it is also available in the examples subdirectory of FlowframTk's installation directory. Use Bitmap->Insert Bitmap to insert this image, and then either drag it with the mouse or use the Edit->Move By dialog box to move it by (50pt, 556pt) to the location shown in Figure 11.71.

    news22
    Figure 11.71: Newspaper Example--Added Sheep Bitmap

  25. Assign this bitmap the flowframe data shown in Figure 11.72.

    news23
    Figure 11.72: Newspaper Example--Assigning Flowframe Data to Sheep Bitmap

  26. As it stands, any text in the left flow frame will overlap the sheep image, so I'm going to construct a new polygon to go around the sheep image. This polygon will not form a frame, but will be used to construct the parameters of the \parshape command, which can then be input at the start of the flow frame. To do this, select the closed line tool, and construct a polygon with vertices at: (116pt, 565.5pt), (116pt, 580pt), (101.5pt, 580pt), (101.5pt, 609pt), (58pt, 609pt), (58pt, 783pt), (290pt, 783pt) and (290pt, 565.5pt) as shown in Figure 11.73.

    news24
    Figure 11.73: Newspaper Example--Added Polygon Defining Text Region

  27. Select this polygon, and select the TeX/LaTeX->Parshape menu item. This will open the dialog box shown in Figure 11.74(a). Select the Use Path option and click Okay. Save to a file named sheepcutout.tex (Figure 11.74(b)).

       
     newsparshapea newsparshapeb  
     (a) (b)  
    Figure 11.74: Newspaper Example--computing \parshape parameters: (a) select "Use Path" option; (b) export dialog.

  28. Open the preamble pane using preamble editor using TeX/LaTeX->Preamble Editor or just move the divider across and set the early-preamble code as follows:
    \usepackage[utf8]{inputenc}
    \usepackage[T1]{fontenc}
    \usepackage{lmodern}
    
    (see Figure 11.75) and the late preamble to
    % suppress section numbering
    \setcounter{secnumdepth}{0}
    % set the paragraph indentation for static
    % and dynamic frames
    \setlength{\sdfparindent}{\parindent}
    
    (See Figure 11.76.)

    newspreamble
    Figure 11.75: Newspaper Example--Setting the Early Preamble Code

    newspreamble2
    Figure 11.76: Newspaper Example--Setting the Late Preamble Code

  29. Construct a rectangle with opposing corners at: (551.0, 797.5) and (580.0, 826.5) as shown in Figure 11.77.

    news27
    Figure 11.77: Newspaper Example--Constructing the Footer Frame

  30. Following the same procedure as before, select this new rectangle and make it a dynamic frame with the label "footer" and middle alignment. Then click on the Compute Symmetric X Shift button to calculate the horizontal shift for even pages. Set the contents to just \itshape (see Figure 11.78).

    news28
    Figure 11.78: Newspaper Example--Assigning the Footer Frame Data

  31. Save the image as newspaper.jdr and then select the File->Export menu item. Select the Class (*.cls) filter, and save as newspaper.cls.

  32. Use your favourite text editor to create a file called news.tex that looks like:
    \documentclass{newspaper}
    
    \begin{document}
    % set the paragraph shape
    \input{sheepcutout}
    % suppress paragraph indentation
    \noindent
    There was much celebration yesterday morning when Little Bo
    Peep's sheep finally returned home. They had been missing
    for more than a week.
    
    ``I just didn't know where to find them,'' the shepherdess
    stated, ``but I was told to leave them alone and they'd come
    home.''
    
    % lots of text omitted
    \end{document}
    
    This file is also available in the examples subdirectory of FlowframTk's installation directory.

  33. The included images are PNG files, which means that if you are not using PDFLaTeX you will have to convert them to Encapsulated Postscript (EPS) to use LaTeX and dvips. Run news.tex through LaTeX, e.g.
    pdflatex news
    
    The resulting document is shown in Figure 11.79.

    news25
    Figure 11.79: Newspaper Example--Final Document

Things to note:



Footnotes

... frame.11.1
This is of course only an approximate guide, as larger or smaller font sizes may be used in a frame, which will affect the total number of lines in the frame.


Previous: A Poster  Up: Step-by-Step Examples  Next: A Brochure  

© 2014 Dickimaw Books. "Dickimaw", "Dickimaw Books" and the Dickimaw parrot logo are trademarks. The Dickimaw parrot was painted by Magdalene Pritchett.

Terms of Use Privacy Policy Cookies Site Map FAQs