General ⇒ Special symbols in latex
Special symbols in latex
var date=new Date(); //variable is set for date
var dayweek=date.getDay(); //variable day of the week is set for day
var dayweek_str:String; //variable day of the week is formatted as characters
var year=date.getFullYear(); //year will be displayed
var month=date.getMonth(); //variable is set for the month
var month_str:String; //variable month is formatted as characters
var days=date.getDate(); //variable is set for day
var days_str:String; //variable day is formatted as characters
switch (month){ //this section will declare a case value to correspond to a given month
case(0):month_str="January"; break;
case(1):month_str="February"; break;
case(2):month_str="March"; break;
case(3):month_str="April"; break;
case(4):month_str="May"; break;
case(5):month_str="June"; break;
case(6):month_str="July"; break;
case(7):month_str="August"; break;
case(8):month_str="September"; break;
case(9):month_str="Octomber"; break;
case(10):month_str="November"; break;
case(11):month_str="December"; break; }
if (days<10){ //this will read the current case value of the system date which will match a given month
days_str="0"+days;
}else{
days_str=days; }
switch (dayweek){ //this section will declare a case value to correspond to a given day of the week
case(0):dayweek_str="Sunday"; break;
case(1):dayweek_str="Monday"; break;
case(2):dayweek_str="Tuesday"; break;
case(3):dayweek_str="Wednesday "; break;
case(4):dayweek_str="Thursday"; break;
case(5):dayweek_str="Friday "; break;
case(6):dayweek_str="Saturday"; break; }
date_txt.text=dayweek_str+" "+days_str+" "+month_str+" "+year; //full date will be displayed as day date month year
Please can anybody help?
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
- Stefan Kottwitz
- Site Admin
- Posts: 10335
- Joined: Mon Mar 10, 2008 9:44 pm
- Stefan Kottwitz
- Site Admin
- Posts: 10335
- Joined: Mon Mar 10, 2008 9:44 pm
Special symbols in latex
you could also just use a verbatim environment, for example:
Code: Select all
\documentclass[a4paper,10pt]{article}
\begin{document}
{\footnotesize
\begin{verbatim}
var date=new Date(); //variable is set for date
var dayweek=date.getDay(); //variable day of the week is set for day
var dayweek_str:String; //variable day of the week is formatted as characters
var year=date.getFullYear(); //year will be displayed
var month=date.getMonth(); //variable is set for the month
var month_str:String; //variable month is formatted as characters
var days=date.getDate(); //variable is set for day
var days_str:String; //variable day is formatted as characters
switch (month){ //this section will declare a case value to correspond to a given month
case(0):month_str="January"; break;
\end{verbatim}
}
\end{document}
Stefan
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Special symbols in latex
Is that code of a specific programming language? If so, take a look a the listings package. It lets you format code in several predefined programming languages.ma501th wrote:I am trying to put the following script in a table all in one box with two columns, i need help to identify what are the special symbols in this coding:
[...]
Please can anybody help?
Best regards
Thorsten¹
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
- Stefan Kottwitz
- Site Admin
- Posts: 10335
- Joined: Mon Mar 10, 2008 9:44 pm
Special symbols in latex
If you want to look at the possibilities: Here is the user's guide.
Stefan