[Tex/LaTex] copy text with syntax highlighting

copy/pastehighlightingsyntaxtexstudio

Is there a way to copy LaTeX text out of TeXstudio with syntax highlighting? Will include some macros and small portions of LaTeX in a presentation (Powerpoint) and want to get it as readable as possible.

Best Answer

Well, a simple screen capture with enough zoom can do that, but.... really do you want a copy & paste in PowerPoint?

mwe

\documentclass{beamer}
\title{Listing Code}
\author{Jhon Doe}
\usepackage{listings}
\usepackage{xcolor}
\usetheme{Warsaw}
\lstset{language=[LaTeX]TeX,
numbers=left, numberstyle=\small\sffamily\color{gray}, numbersep=1em,
frame=single, framerule=1pt,
keywordstyle=\color{red!70!black},
commentstyle=\color{blue},
morekeywords={maketitle,apples},
%tabsize=4,
backgroundcolor=\color{yellow!10},
caption=Copy \& Paste from somewhere\ldots}
\begin{document}
\begin{frame}[fragile]{Some \LaTeX\ code}
\begin{lstlisting}{LaTeX}
% This must be before of \maketitle
\title{Listing with syntax}
\author{John Doe}
\date{today} 
% End of preamble
\begin{document}
\maketitle 
\tomatoes % Undefined control sequence
\apples
 ...
\end{lstlisting}
\end{frame}
\end{document}