2

At the current time I have inserted the configuration of a couple of routers and switches using the following method:

\lstset{breaklines=true}
\begin{lstlisting}[frame=single]
   [Config here]
\end{lstlisting}

But it looks a bit bland and boring, was trying to look if there was an option for the lstset such as \lstset{languague=Cisco}, but I can't find any.

Could someone give me a hand with the style?

Thanks for the help.

3
  • You will probably have to define your own language, you can have a look in the listings support packages (they contain the language definitions for other languages)
    – daleif
    Mar 10, 2016 at 11:43
  • if you want someone to suggest some listings patterns you should probably fix the example above to be a complete document including a sample code to be highlighted that would allow answers to be tested. Mar 10, 2016 at 13:18
  • 1
    Please, define not bland and not boring with Cisco IOS commands in mind ;-)
    – Ignasi
    Mar 10, 2016 at 16:22

1 Answer 1

4

I think routers and switches configuration files, commands and results are boring even with tcolorbox bells and whistles. In any case this is something I've found in my computer:

\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{booktabs}
\usepackage{etoolbox}
\usepackage[most]{tcolorbox}

\newtcblisting{cisco}[1][]{size=fbox, listing only, listing options={style=tcblatex,basicstyle=\ttfamily\scriptsize,tabsize=2,language=sh},#1}

\begin{document}
\begin{frame}[fragile]{cisco}

\begin{cisco}[title=Example of cisco command]
master#show ip cef 10.200.254.4
10.200.254.4/32, version 44, epoch 0, cached adjacency 10.200.200.2
0 packets, 0 bytes
    tag information set, all rewrites owned
    local tag: 20
    fast tag rewrite with Eth0/0/0, 10.200.200.2, tag imposed {18} via 10.200.200.2, Ethernet0/0/0, 0 dependencies
    next hop 10.200.200.2, Ethernet0/0/0
    valid cached adjacency
    tag rewrite with Et0/0/0, 10.200.200.2, tags imposed {18}
\end{cisco}
\end{frame}

\end{document}

enter image description here

2
  • Thank you so much, you're a genious, just have a little problem: One of the configurations goes over one page and it looks like if that is the case the frame doesn't create a page jump
    – Neptune
    Mar 11, 2016 at 8:50
  • @Neptune tcolorboxes can break between pages if you add enhanced, breakable options to \newtcblisting definition.
    – Ignasi
    Mar 11, 2016 at 11:08

You must log in to answer this question.

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