From c9f0bee90550bc4826955ca0b990c2f107bcd498 Mon Sep 17 00:00:00 2001 From: efradtschuk Date: Mon, 10 Jan 2022 09:26:45 +0100 Subject: [PATCH] include minted in preamble only when minted is defined as listingsmode --- commands.tex | 12 ++++++------ setup.tex | 14 ++++++++++++++ 2 files changed, 20 insertions(+), 6 deletions(-) create mode 100644 setup.tex diff --git a/commands.tex b/commands.tex index 92e8dd7..4fd16ee 100644 --- a/commands.tex +++ b/commands.tex @@ -40,11 +40,11 @@ % \newcommand\listingsmode{default} % to use lstlistings % \newcommand\listingsmode{minted} % for a script with exercises only % The following lines include that file or make \listingsmode default to 'default' so that any derivatives of this project will work even without the file. -\IfFileExists{listings-mode.tex}{ - \input{listings-mode.tex} -}{ - \newcommand\listingsmode{default} -} +%\IfFileExists{listings-mode.tex}{ +% \input{listings-mode.tex} +%}{ +% \newcommand\listingsmode{default} +%} % Shell command % ============== @@ -148,7 +148,7 @@ midrule, bottomrule, cref, setlength, maketitle, tableofcontents, foreignlanguage, paragraph, subparagraph, mint, mintinline, inputminted, usemintedstyle, definecolor, - citep, enquote% + citep, enquote, lstinputlisting% }, postbreak=\mbox{{$\hookrightarrow$}\space}, emphstyle={\color{ForestGreen}\bfseries}, diff --git a/setup.tex b/setup.tex new file mode 100644 index 0000000..91bfda6 --- /dev/null +++ b/setup.tex @@ -0,0 +1,14 @@ +% Listings mode +% ============= +% The listings mode can be chosen by writing one of the following to the +%listings-mode.tex file before compilation: +% \newcommand\listingsmode{default} % to use lstlistings +% \newcommand\listingsmode{minted} % for a script with exercises only +% The following lines include that file or make \listingsmode default to +%'default' so that any derivatives of this project will work even without the +%file. +\IfFileExists{listings-mode.tex}{ + \input{listings-mode.tex} +}{ + \newcommand\listingsmode{default} +} \ No newline at end of file