%% This is file `bfh-layout-listings.cfg' version 2.2.8 (2026-08-13), %% it is part of %% BFH-CI -- Corporate Design for Bern University of Applied Sciences %% ---------------------------------------------------------------------------- %% %% Copyright (C) 2021--2026 by %% Marei Peischl %% Andreas Habegger %% %% ============================================================================ %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3c %% of this license or (at your option) any later version. %% The latest version of this license is in %% http://www.latex-project.org/lppl.txt %% and version 1.3c or later is part of all distributions of LaTeX %% version 2008/05/04 or later. %% %% This work has the LPPL maintenance status `maintained'. %% %% The Current Maintainers of this work are %% Marei Peischl %% Andreas Habegger %% %% The development respository can be found at %% https://gitlab.ti.bfh.ch/bfh-latex/bfh-ci/ %% Please use the issue tracker for feedback! %% %% ============================================================================ %% \ProvidesFile{bfh-layout-listings.cfg}[2026-08-13 v2.2.8 listings configuration for bfhlayout] \RequirePackage{bfhcolors} \RequirePackage{listings} %% \lstloadlanguages{[ANSI]C,C++,Matlab,[LaTeX]TeX,bash,python} %% %% ----- code highliting colors \definecolor{codegreen}{rgb}{0,0.6,0} \definecolor{codegray}{rgb}{0.5,0.5,0.5} \definecolor{codepurple}{rgb}{0.58,0,0.82} \definecolor{backcolor}{rgb}{0.95,0.95,0.92} %% \definecolor{datatype}{rgb}{0.58,0,0.82} \definecolor{decision}{rgb}{0.5,0.5,0.5} \definecolor{memory}{rgb}{0,0.6,0} \definecolor{special}{rgb}{0,0.6,0.6} %% -- Fixed width typewriter font for code and sans-serif font for comments in listings \lstset{% basicstyle=\ttfamily\selectfont, commentstyle=\sffamily\itshape\selectfont\color{codegreen}, keywordstyle=\bfseries\selectfont, stringstyle=\color{BFH-DarkPurple}, directivestyle={\color{BFH-MediumRed}}, extendedchars=true, showstringspaces=true, columns=fixed, % columns in the source code are respected aboveskip=\smallskipamount, belowskip=\smallskipamount }% %% %% ------ BFH listing style definitions %% \lstdefinestyle{linebreaks}{% breaklines, breakatwhitespace, numbers=none }% %% \lstdefinestyle{frame}{% style=linebreaks, basicstyle=\scriptsize\ttfamily\selectfont, numbers=left, numberstyle=\color{BFH-Gray!80}, xleftmargin={4pt}, captionpos=b, frame=trbl, frameround=tttt, framesep=1mm, basewidth=.5em, framerule=0pt, backgroundcolor=\color{BFH-Gray!10}, rulecolor=\color{BFH-Gray!80}, abovecaptionskip=\medskipamount, belowcaptionskip=\medskipamount }% %% \lstdefinestyle{float}{% style=frame, float=tp }% %% %% ------ language specific pre-defines %% \lstdefinestyle{bfh-c}{% language=C, style=frame, emph={printf,srand,scanf}, emphstyle=\bfseries\selectfont, }% %% \lstdefinestyle{bfh-cpp}{% language=C++, style=frame, emph={cout,std,::,endl,cin}, emphstyle=\bfseries\selectfont, }% %% \lstdefinestyle{bfh-vhdl}{% style=frame, language=VHDL, }% \lstdefinestyle{bfh-framed}{% backgroundcolor=\color{BFH-Gray!10!white}, % choose the background color; you must add \usepackage{color} or \usepackage{xcolor} basicstyle=\scriptsize\ttfamily, % the size of the fonts that are used for the code breakatwhitespace=false, % sets if automatic breaks should only happen at whitespace breaklines=true, % sets automatic line breaking captionpos=b, % sets the caption-position to bottom commentstyle=\color{BFH-DarkGreen}\textit, % comment style deletekeywords={...}, % if you want to delete keywords from the given language escapeinside={\%*}{*)}, % if you want to add LaTeX within your code extendedchars=true, % lets you use non-ASCII characters; for 8-bits encodings only, does not work with UTF-8 frame=tb, % adds a frame around the code keepspaces=false, % keeps spaces in text, useful for keeping indentation of code (possibly needs columns=flexible) keywordstyle=\color{BFH-DarkBlue}\bfseries, % keyword style language=bash, % the language of the code (can be overrided per snippet) numbers=none, % where to put the line-numbers; possible values are (none, left, right) numbersep=2pt, % how far the line-numbers are from the code numberstyle=\tiny\color{BFH-Gray}, % the style that is used for the line-numbers rulecolor=\color{BFH-Orange}, % if not set, the frame-color may be changed on line-breaks within not-black text (e.g. comments (green here)) framerule=.5pt, showspaces=false, % show spaces everywhere adding particular underscores; it overrides 'showstringspaces' showstringspaces=false, % underline spaces within strings only showtabs=false, % show tabs within strings adding particular underscores stepnumber=1, % the step between two line-numbers. If it\'s 1, each line will be numbered showlines=false, %stringstyle=\color{BFH-DarkPurple}, % string literal style tabsize=2, % sets default tabsize to 2 spaces title=\lstname, % show the filename of files included with \lstinputlisting; also try caption instead of title xleftmargin=15pt, xrightmargin=25pt, framexleftmargin=10pt, framexrightmargin=10pt, columns=fixed % Using fixed column width (for e.g. nice alignment) }% % %% default \lstset{ style=float, }% \endinput