writing code in latex
begin{lstlisting}
Put your code here.
end{lstlisting}
writing code in latex
begin{lstlisting}
Put your code here.
end{lstlisting}
latex code
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{listings}
usepackage{xcolor}
definecolor{codegreen}{rgb}{0,0.6,0}
definecolor{codegray}{rgb}{0.5,0.5,0.5}
definecolor{codepurple}{rgb}{0.58,0,0.82}
definecolor{backcolour}{rgb}{0.95,0.95,0.92}
lstdefinestyle{mystyle}{
backgroundcolor=color{backcolour},
commentstyle=color{codegreen},
keywordstyle=color{magenta},
numberstyle=tinycolor{codegray},
stringstyle=color{codepurple},
basicstyle=ttfamilyfootnotesize,
breakatwhitespace=false,
breaklines=true,
captionpos=b,
keepspaces=true,
numbers=left,
numbersep=5pt,
showspaces=false,
showstringspaces=false,
showtabs=false,
tabsize=2
}
lstset{style=mystyle}
begin{document}
The next code will be directly imported from a file
lstinputlisting[language=Octave]{BitXorMatrix.m}
end{document}
include code in latex
usepackage{listings}
usepackage{color}
definecolor{dkgreen}{rgb}{0,0.6,0}
definecolor{gray}{rgb}{0.5,0.5,0.5}
definecolor{mauve}{rgb}{0.58,0,0.82}
lstset{frame=tb,
language=Java,
aboveskip=3mm,
belowskip=3mm,
showstringspaces=false,
columns=flexible,
basicstyle={smallttfamily},
numbers=none,
numberstyle=tinycolor{gray},
keywordstyle=color{blue},
commentstyle=color{dkgreen},
stringstyle=color{mauve},
breaklines=true,
breakatwhitespace=true,
tabsize=3
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us