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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

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