اوور لیف لیٹیکس دستاویز میں متلاب کوڈ داخل کریں (چینی تبصرے ، کلیدی لفظ کو اجاگر کرنے کے ساتھ)

Insert Matlab Code Overleaf Latex Document With Chinese Comments



شروعات {دستاویز before سے پہلے داخل کریں

usepackage{listings} usepackage{xcolor} lstset{ language=Matlab, %The code language uses matlab frame=shadowbox,% enclose the code with a shadow box rulesepcolor=color{red!20!green!20!blue!20},% code block border is light cyan keywordstyle=color{blue!90}fseries, %The color of the code keyword is blue, bold commentstyle=color{red!10!green!70} extit,% Set the color of code comments showstringspaces=false,% do not display the space mark in the middle of the code string numbers=left,% show line numbers numberstyle= iny,% line number font stringstyle= tfamily,% Special format of code string breaklines=true,% automatically wrap lines that are too long extendedchars=false, %Solve the problem that Chinese characters such as chapter titles and headers are not displayed when the code is spread across pages escapebegin=egin{CJK*},escapeend=end{CJK*},% Chinese must be added in the code, otherwise an error will be reported texcl=true} lstset{breaklines}% automatically wrap long lines of code lstset{extendedchars=false}% Solve the problem that Chinese characters such as chapter titles and headers are not displayed when the code is spread across pages

دستاویز میں مطلوبہ پوزیشن پر داخل کریں



egin{lstlisting} % Your code end{lstlisting}

نتیجہ اس طرح ہے:
تصویر
نتیجہ ابھی بھی کامل ہے