Tag Info

New answers tagged

0

My verbatimbox package can do this. However, I had to renew the verbnobox environment in order to not reset the line number counter (I'll be fixing this in a future release of the package). To reset the line number manually, \setcounter{VerbboxLineNo}{-1}. In this MWE, I set the line number in \scriptsize and the code in \small, both of which can be ...


0

Use the features provided by fancyvrb: \documentclass{article} \usepackage{fancyvrb} \begin{document} \begin{Verbatim}[numbers=left] function I = simpsons(f,a,b,n) % This function computes the integral "I" via Simpson's rule in the % interval [a,b] with n+1 equally spaced points % % Syntax: I = simpsons(f,a,b,n) % % Where, % f= can be either an ...


6

Use a correct list for your numbering instead of \noindent \bf 1.: \documentclass{article} \usepackage{enumitem} \begin{document} \begin{enumerate}[font=\bfseries] \item \begin{verbatim} abc aba \end{verbatim} \item blublb \end{enumerate} \end{document}


0

Use accsupp package. This way you can copy regarless of visual line breaks. \documentclass{article} \usepackage{accsupp} \usepackage{listings} \begin{document} \BeginAccSupp{method=plain,ActualText=long long long command long long long command long long long command long long long command} \begin{lstlisting}[breaklines=true] long long long command long long ...


0

A manual solution, which also survives the list of figures: \documentclass{article} \begin{document} \listoffigures \begin{figure} \caption{For example, \texttt{\textbackslash include\{data/myNewChapterName.tex\}}} \end{figure} \end{document}


2

You will need to grab the input verbatim. Using a similar approach to \verb this might look like \documentclass{article} \makeatletter \catcode`\!=\active \newcounter{ExprNum} \newwrite\mmtlatexfile \immediate\openout\mmtlatexfile=\jobname.mmtlatex\relax \def!{% \begingroup \let\do\@makeother \dospecials \mmttoend } \def\mmttoend#1!{% ...



Top 50 recent answers are included