I'm writing my bachelor thesis in my university's template fithesis3.

It automatically sets the style of the List of Images as such: List of Images

, with a Roman page number.

I'm trying to create a similar listing, List of Source code examples to be more precise. I'm using minted for source code highlighting and wrapping it in listing to be able to set a caption and a reference for it.

So far I've been able to change the default caption name and the default name of the listing as well, but I have yet to successfully change the listing's style.

The code I'm using is: I've edited the source code example to be the smallest compilable version I could, as was adviced in the comments.

\documentclass[digital, table, lof, nolot]{fithesis3}
\usepackage[resetfonts]{cmap} %% We need to load the T2A font encoding
\usepackage[T1,T2A]{fontenc}  %% to use the Cyrillic fonts with Russian texts.
\usepackage[main=english, slovak, german, russian, czech]{babel}
    date          = \the\year/\the\month/\the\day,
    university    = mu,
    faculty       = fi,
    type          = bc,
    author        = Name Surname,
    gender        = m,
    advisor       = Professor's name,
    title         = {Thesis Name},
    TeXtitle      = {Thesis Name},
    keywords      = {keywords},
    TeXkeywords   = {keywords},
\thesislong{abstract}{Abstract goes here.}
\thesislong{thanks}{Thanks goes here.}
%%source code highlighting
\setminted{tabsize=3, linenos=true, xleftmargin=21pt, bgcolor=codebg, samepage=false, breaklines=true, breakafter=., breakaftersymbolpre=}
\renewcommand{\listoflistingscaption}{List of source code examples}
%%list of listings hack
\chapter{Test chapter}
\section{Test section}
Test page with a test figure and a test source code example.
  \caption{The logo of the Masaryk University}
// create data
var circles = [
    { x: 12,  y: 39, radius: 7, color: "green" },
    { x: 25,  y: 20, radius: 11, color: "blue" }];

// create SVG container
var svg = d3.select("body").append("svg")
    .attr("width", 50).attr("height", 50);

// create SVG elements from data
svg.selectAll("circle") // circle template
    .data(circles)       // link data
    .enter()                 // for each data
    .append("circle")    // add a circle 
    // and set it's parameters
    .attr("cx", function(d) { return d.x })
    .attr("cy", function(d) { return d.y })
    .attr("r", function(d) { return d.radius })
    .attr("fill", function(d) { return d.color });
\caption{Creating SVG elements from data}

but the formatting of the List of Listings it generates looks like this: List of Listings

I've been tampering with the answer from the post linked below, but I've only been able to change the looks of both List of Figures and List of Listings to look very similar to my original List of Listings, only change being that the list items aren't indented anymore. My code looks like this:

\newlistof{listing}{lol}{Zoznam ukážok zdrojového kódu}



\setminted{tabsize=3, linenos=true, xleftmargin=21pt, bgcolor=codebg, samepage=false, breaklines=true, breakafter=., breakaftersymbolpre=}

Is there any way to change it's style to look like the original List of Images' one? The changes I need to be made:

  • disable the offset of each list item
  • remove the dotted lines
  • put the page number in a set size (one tab?) after the list item's name
  • emphasize the page number

I've tried searching this forum a lot, but haven't been able to find anything (maybe I don't know the proper terminology?).

I stumbled upon this Customizing the list of listings from minted thread, which seems to solve a problem very similar to mine, but I wasn't able to fix my problem even with it's help.

Thanks for any and all help.

  • Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. Also, please specify what your problems are in implementing the solution from the link you've provided.
    – jjdb
    May 17, 2017 at 16:36
  • @jjdb I've done both, thanks for your advice!
    – tinnyx
    May 17, 2017 at 22:39

1 Answer 1


You can copy the stuff for the list of figures to be used for the listings as well


and then patch \listoflistings with the necessary changes

% use the right auxiliary file:
% exchange \listfigurename three times with \listoflistingscaption

Note that \patchcmd needs the etoolbox package loaded and \l@figure/\l@listing need @ to be a letter:


I then get

enter image description here


enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .