Matlab 代码清单

Matlab 代码清单

我正在使用列表

\lstset{language=Matlab,%
    %basicstyle=\color{red},
    breaklines=false,%
    morekeywords={matlab2tikz},
    keywordstyle=\color{blue},%
    morekeywords=[2]{1}, keywordstyle=[2]{\color{black}},
    identifierstyle=\color{black},%
    stringstyle=\color{mylilas},
    commentstyle=\color{mygreen},%
    showstringspaces=false,%without this there will be a symbol in the places where there is a space
    numbers=none,%
    numberstyle={\tiny \color{black}},% size of the numbers
    numbersep=1pt, % this defines how far the numbers are from the text
    emph=[1]{for,end,break},emphstyle=[1]\color{red}, %some words to emphasise
    %emph=[2]{word1,word2}, emphstyle=[2]{style},    
}

  \begin{lstlisting}[frame=single]
for j=1:100:
    j
end
  \end{lstlisting}

我有三个问题:1) 如何删除代码周围的黑框?2) 如何减少代码中的行间?3) 如何从我的 matlab 代码中复制粘贴而不丢失缩进?因为如果我在编辑器中粘贴,它们都会从同一点开始,这很丑陋

相关内容