Professional outputs with ODS LATEX

Similar documents
An Introduction to ODS for Statistical Graphics in SAS 9.1 Robert N. Rodriguez SAS Institute Inc., Cary, North Carolina, USA

Overview 14 Table Definitions and Style Definitions 16 Output Objects and Output Destinations 18 ODS References and Resources 20

INTRODUCTION TO SAS HOW SAS WORKS READING RAW DATA INTO SAS

ODS TAGSETS - a Powerful Reporting Method

1 Introduction. 2 About L A TEX. Page 1(6) Why LATEX is used for review report typesetting within the TDB. project

Contents. About This Book...1

Math 3820 Project. 1 Typeset or handwritten? Guidelines

Statistics Statistical Computing Software

Electronic Production Guidelines

ABSTRACT INTRODUCTION THE ODS TAGSET FACILITY

Latex Tutorial. CIS400 Senior Design 9/5/2013

Multiple Graphical and Tabular Reports on One Page, Multiple Ways to Do It Niraj J Pandya, CT, USA

Making a SYLK file from SAS data. Another way to Excel using SAS

Output Delivery System: The Basics and Beyond Lauren E. Haworth Cynthia L. Zender Michele M. Burlew

An Introduction to. Rado Ivanov CIS400 Senior Design Tutorial September 18, 2014

PharmaSUG Paper SP09

Getting Started With Navigator Online and Content Management.

VERY VERY SHORT GUIDE TO LATEX

ODS in an Instant! Bernadette H. Johnson, The Blaze Group, Inc., Raleigh, NC

L A TEX for psychological researchers

Essentials of the SAS Output Delivery System (ODS)

COMP496/901: Academic Presentation and Writing Skills Using LaTeX

SAS/GRAPH Introduction. Winfried Jakob, SAS Administrator Canadian Institute for Health Information

How to prepare slides using latex. How to prepare slides using latex.zip

Began as TeX, in 1982 (Knuth). Purely a typesetting tool. LaTeX added macros, maintaining TeX as it s typesetting engine (Lamport).

What is LaTeX. Is a document markup language and document preparation system for the TeX typesetting program

Typesetting Technical Reports Using LaTeX

Techdata Solution. SAS Analytics (Clinical/Finance/Banking)

Word-to-L A TEX specification

WYSIWYG Systems. CSCM10 Research Methodology Lecture 4 (11/2/16): A Taster of L A TEX WYSIWYM. Advantages/Disadvantages of WYSIWYG Systems

Why learning L A TEX is worth the effort

Macros for creating a custom report of figures

CSCM10 Research Methodology A Taster of L A TEX

Reporting from Base SAS Tips & Tricks. Fareeza Khurshed BC Cancer Agency

Creating Your Paper or Thesis With LYX

CHECK FOR FILE CONSISTENCY

Quick Results with the Output Delivery System

ABSTRACT MORE THAN SYNTAX ORGANIZE YOUR WORK THE SAS ENTERPRISE GUIDE PROJECT. Paper 50-30

Reports in AST2210. Introduction: The Why Why are we doing this exercise, what are our assumptions, what do we want to accomplish?

Quark XML Author October 2017 Update for Platform with Business Documents

SAS CLINICAL SYLLABUS. DURATION: - 60 Hours

Can Adobe Acrobat 8 Professional Convert Pdf To Excel

COMS 6100 Class note

L A T E X crash course

NEW FEATURES IN FOUNDATION SAS 9.4 CYNTHIA JOHNSON CUSTOMER LOYALTY

ithenticate User Guide Getting Started Folders Managing your Documents The Similarity Report Settings Account Information

TeXnicCenter v1 Beta Frank Van Puyvlde ICT for Research K.U.Leuven

IEEE Transactions on Fuzzy Systems (TFS) is published bi-monthly (February, April, June, August, October and December).

Learn Well Technocraft

Getting Started with the SAS 9.4 Output Delivery System

SAS Online Training: Course contents: Agenda:

Mikkel Madsen

Power BI 1 - Create a dashboard on powerbi.com... 1 Power BI 2 - Model Data with the Power BI Desktop... 1

Figure 1. Table shell

Quark XML Author September 2016 Update for Platform with Business Documents

Reviewing Changes. 5. Click Search. A list of changes that include the specified word or words is displayed in the lower text area.

Pre Lab (Lab-1) Scrutinize Different Computer Components

Introducing live graphics gems to educational material

Lab1: Communicating science

Getting Started with the SAS 9.4 Output Delivery System

L Y X for many purposes

CSCM10 Research Methodology A Taster of L A TEX

WYSIWYG Systems. CSCM10 Research Methodology A Taster of L A TEX WYSIWYM. Advantages/Disadvantages of WYSIWYG Systems.

How to get started in L A TEX

SESUG Paper RIV An Obvious Yet Helpful Guide to Developing Recurring Reports in SAS. Rachel Straney, University of Central Florida

An Introduction to Creating Multi- Sheet Microsoft Excel Workbooks the Easy Way with SAS

ODS/RTF Pagination Revisit

Introduction. LaTeX (pronounced lay-tech ) is a professional document preparation system.

Exporting Variable Labels as Column Headers in Excel using SAS Chaitanya Chowdagam, MaxisIT Inc., Metuchen, NJ

Formatting with LaTeX

Line Spacing and Double Spacing...24 Finding and Replacing Text...24 Inserting or Linking Graphics...25 Wrapping Text Around Graphics...

Workshop on LATEX 2ε. Asst. Prof. Dr. Kemal Bagzibagli Department of Economics. 20 May 2015

Moving to XML: The Investment

Moving Data and Results Between SAS and Excel. Harry Droogendyk Stratia Consulting Inc.

LYX with Beamer and Sweave

Report Writing with Lyx

Run your reports through that last loop to standardize the presentation attributes

LATEX, BibTEX, and Friends. Robert Buels. Outline. What is LATEX. Using BibTEX LYX the graphical LATEX Managing your BibTEX references Further reading

Easy-to-use Chinese MTEX Suite Hongbin Ma School of Automation Beijing Instititue of Technology March 14, 2012 Beijing, China

Developing Graphical Standards: A Collaborative, Cross-Functional Approach Mayur Uttarwar, Seattle Genetics, Inc., Bothell, WA

OpenOffice.org Writer

Written & Oral Presentation: Computer Tools

SAS Solutions for the Web: Static and Dynamic Alternatives Matthew Grover, S-Street Consulting, Inc.

1. The Joy of TEX. Check out this example!

Stat 302 Statistical Software and Its Applications SAS: Data I/O & Descriptive Statistics

Getting started with Latex

CORE STATES GROUP TRAINING SERIES BLUEBEAM EXPORTING CREATED BY: CSG IT CORE STATES GROUP

Advanced Topics in Curricular Accessibility: Strategies for Math and Science Accessibility

LaTeX. Information Literacy II EN(IL2) Course

Writing Programs in SAS Data I/O in SAS

Lecture 5 of AMS 200 LaTeX Typesetting, Writing and

Getting Started in L A TEX

General Methods to Use Special Characters Dennis Gianneschi, Amgen Inc., Thousand Oaks, CA

Using Microsoft Excel to write SAS code Andrew Boyd, Quanticate, Edinburgh, UK

Word 2016: Core Document Creation, Collaboration and Communication; Exam

SOFTWARE ARCHITECTURE 4. TEXT FORMATTING SYSTEM

What you will learn 2. Converting to PDF Format 15 Converting to PS Format 16 Converting to HTML format 17 Saving and Updating documents 19

SOFTWARE AND MULTIMEDIA. Chapter 6 Created by S. Cox

Introduction to L A TEX

Simply Accounting Intelligence Tips and Tricks Booklet Vol. 1

Transcription:

Paper TU04 Professional outputs with ODS LATEX Arnaud DAUCHY, Sanofi Aventis, Paris, France Solenn LE GUENNEC, Sanofi Aventis, Paris, France ABSTRACT ODS tagset and ODS markup have been embedded from SAS 8 to SAS 9. It is a very good opportunity to link SAS reports and LaTeX. We can now generate graphics easily in a postscript format. Through basic SAS code, it is possible to include it automatically in our LaTeX Documents or presentations. INTRODUCTION ODS tagset was experimental in SAS Version 8. Now in SAS 9.1, new functionalities were implemented making this tool easier to use. SAS 9 also provides ODS GRAPHICS and new publishing destinations, like ODS LATEX. Even if this is experimental also in this version, it gives the new possibility to have statistical graphics displayed quite automatically. We will present an overview of these possibilities to produce added-value reports. WHAT IS LATEX LaTeX is a professional text treatment tool; it s a markup language that can be compiled into PDF, PostScript or DeVice Independent (DVI) formats, allowing creating written documents (reports, articles, books, letters) of high quality. All that you need is the free LaTeX processing system that can be downloaded from the Web. Indeed, after spending little time learning the LaTeX code, you will get very nice reports - in terms of layout. The main principle is to open LaTeX text editor, and to enter all tagsets and text information about the document you want to produce. It needs little more investment that usual Word or PowerPoint, but you will get a better final rendering than with classical text treatment tools. Of course, the code you will produce once will be reusable as a basis to create new documents. Additionally, the mathematical mode will allow you to write mathematical equations or formulas in a simple way, with an excellent layout on your final document. WHY USE LATEX LaTeX it s not very used in the pharmaceutical industry, despite its advantages compared to Word or PowerPoint. Using a markup language such as LaTeX provides some rather unique advantages over other approaches, especially for large, detailed reports. The main advantages of LaTeX are for example: - the typesetting of mathematical formulae is supported in a convenient way, - even complex structures such as footnotes, references, table of contents and bibliographies can be generated easily, - users only need to learn a few easy-to-understand commands which specify the logical structure of a document. They don t need to tinker with the actual layout of the document, - it s possible to include many effects and animations in presentations. Moreover, LaTeX is faster on big documents because you write down only the content and software wastes no time thinking about layout. The separate type setting steps are only done at the end, which saves you time. 1

SAS & LATEX ODS GRAPHICS SAS introduced the Output Delivery System (ODS) in version 7 which provides a way of redirecting and customizing tabular SAS output. SAS has extended the capabilities of ODS in version 9.1 to include graphics for some of its statistical procedures. Using ODS graphics, a procedure automatically creates the graphs that are most commonly needed for a particular analysis and eliminates the need to save numerical results in an output data set, manipulate them with a DATA step program, and display them with a graphics procedure. With ODS graphics it s easy to: - create statistical graphics in various formats including Rich Text Format (RTF), PostScript (PS), or HTML (HTM) formatted files for inclusion in other programs like Word, Internet explorer or LaTeX - select and exclude components of the statistical graphics output - use styles and templates to customize the appearance of statistical graphics ODS MARKUP Regarding LaTeX destination, we can use four LaTeX tagsets within SAS9: LaTeX, ColorLaTeX, SimpleLaTeX, and TablesOnlyLaTeX. Both the LaTeX and ColorLaTeX destinations have complex style sheets and macros that allow them to create outputs that look very much like the output from the HTML or RTF destinations. The SimpleLaTeX destination creates LaTeX with a simple style definition so that it can be more easily incorporated into a LaTeX document that already exists. These three tagsets generate LaTeX that can be directly compiled into PDF or PostScript. If you are writing papers, reports or slides in LaTeX, then there is another tagset that you can use, called TablesOnlyLaTeX. This tagset allows you to create LaTeX snippets to include in another LaTeX document. In the following example, we will focus on this last tagset: TablesOnlyLaTeX. This will generate the LateX code concerning a graph, but will ignore all other LaTeX information like system titles and footnotes, etc. The major advantage is that we can replace any specific command by this code in our initial LaTeX document, to get a graphic inserted automatically. EXAMPLE You are writing a report in LaTeX and you want to include a graph in this report but this graph is not produced because you re waiting for data. You can include a flag that you will use to insert automatically the graph when it will be available, like in the following code: 2

Once compiled in PDF: Data are now available and you want to incorporate the graph in your report. With ODS Graphics & ODS LaTeX, you can produce graphics in PostScript mode: /* Step 1: Generate a Graph in PostScript, with ODS LATEX */ ods tagsets.tablesonlylatex file="c:/temp/my_graph.tex" (notop nobot) newfile=table; ods select DiagnosticsPanel; ods graphics on / imagename="c:/temp/graphname" reset; proc reg data=sashelp.class; model Weight = Height Age; run;quit; ods graphics off; ods tagsets.tablesonlylatex close; Now you can ask SAS to replace automatically the flag in your LaTeX code by the code which will insert the graph: 3

filename tex "C:/Temp"; %let file=my_tex_file; /* your initial TEX file */ /* Step 2: Load the tex file containing the graph into a SAS dataset */ data work.my_graph ; infile tex(my_graph.tex) length=linelong ; input @; input line $varying500. linelong ; run ; /* Step 3: Load your initial TEX file. Replace 'INSERT_MY_GRAPH' by the real LATEX code Provide a new file with the final code */ data work.saspgm ; infile tex(&file..tex) length=linelong ; input @; input line $varying500. linelong ; file tex(&file._new.tex) ; if index (line, 'INSERT MY GRAPH') gt 0 then do; set work.my_graph ; put line; end; else do; put line $varying500. linelong ; end; run ; Then you just need to compile the new TeX file in PDF to get the final result: 4

But then you decide to replace this graph by another one. You generate a new graph in PostScript: 5

/* Generate an other Graph in postscript, with ODS LATEX */ ods tagsets.tablesonlylatex file="c:/temp/my_graph.tex" (notop nobot) newfile=table; ods graphics on / imagename="c:/temp/graphname" reset; proc lifetest data=mydata.survival; time surv*censor(1); strata trt; survival plots=(survival); id subjid; run; ods graphics off; ods tagsets.tablesonlylatex close; You just have to compile the TeX file in PDF, and you obtain the following result: 6

You can easily change the style of the graph, for example you want a graph with the journal style: /* Generate an other Graph in postscript, with ODS LATEX */ ods tagsets.tablesonlylatex file= C:/Temp/my_graph.tex (notop nobot) newfile=table style=journal; ods graphics on / imagename= C:/Temp/GraphName reset; proc lifetest data=mydata.survival; time surv*censor(1); strata trt; survival plots=(survival); id subjid; run; ods graphics off; ods tagsets.tablesonlylatex close; After having compiled the TeX file in PDF you will obtain: 7

Whatever the changes you want to apply to the graph, you don t need to change the LaTeX code, you just need to produce the graph and to compile the TeX file and you not have to worry about the layout. CONCLUSION Even if official submissions cannot be made with LaTeX, this new tagset destination is a good beginning for us to go to LaTeX for all other types of documents, and to give a better image of what we can produce with SAS in terms of graphics. Then this first step is a good added value to presentations or publications. In future version, we would expect to have a better control and direct output from any SAS procedure to LaTeX document. RECOMMENDED READING SAS 9 online documentation about ODS Graphics: http://support.sas.com/rnd/app/da/stat/odsgraph/index.html SAS 9 & LaTeX: http://support.sas.com/rnd/base/ods/odsmarkup/latex.html LaTeX: http://www.latex-project.org/ CONTACT INFORMATION Contact the author at: Arnaud DAUCHY Sanofi Aventis Arnaud.Dauchy@sanofi-aventis.com Solenn LE GUENNEC Sanofi Aventis Solenn.Le-Guennec@sanofi-aventis.com 8