Ich möchte in meinen Folien Matlab-Programme einbinden. Das ist grundlegend auch kein Problem:
Probleme macht mir, dass der Matlabcode zu lang ist sodass erunten "abfeschnitten" wird. kann man das entweder so anpassen, dass es auf einer Seite ist oder splitten um es auf 2 aufzuteilen?
\documentclass[11pt]{beamer} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage[ngerman]{babel} \usetheme{Singapore} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsthm} \setbeamertemplate{theorems}[numbered] \setbeamertemplate{section in toc}[sections numbered] \definecolor{mygreen}{RGB}{28,172,0} % color values Red, Green, Blue \definecolor{mylilas}{RGB}{170,55,241} \usepackage{listings} \lstset{language=Matlab,% %basicstyle=\color{red}, breaklines=true,% 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=left,% numberstyle={\tiny \color{black}},% size of the numbers numbersep=9pt, % 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{document} \begin{frame} \lstinputlisting{p7.m} \end{frame} \end{document}
Link zum Matlabprogramm
https://people.maths.ox.ac.uk/trefethen/p7.m
Schönen Abend noch und vielen Dank
lisa