include minted in preamble only when minted is defined as listingsmode

This commit is contained in:
Fradtschuk 2022-01-10 09:26:45 +01:00
parent 6ebf564ee2
commit c9f0bee905
2 changed files with 20 additions and 6 deletions

View File

@ -40,11 +40,11 @@
% \newcommand\listingsmode{default} % to use lstlistings % \newcommand\listingsmode{default} % to use lstlistings
% \newcommand\listingsmode{minted} % for a script with exercises only % \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. % 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}{ %\IfFileExists{listings-mode.tex}{
\input{listings-mode.tex} % \input{listings-mode.tex}
}{ %}{
\newcommand\listingsmode{default} % \newcommand\listingsmode{default}
} %}
% Shell command % Shell command
% ============== % ==============
@ -148,7 +148,7 @@
midrule, bottomrule, cref, setlength, maketitle, midrule, bottomrule, cref, setlength, maketitle,
tableofcontents, foreignlanguage, paragraph, subparagraph, tableofcontents, foreignlanguage, paragraph, subparagraph,
mint, mintinline, inputminted, usemintedstyle, definecolor, mint, mintinline, inputminted, usemintedstyle, definecolor,
citep, enquote% citep, enquote, lstinputlisting%
}, },
postbreak=\mbox{{$\hookrightarrow$}\space}, postbreak=\mbox{{$\hookrightarrow$}\space},
emphstyle={\color{ForestGreen}\bfseries}, emphstyle={\color{ForestGreen}\bfseries},

14
setup.tex Normal file
View File

@ -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}
}