inline formatting with_markup

74
Copyright © 20088 SAS Institute Inc. All rights reserved. SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. Inline formatting with ODS Markup Eric Gebhart

Upload: eagebhart

Post on 22-Jun-2015

104 views

Category:

Technology


0 download

DESCRIPTION

ODS inline formatting has become very powerful. Even moreso when using it with ODS Markup.

TRANSCRIPT

Page 1: Inline formatting with_markup

Copyright © 20088 SAS Institute Inc. All rights reserved. SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration.

Inline formatting with ODS Markup

Eric Gebhart

Page 2: Inline formatting with_markup

TWAS BRILLIG, AND THE SLITHY TOVES, DID GYRE AND GIMBLE IN THE WABE

Sir John Tenniel

Page 3: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

Inline Formatting

ods escapechar="*" ;

Page 4: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

Inline Formatting

ods escapechar="*" ;

title 'This is *{style [color=red] Red}';

Page 5: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

Inline Formatting

ods escapechar="*" ;

title 'This is *{style [color=red] Red}';

Page 6: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

Built in Functions

~{dagger} ~{sigma} ~{unicode <Hex | name>} ~{super text} ~{sub text} ~{raw <type> text} ~{style <style> <[attributes]> text}

Page 7: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

Built in Functions

Page 8: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

Built in Functions

title3 'Example of ^{nbspace 3} Non-Breaking Spaces Function';

Page 9: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

Built in Functions

title3 'Example of ^{nbspace 3} Non-Breaking Spaces Function';

Page 10: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

Built in Functions

title4 'Example of ^{newline 2} Newline Function';

Page 11: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

Built in Functions

title4 'Example of ^{newline 2} Newline Function';

Page 12: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

Built in Functions

title6 'Example of ^{unicode 03B1} UNICODE function';

Page 13: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

Built in Functions

title6 'Example of ^{unicode 03B1} UNICODE function';

Page 14: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

Text Decoration

Page 15: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

Text Decoration

title7 "

^{style [textdecoration = underline] Switching from underline to} ^{style [textdecoration = line_through] line-through, then} ^{style [textdecoration = overline] overline}.";

Page 16: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

Text Decoration

title7 "

^{style [textdecoration = underline] Switching from underline to} ^{style [textdecoration = line_through] line-through, then} ^{style [textdecoration = overline] overline}.";

Page 17: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

Unicode

Page 18: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

Unicode

data work.unicode; input @1 name $25. @27 value $4.; datalines; Snowman 2603 Black Knight 265E White Rook 2656 Snowflake 2744 Two Fifths 2156 Greater Than or Equal To 2267

Page 19: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

Unicodeheader = 'Symbol'; compute as '^{unicode ' || value || '}';

Page 20: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

Unicode

4

header = 'Symbol'; compute as '^{unicode ' || value || '}'; end; end; run; /* Make the fonts big */ proc template; define style styles.bigprinter; parent=styles.printer; class systemtitle, data, header / fontsize = 40pt ; end; run; /* Generate report */ ods pdf file="unicode.pdf" style=styles.bigprinter; ods html file="unicode.html" style=styles.bigprinter; data _null_; set work.unicode; file print ods=(template='unitable'); put _ods_; run; ods _all_ close;

Page 21: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

Inline Formatting

ods escapechar="*" ;

Page 22: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

Inline Formatting

title "test *{style [foreground=red] of *{super *{unicode ALPHA} *{style [foreground=green] text} } formatting } and such" ;

ods escapechar="*" ;

Page 23: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

Inline Formatting

ods escapechar="*" ;

Page 24: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

Inline Formatting

ods escapechar="*" ;

Page 25: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

and

title "test of *{style [foreground=red] red *{style [foreground=green] green }

Inline Formatting

ods escapechar="*" ;

and such" ;

*{style [foreground=blue] blue } formatting

}

Page 26: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

and

title "test of *{super

*{style [foreground=red] red *{style [foreground=green] green }

Inline Formatting

ods escapechar="*" ;

and such" ; }

*{style [foreground=blue] blue } formatting

}

Page 27: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

and

title "test of *{super

*{style [foreground=red] red *{style [foreground=green] green } *{style [fontsize=18pt]

Inline Formatting

ods escapechar="*" ;

and such" ; }

*{style [foreground=blue] blue } formatting

} }

Page 28: Inline formatting with_markup

BEWARE THE JABBERWOCK, MY SON! THE JAWS THAT BITE, THE CLAWS THAT CATCH!

Sir John Tenniel

Page 29: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

Inline Formatting

WithTagsets

ods escapechar="*" ;

title 'This is *{super SUPER text} This is *{sub SUB text}';

Page 30: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

Inline Formatting

WithTagsets

ods escapechar="*" ;

title 'This is *{super SUPER text} This is *{sub SUB text}';

Page 31: Inline formatting with_markup

Format Functions Are Events!

define event super; start: put "<sup>" ; put VALUE; put "</sup>" ; end ;

Page 32: Inline formatting with_markup

SO RESTED HE BY THE TUMTUM TREE, AND STOOD AWHILE IN THOUGHT

Page 33: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

Other Events?

define event line; put "<hr>"; end;

Page 34: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

Other Events?

Page 35: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

title1 "

Other Events?

Page 36: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

title1 " Example ^{style [foreground=red] of

Other Events?

Page 37: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

title1 " Example ^{style [foreground=red] of ^{line} a unicode Alpha

Other Events?

Page 38: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

title1 " Example ^{style [foreground=red] of ^{line} a unicode Alpha ^{unicode ALPHA}Other

Events?

Page 39: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

title1 " Example ^{style [foreground=red] of ^{line} a unicode Alpha ^{unicode ALPHA} with some lines

Other Events?

Page 40: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

title1 " Example ^{style [foreground=red] of ^{line} a unicode Alpha ^{unicode ALPHA} with some lines }

Other Events?

Page 41: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

title1 " Example ^{style [foreground=red] of ^{line} a unicode Alpha ^{unicode ALPHA} with some lines } ^{newline}

Other Events?

Page 42: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

title1 " Example ^{style [foreground=red] of ^{line} a unicode Alpha ^{unicode ALPHA} with some lines } ^{newline} ^{line}

Other Events?

Page 43: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

title1 " Example ^{style [foreground=red] of ^{line} a unicode Alpha ^{unicode ALPHA} with some lines } ^{newline} ^{line}";

Other Events?

Page 44: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

title1 " Example ^{style [foreground=red] of ^{line} a unicode Alpha ^{unicode ALPHA} with some lines } ^{newline} ^{line}";

Other Events?

Page 45: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

Inline Image

Function

dDefine event inline_image; put "<img"; putq "src=" value; put ">"; end;

Page 46: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

Inline Image

Function

Page 47: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

Inline Image

Function

title2 "

Page 48: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

Inline Image

Function

title2 " Example

Page 49: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

Inline Image

Function

title2 " Example ^{style [color=green] of

Page 50: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

Inline Image

Function

title2 " Example ^{style [color=green] of ^{line} an image

Page 51: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

Inline Image

Function

title2 " Example ^{style [color=green] of ^{line} an image ^{inline_image Droplet.jpg}

Page 52: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

Inline Image

Function

title2 " Example ^{style [color=green] of ^{line} an image ^{inline_image Droplet.jpg} ^{newline}

Page 53: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

Inline Image

Function

title2 " Example ^{style [color=green] of ^{line} an image ^{inline_image Droplet.jpg} ^{newline} ^{line}

Page 54: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

Inline Image

Function

title2 " Example ^{style [color=green] of ^{line} an image ^{inline_image Droplet.jpg} ^{newline} ^{line} }

Page 55: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

Inline Image

Function

title2 " Example ^{style [color=green] of ^{line} an image ^{inline_image Droplet.jpg} ^{newline} ^{line} }";

Page 56: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

Inline Image

Function

Page 57: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

Inline Image

Function

Page 58: Inline formatting with_markup

The Super Duper Function

Page 59: Inline formatting with_markup

The Super Duper Function

define tagset tagsets.sdhtml; parent=tagsets.html4;

define event superDuper; put ‘<span style="border-width:1;’ put ‘ border-style:solid;’ put ‘ border-color: black;"> ‘nl;

Page 60: Inline formatting with_markup

set $word scan(value, 1, ' ');

do /while !cmp($word, ' ');

do /if mod($count, 2); put '<sup>' $word '</sup>'; else; put '<sub>' $word '</sub>'; done;

eval $count $count + 1; set $word scan(value, $count, ' '); done;

Alternate Super and Sub

Page 61: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

Using the Super DuperInline

FormattingEvent

ods escapechar="*" ;

Page 62: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

Using the Super DuperInline

FormattingEvent

ods escapechar="*" ;

title 'This is *{superduper SUPER DUPER text } This is *{sub SUB text}';

Page 63: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

Using the Readfile

Event

define event include_file; set $read_file value; trigger readfile; end;

Page 64: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

ods text="

~{style [font_style=italic] ~{include_file jabberwocky.txt} }

";

Using the Readfile

Event

Page 65: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

ods text="

~{style [font_style=italic] ~{include_file jabberwocky.txt} }

";

Using the Readfile

Event

Page 66: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

Include New Lines

define event include_newlines;

do /if cmp (value, 'True'); set $include_newlines = 'True'; else; else;

unset $include_newlines; done;

end;

Page 67: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

Include New Lines

define event process_data; put $record; put "<br>" /if $include_newlines;

end;

Page 68: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

With New Lines

ods text="

~{style [font_style=italic]

~{include_file jabberwocky.txt} }

";

Page 69: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

~{include_newlines True}With

New Lines

ods text="

~{style [font_style=italic]

~{include_file jabberwocky.txt} }

";

Page 70: Inline formatting with_markup

Copyright © 2007, SAS Institute Inc. All rights reserved.

With New Lines

Page 71: Inline formatting with_markup

TWAS BRILLIG, AND THE SLITHY TOVES, DID GYRE AND GIMBLE IN THE WABE

Sir John Tenniel

Page 72: Inline formatting with_markup

So rested he by the tumtum tree, and stood awhile in thought

Page 74: Inline formatting with_markup

Copyright © 2008, SAS Institute Inc. All rights reserved. SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration.