به دلیل قطعی اینترنت و نبود دسترسی به ایمیل‌های خارجی، می‌توانید بدون نیاز به تایید ایمیل، ثبت‌نام کنید و پرسش‌های خود را بپرسید.

اولین بار است که به اینجا می‌آیید؟ راهنمای سایت را بخوانید!
0 رای
888 بازدید

سلام.می‌خام یه برنامه که به زبان متلب نوشتم را در تک میکر تایپ کنم. دستورهایی که در جواب سوالم بود را تایپ کردم ولی درست اجرا نمیشه. البته این را بدانید که این برنامه را میخام در پایان نانه ام تایپ کنم.دستورهارو توی thesis01 نوشتم و برنامه را توی chapter07. خواهش میکنم جوابمو بدین.

فایل(های) پیوست:
بهتره نگین توی تک‌میکر تایپ می‌کنین. بهتره بگین در لاتک یا زی‌پرشین.
تک‌میکر یک ادیتور برای استفاده از لاتک یا زی‌پرشین هست.
توسط (7.7k امتیاز)

2 پاسخ

0 رای
 
بهترین پاسخ

همان طور که آقای ابوالفضل دیانت گفتن با مراجعه به
http://www.parsilatex.com/wiki/راهنمای_وارد_کردن_کد_در_متن
مشکل حل می شود.

+1 رای

خود شما می‌گید کد بعد از محیط align استفاده می‌کنید؟ کد را باید در محیط‌های verbatim مانند بنویسید. نمونه زیر قسمتی از پروژه درس ENGG100 من در دانشگاه Wollongong هست که در آن از بسته listings برای حروف‌چینی کد MatLab استفاده کرده‌ام:

\documentclass{article}
\usepackage{color}
\usepackage{listings}
\definecolor{hellgelb}{rgb}{1,1,0.85}
\definecolor{colKeys}{rgb}{0,0,1}
\definecolor{colIdentifier}{rgb}{0,0,0}
\definecolor{colComments}{rgb}{0,0.5,0}
\definecolor{colString}{rgb}{1,0,0}
\lstset{%
    language=matlab,
    float=hbp,
    basicstyle=\ttfamily\small,
    identifierstyle=\color{colIdentifier},
    keywordstyle=\color{colKeys},
    stringstyle=\color{colString},
    commentstyle=\color{colComments},
    backgroundcolor=\color{hellgelb},
    columns=flexible,
    tabsize=4,
    extendedchars=true,
    showspaces=false,
    showstringspaces=false,
    numbers=left,
    numbersep=2em,
    numberstyle=\tiny, %
    frame=single,
    captionpos=b,
    xleftmargin=1em,
    breaklines=true,
    breakautoindent=false,
    breakindent=0pt,
    firstnumber=last,
    morekeywords={importdata,ImportTrackData,ComputeAcceleration,
                              ComputeDistance,Computetheta,ComputeCartesianCoordinates,
                              transpose}%
}
\begin{document}
\begin{lstlisting}[firstnumber=1]
% The ImportTrackData function written by VAFA KHALIGHI

% Define the function with one input which is the name of the track
% data file (InputFile) and outputs time (t), speed in m/s (v), 
% longitudinal G-force (FGt),latitudinal G-force (FGn), 
% tangential acceleartion (at), and  normal acceleration (an)

function [t,v,FGt,FGn,at,an] = ImportTrackData(InputFile)
%
% When we look at the file 'Track-P11-GroupA.txt', we see that it has
% the following formats:
%
% Time (Seconds): 0.00
% Ground Speed (km/h): 135.0286190
% G Force Long (G): 0.27
% G Force Lat (G): 0.1632125
%
% Time (Seconds): 0.02
% Ground Speed (km/h): 135.2315170
% G Force Long (G): 0.27
% G Force Lat (G): 0.1642262
%
% ...
% From this, we can see that : separates strings and numbers in each line
% and we should have four columns. So the importdata function, is the
% perfect choice
%
% Let's first make a variable which is the number of columns of our track
% data:
nocols=4; 
%
% Next, we use the importdata function to separate the columns and then
% automatically create a cell array of strings and a numeric array with
% all the data:
%
TrackDATA=importdata(InputFile,':');
%
% The TrackDATA.data now holds the numeric array; so we first reshape the 
% numeric array into four rows and automatic number of columns using the
% reshape function and then we take the transpose of the reshaped numeric
% array so that we would have automatic number of rows and four columns:
%
TrackMatrix=transpose(reshape(TrackDATA.data,nocols,[]));
%
% t is the first column of this matrix:
%
t=TrackMatrix(:,1);
%
% FGt isthethirdcolumnofthematrix:
% 
FGt=TrackMatrix(:,3);
%
% FGn is thefourthcolumnofthematrix:
%
FGn=TrackMatrix(:,4);
% 
% The second column of the matrix is speed in km/h but we want to have
% speed in m/s so we need to multiply the second column of the matrix
% by 1000/3600=1/3.6:
%
v=TrackMatrix(:,2)/3.6;
% 
% The tangential acceleartion is obtained by multiplying longitudinal
% G-force by 9.8:
%
at=9.8*FGt;
%
% The normal acceleartion is obtained by mutiplying latitudinal G-force
% by 9.8:
%
an=9.8*FGn;
%
% End the definition of the function
end
\end{lstlisting}

\end{document}
پرسیدن سوال
سایت پرسش و پاسخ پارسی‌لاتک جایی برای پرسش و پاسخ درباره سیستم حروف‌چینی لاتک و بسته زی‌پرشین است. در اینجا می‌توانید سوال‌های خود را بپرسید و به سوال‌های دیگران پاسخ دهید.

7.2k پرسش

6.6k پاسخ

23.7k نظر

11.7k کاربر

basket cart icon

محصولات مرتبط با LaTeX

در فروشگاه پارسی‌لاتک


basket cart icon

حمایت مالی از پارسی‌لاتک

برای تامین هزینه‌های نگه‌داری و به‌روزرسانی

محبوب‌ترین برچسب‌ها

رفع خطا جدول xepersian مراجع ریاضی‌نویسی bidi شکل فونت فهرست مطالب شماره‌گذاری منابع پانویس tikz parsilatex بیب‌تک تک‌لایو بیمر اسلاید زی‌پرشین پاورقی سربرگ bibtex نماد رسم شکل فرمول‌نویسی هدر ارجاع‌دهی biditexmaker ویرایشگر قالب beamer واژه‌نامه texstudio اندازه فونت عنوان فصل ماتریس شماره صفحه اعمال نشدن تغییرات در پی‌دی‌اف رسم جدول bidipresentation حاشیه رنگ عنوان شکل اسلاید فارسی محیط قضیه گراف حروف‌چینی کد مکان شکل شماره فصل enumerate tabriz_thesis tikzpicture نمایه align زیرنویس شکل کادر itemize الگوریتم فهرست اشکال listings عدم اجرا نیم‌فاصله فاصله بین خطوط متن لاتین و فارسی hyperref بسته قالب پایان‌نامه فرمول نصب تک‌لایو فارسی‌تک نمودار شماره فرمول glossaries کپشن حروف‌چینی چندستونی خروجی فونت فارسی و انگلیسی ماکرونویسی extrafootnotefeatures لاتک biditools شماره پاورقی پیوست‌ سوال امتحانی فاصله‌گذاری فرمول چندضابطه‌ای tex subfigure biditufte-book header texmaker pdf خطا longtable تصویر شمارنده زیرنویس texlive2015 دیاگرام میک‌تک رسم نمودار شماره‌گذاری صفحات پایان نامه فهرست جداول تورفتگی texlive2016 شعر بولد آکولاد kashida میکروسافت ورد تنظیم جدول سوال چهارگزینه‌ای قاب texworks caption اندیس فاصله عمودی lollipop چپ‌چینی iust-thesis multicol فصل‌نویسی tcolorbox اعداد فارسی pgfplots xindy اوبونتو geometry xelatex texlive کاما fancyhdr وسط‌چینی تک لایو 2015 شماره گذاری به‌روزرسانی بسته aimc46 شکست خط صفر توخالی فرمول طولانی قالب کتاب فونت اعداد بیرون‌زدگی bidipoem عنوان بخش پوستر فاصله سطرها نوشتافت tex-programming قرآن tabriz-thesis ایتالیک winedt جستجوی معکوس فلش جایابی تصویر فهرست تصاویر پاراگراف‌بندی بازیابی اطلاعات هایپرلینک فهرست نمادها شمارنده فصل حروف‌چینی شعر font محیط ریاضی minipage رسم کادر جداکننده جدول طولانی به‌روزرسانی شماره‌گذاری فرمول algorithm2e proof equation eps جدول افقی tabular عکس متن فارسی و انگلیسی پانویس چندستونی کمک مالی فاصله خطوط فونت بولد زیرشکل پانویس پاراگرافی ltrfootnote پیوست computeautoilg فرمول چندخطی persian-bib neveshtuft غلط‌گیری املایی فونت ریاضی پیکان لاتکس قلم baselineskip شماره قسمت عنوان جدول
...