开发者

LaTeX, Two columns, Listings and Numbers

开发者 https://www.devze.com 2023-01-01 21:41 出处:网络
I\'m trying to get a report done and I have a small problem with the twocolums and the line numbering in listings.

I'm trying to get a report done and I have a small problem with the twocolums and the line numbering in listings.

The document is on two columns :

\documentclass[8pt,[...],a4paper,twocolumn]{article}

The listings can end up either on the left or the right column. The problem is: if I put

\lstse开发者_StackOverflowt{numbers=left,frame=tb,[...]}

the space between the columns is not sufficient when the listing is on the right column and the text from the first column is written over.

Is there any way to ask the listings to put the line numbers "outside" ? I know I can modify the space between the columns, but I would prefer to move the numbers on the side.

Thanks


Try the following (you might have to adjust the sizes):

\lstset{xleftmargin=5mm,framexleftmargin=5mm}
0

精彩评论

暂无评论...
验证码 换一张
取 消