Simply justify as per title number!

Reply
New Contributor
Posts: 2

Simply justify as per title number!

Hello  ,

I am looking for a simple tweak in my style template , to mention title1-title4 as left justified and title5-title9 as center justified . I have got some 30 tables to report and I do not want to insert j=c in every table title4-9 . Please let me know if there is an easy way to achieve this multiple justification for all the tables in a report.  proc template; header ? or any function that checks title number ?

Thanks !

Grand Advisor
Posts: 17,461

Re: Simply justify as per title number!

What's your destination, HTML, PDF?

You could probably do it via a template or CSS Style sheet.

Grand Advisor
Posts: 10,251

Re: Simply justify as per title number!

See if this gives you a starting point.

proc template;
   define style Styles.myFontsize ;
   parent = Styles.default; /* or the one you prefer*/
    style SystemTitle from TitlesAndFooters /
      fontsize= 26pt;
   style SystemTitle2 from SystemTitle /
      fontsize= 24pt;
   style SystemTitle3 from SystemTitle2 /
      fontsize= 22pt;
   style SystemTitle4 from SystemTitle3 /
      just=center
      fontsize= 20pt;
   style SystemTitle5 from SystemTitle4 /
      fontsize= 18pt;
   style SystemTitle6 from SystemTitle5 /
      fontsize= 16pt;
   style SystemTitle7 from SystemTitle6 /
      fontsize= 14pt;
   style SystemTitle8 from SystemTitle7 /
      just=right
      fontsize= 12pt;
   style SystemTitle9 from SystemTitle8 /
      fontsize= 10pt;
   style SystemTitle10 from SystemTitle9 /
      fontsize= 8pt;
   style SystemFooter from TitlesAndFooters /
      fontsize= 26pt;
   style SystemFooter2 from SystemFooter /
      fontsize= 24pt;
   style SystemFooter3 from SystemFooter2 /
      just=center
      fontsize= 22pt;
   style SystemFooter4 from SystemFooter3 /
      fontsize= 20pt;
   style SystemFooter5 from SystemFooter4 /
      fontsize= 18pt;
   style SystemFooter6 from SystemFooter5 /
      fontsize= 16pt;
   style SystemFooter7 from SystemFooter6 /
      just=right
      fontsize= 14pt;
   style SystemFooter8 from SystemFooter7 /
      fontsize= 12pt;
   style SystemFooter9 from SystemFooter8 /
      fontsize= 10pt;
   style SystemFooter10 from SystemFooter9 /
      fontsize= 8pt;
  end;
run;

ods html style=Styles.myFontsize;

title1  'title1 ';
title2  'title2 ';
title3  'title3 ';
title4  'title4 ';
title5  'title5 ';
title6  'title6 ';
title7  'title7 ';
title8  'title8 ';
title9  'title9 ';
title10 'title10';

footnote1  'footnote1 ';
footnote2  'footnote2 ';
footnote3  'footnote3 ';
footnote4  'footnote4 ';
footnote5  'footnote5 ';
footnote6  'footnote6 ';
footnote7  'footnote7 ';
footnote8  'footnote8 ';
footnote9  'footnote9 ';
footnote10 'footnote10';

proc print data=sashelp.class (obs=1);run;

New Contributor
Posts: 2

Re: Simply justify as per title number!

Thanks a lot Ballard !  It worx Smiley Happy . Does title10  really work ? it has many times overwritten my title1 . 

Reeza ,  I was writing to a PDF.

Test Code :

proc template;

   define style Styles.testpatience ;

   parent = Styles.Mypdf;

   style systemTitle /

   just = left

   font_size = 5

   font_weight = bold

   font_style = italic

   ;

/* Until title5 the above attribs are applied */

   style SystemTitle5 from SystemTitle /

   just=center;

/*This Attrib is Applied to all the titles from title5 */

   style systemFooter /

   just = left

   font_size = 5

   ;

   end;

run;

Grand Advisor
Posts: 10,251

Re: Simply justify as per title number!

The example I provided, at least in HTML, shows Title10 text on my system.

I would look for a missing "0" (zero) on a title statement somewhere that you think is a title10 statement.

Esteemed Advisor
Esteemed Advisor
Posts: 7,253

Re: Simply justify as per title number!

As an alternative, you could set a dataset up to hold title/footnote and style information and generate from there:

SECTION             NO     JUST     TEXT          ... Could add style etc.

TITLE                    1         L            ABV

TITLE                    2         R           ERT

...

data _null_;

     call execute(cats(section," ",strip(put(no,best.))," j=",just," '",text,"';");

run;

    

If you have a lot of titles it nice to be able to store them, qc them, manage them in a dataset or Excel file and not need to type them out.

Ask a Question
Discussion stats
  • 5 replies
  • 280 views
  • 7 likes
  • 4 in conversation