Upload
eagebhart
View
112
Download
0
Tags:
Embed Size (px)
DESCRIPTION
ODS inline formatting has become very powerful. Even moreso when using it with ODS Markup.
Citation preview
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
TWAS BRILLIG, AND THE SLITHY TOVES, DID GYRE AND GIMBLE IN THE WABE
Sir John Tenniel
Copyright © 2007, SAS Institute Inc. All rights reserved.
Inline Formatting
ods escapechar="*" ;
Copyright © 2007, SAS Institute Inc. All rights reserved.
Inline Formatting
ods escapechar="*" ;
title 'This is *{style [color=red] Red}';
Copyright © 2007, SAS Institute Inc. All rights reserved.
Inline Formatting
ods escapechar="*" ;
title 'This is *{style [color=red] Red}';
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}
Copyright © 2007, SAS Institute Inc. All rights reserved.
Built in Functions
Copyright © 2007, SAS Institute Inc. All rights reserved.
Built in Functions
title3 'Example of ^{nbspace 3} Non-Breaking Spaces Function';
Copyright © 2007, SAS Institute Inc. All rights reserved.
Built in Functions
title3 'Example of ^{nbspace 3} Non-Breaking Spaces Function';
Copyright © 2007, SAS Institute Inc. All rights reserved.
Built in Functions
title4 'Example of ^{newline 2} Newline Function';
Copyright © 2007, SAS Institute Inc. All rights reserved.
Built in Functions
title4 'Example of ^{newline 2} Newline Function';
Copyright © 2007, SAS Institute Inc. All rights reserved.
Built in Functions
title6 'Example of ^{unicode 03B1} UNICODE function';
Copyright © 2007, SAS Institute Inc. All rights reserved.
Built in Functions
title6 'Example of ^{unicode 03B1} UNICODE function';
Copyright © 2007, SAS Institute Inc. All rights reserved.
Text Decoration
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}.";
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}.";
Copyright © 2007, SAS Institute Inc. All rights reserved.
Unicode
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
Copyright © 2007, SAS Institute Inc. All rights reserved.
Unicodeheader = 'Symbol'; compute as '^{unicode ' || value || '}';
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;
Copyright © 2007, SAS Institute Inc. All rights reserved.
Inline Formatting
ods escapechar="*" ;
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="*" ;
Copyright © 2007, SAS Institute Inc. All rights reserved.
Inline Formatting
ods escapechar="*" ;
Copyright © 2007, SAS Institute Inc. All rights reserved.
Inline Formatting
ods escapechar="*" ;
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
}
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
}
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
} }
BEWARE THE JABBERWOCK, MY SON! THE JAWS THAT BITE, THE CLAWS THAT CATCH!
Sir John Tenniel
Copyright © 2007, SAS Institute Inc. All rights reserved.
Inline Formatting
WithTagsets
ods escapechar="*" ;
title 'This is *{super SUPER text} This is *{sub SUB text}';
Copyright © 2007, SAS Institute Inc. All rights reserved.
Inline Formatting
WithTagsets
ods escapechar="*" ;
title 'This is *{super SUPER text} This is *{sub SUB text}';
Format Functions Are Events!
define event super; start: put "<sup>" ; put VALUE; put "</sup>" ; end ;
SO RESTED HE BY THE TUMTUM TREE, AND STOOD AWHILE IN THOUGHT
Copyright © 2007, SAS Institute Inc. All rights reserved.
Other Events?
define event line; put "<hr>"; end;
Copyright © 2007, SAS Institute Inc. All rights reserved.
Other Events?
Copyright © 2007, SAS Institute Inc. All rights reserved.
title1 "
Other Events?
Copyright © 2007, SAS Institute Inc. All rights reserved.
title1 " Example ^{style [foreground=red] of
Other Events?
Copyright © 2007, SAS Institute Inc. All rights reserved.
title1 " Example ^{style [foreground=red] of ^{line} a unicode Alpha
Other Events?
Copyright © 2007, SAS Institute Inc. All rights reserved.
title1 " Example ^{style [foreground=red] of ^{line} a unicode Alpha ^{unicode ALPHA}Other
Events?
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?
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?
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?
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?
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?
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?
Copyright © 2007, SAS Institute Inc. All rights reserved.
Inline Image
Function
dDefine event inline_image; put "<img"; putq "src=" value; put ">"; end;
Copyright © 2007, SAS Institute Inc. All rights reserved.
Inline Image
Function
Copyright © 2007, SAS Institute Inc. All rights reserved.
Inline Image
Function
title2 "
Copyright © 2007, SAS Institute Inc. All rights reserved.
Inline Image
Function
title2 " Example
Copyright © 2007, SAS Institute Inc. All rights reserved.
Inline Image
Function
title2 " Example ^{style [color=green] of
Copyright © 2007, SAS Institute Inc. All rights reserved.
Inline Image
Function
title2 " Example ^{style [color=green] of ^{line} an image
Copyright © 2007, SAS Institute Inc. All rights reserved.
Inline Image
Function
title2 " Example ^{style [color=green] of ^{line} an image ^{inline_image Droplet.jpg}
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}
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}
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} }
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} }";
Copyright © 2007, SAS Institute Inc. All rights reserved.
Inline Image
Function
Copyright © 2007, SAS Institute Inc. All rights reserved.
Inline Image
Function
The Super Duper Function
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;
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
Copyright © 2007, SAS Institute Inc. All rights reserved.
Using the Super DuperInline
FormattingEvent
ods escapechar="*" ;
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}';
Copyright © 2007, SAS Institute Inc. All rights reserved.
Using the Readfile
Event
define event include_file; set $read_file value; trigger readfile; end;
Copyright © 2007, SAS Institute Inc. All rights reserved.
ods text="
~{style [font_style=italic] ~{include_file jabberwocky.txt} }
";
Using the Readfile
Event
Copyright © 2007, SAS Institute Inc. All rights reserved.
ods text="
~{style [font_style=italic] ~{include_file jabberwocky.txt} }
";
Using the Readfile
Event
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;
Copyright © 2007, SAS Institute Inc. All rights reserved.
Include New Lines
define event process_data; put $record; put "<br>" /if $include_newlines;
end;
Copyright © 2007, SAS Institute Inc. All rights reserved.
With New Lines
ods text="
~{style [font_style=italic]
~{include_file jabberwocky.txt} }
";
Copyright © 2007, SAS Institute Inc. All rights reserved.
~{include_newlines True}With
New Lines
ods text="
~{style [font_style=italic]
~{include_file jabberwocky.txt} }
";
Copyright © 2007, SAS Institute Inc. All rights reserved.
With New Lines
TWAS BRILLIG, AND THE SLITHY TOVES, DID GYRE AND GIMBLE IN THE WABE
Sir John Tenniel
So rested he by the tumtum tree, and stood awhile in thought
Copyright © 2007, SAS Institute Inc. All rights reserved.
ODS and Tagset Resources
http://EricGebhart.com
e-mail: [email protected]
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.