SAS Users Group in Israel

BookmarkSubscribeRSS Feed
ziporapr
Fluorite | Level 6

 Hi,

I have to write to a PDF file a formula like this:

נוסחא.GIF

I found online code like thils:

 

data test;

length x $150;

x=" סיגמא  עם נוסחא : \field{\*\fldinst {EQ \\I\\su(i=1,n, ) }}}";

run;

ods rtf file="report_test.rtf" ;

proc report data=test noheader nofs style={protectspecialchars=off frame=void rules=none};

run;

ods rtf close;

 

It's work excellent.  You can see it in file.rtf.  

 

H__SAS_Config_Lev1_SASApp_report_test.GIF

I tried to combain this report in the PDF file and it's not succeed.

 

data test;

length x $150;

x="{ סיגמא  עם נוסחא : \field{\*\fldinst {EQ \\I\\su(i=1,n, ) }}}";

run

ods escapechar = '^';

ods pdf file="C:\Temp\pdf_test.pdf"  ;         

/*ods text="test PDF ^{unicode 03A3}^{sub (t=0)}^{super  12-x}";*/

proc report data=test noheader nofs style={protectspecialchars=off frame=void rules=none};

run;

ods pdf close;

 

You can see in file C__Temp_pdf_test.pdf.  

C__Temp_pdf_test.GIF

 

Please advise

8 REPLIES 8
ballardw
Super User

The PDF does not work because the values in the text you are using that work in RTF are RTF codes. Everything that starts with \ relates to a specific RTF operation.

 

No clue what the equivalent in PDF would be.

EyalGonen
Lapis Lazuli | Level 10

Hi @ziporapr 

 

Take a look at https://tex.stackexchange.com/questions/428367/how-is-a-mathematical-formula-represented-in-pdf to see an example on how to write mathematical formulas in PDF syntax.

Once you figure that out that embed that into the SAS code using ODS TEXT.

 

Perhaps a better forum to ask these kind of questions is https://communities.sas.com/t5/ODS-and-Base-Reporting/bd-p/ods_base_reporting 

 

HTH,

Eyal

Reeza
Super User
Do you need code that works for both RTF and PDF or just PDF?
If just PDF, latex is another option.
ziporapr
Fluorite | Level 6
Just PDF
EyalGonen
Lapis Lazuli | Level 10

I also found this on the web: https://moser-isi.ethz.ch/docs/typeset_equations.pdf

Again, you may want to try to insert the sample Latex code in SAS' ODS TEXT statement using the appropriate escapechar

ziporapr
Fluorite | Level 6
יש משהו שעובד עם LaTex בעברית?
אם לא, אני קצת חוששת להיות החלוצה. עברית + נוסחאות מתמטיות + כלי שלא השתמשו בו אף פעם למטרה כזאת, נשמע לי מתכון להרבה אתגרים ...
EyalGonen
Lapis Lazuli | Level 10

שלום @ziporapr ,

 

אני אישית לא יודע אבל אני לא רואה סיבה שזו תהיה בעיה.

מצאתי בחיפוש ברשת כל מיני דוגמאות והתייחסויות ל LaTeX ועברית.

האם הצלחת לשתול נוסחה ללא עברית ב PDF?

באופן כללי זו יותר שאלה לפורום שעוסק ב LaTeX מאשר לפורום של SAS - אני בטוח שיש כאלה ברשת.

 

כאמור, ברגע שתדעי איך לכתוב את הנוסחה באופן נכון שייכנס ל PDF בשפת LaTeX אז כל מה שתצטרכי לעשות הוא להכניס את הפקודה ל SAS באמצעות ODS TEXT וזה "יישתל" בתוך ה PDF.

 

אם יש למישהו ניסיון בנושא זה אנא עזרו ל @ziporapr  🙂

 

אייל

 

 

EyalGonen
Lapis Lazuli | Level 10

דרך אגב - יש לי עוד רעיון שהוא קצת יותר מסורבל אבל כדאי לבדוק אותו אם שום אפשרות אחרת לא תעבוד.

אם אין בעיה לייצר RTF עם הנוסחה (כולל עברית - שוב אני לא חושב שצריכה להיות בעיה עם עברית ב PDF) אפשר לייצר את ה RTF ואז לעשות לו Save As ולשמור אותו כ PDF. אפשר לעשות את זה אוטומטית מתוך SAS אם SAS רץ על מערכת הפעלה Windows. אני יכול לספק קוד לדוגמה שעושה זאת.

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

Discussion stats
  • 8 replies
  • 1724 views
  • 3 likes
  • 4 in conversation