Skip to content

Commit

Permalink
imta_extra: \imtaCodeFromFile and \imtaConsoleFromFile commands added
Browse files Browse the repository at this point in the history
  • Loading branch information
PORTEBOEUF committed Feb 18, 2018
1 parent b9be023 commit ac6073b
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions imta_extra.sty
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
% introduced - support for uppersection
% display in List of Tables/Figures
% 1.2 BP 05.12.2017 Bug fixed in the \chapter redefinition
% 1.3 BP 17.02.2018 Added \imtaCodeFromFile and
% \imtaConsoleFromFrile commands
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


Expand Down Expand Up @@ -197,6 +200,19 @@
}


% imtaCodeFromFile{<file>}{<language>}
% Formats a listing of code from an input file
% Where <file> is the path to the file and <language> is the minted label
% for the corresponding language
\newcommand{\imtaCodeFromFile}[2]{%
\renewcommand{\theFancyVerbLine}{\ttfamily \textcolor{gray!150}{\normalsize \oldstylenums{\arabic{FancyVerbLine}}}}%
\vspace{0.5\baselineskip}%
\begin{mdframed}[backgroundcolor=imtaCodeBackground, innerleftmargin=5pt]%
\inputminted[linenos, breaklines]{#2}{#1}
\end{mdframed}%
}


% imtaConsole
% Format a console session
\newenvironment{imtaConsole}{%
Expand All @@ -210,6 +226,17 @@
}


% imtaConsoleFromFile{<file>}
% Formats a console session from an input file
% Where <file> is the path to the file
\newcommand{\imtaConsoleFromFile}[1]{%
\vspace{0.5\baselineskip}%
\begin{mdframed}[backgroundcolor=imtaCodeBackground, innerleftmargin=5pt]%
\inputminted[breaklines]{text}{#1}
\end{mdframed}%
}



%\figure
% The figure environment is redefined to update the LOF with the upper section title when relevant
Expand Down

0 comments on commit ac6073b

Please sign in to comment.