2

what I am trying to achieve is a vertical line between the line numbers and the code in a lstlisting. I have experimented with the frame option a lot, but i guess it is not possible this way, if at all.

As a visual example check out this css plugin which i use on a website. It should look quite simmilar which is why i am asking this question.

Any help is greatly appreciated! Thanks.

1
  • Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}.
    – user31729
    Oct 13 '14 at 13:47
5

Option frame=leftline:

\documentclass{article}
\usepackage{listings}

\begin{document}
\lstset{numbers=left,frame=leftline}
\begin{lstlisting}
\usepackage{xifthen}
\makeatletter
%JB Taken from tufte-common.def
\newcommand{\plainauthor}{}%
\newcommand{\thanklesspublisher}{}%
\newcommand{\thanklessauthor}{}%
\renewcommand*{\author}[2][]{%
    \gdef\@author{#2}%
    \begingroup%
    % TODO store contents of \thanks command%
    \renewcommand{\thanks}[1]{}%
    \protected@xdef\thanklessauthor{#2}%
\endgroup%
\ifthenelse{\isempty{#1}}%
{\renewcommand{\plainauthor}{\thanklessauthor}}%
{\renewcommand{\plainauthor}{#1}}%
\@ifpackageloaded{hyperref}{\hypersetup{pdfauthor={\plainauthor}}}{}%
}%
\makeatother

\end{lstlisting}
\end{document}
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.