Answers for "programming code in latex"

1

writing code in latex

begin{lstlisting}
Put your code here.
end{lstlisting}
Posted by: Guest on March-28-2021
1

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}
Posted by: Guest on November-16-2020
0

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
}
Posted by: Guest on October-18-2020

Code answers related to "Assembly"

Browse Popular Code Answers by Language