From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sebastian Rose Subject: Re: Code with line numbers in HTML export Date: Thu, 12 Mar 2009 16:03:03 +0100 Message-ID: <87bps6hjh4.fsf@kassiopeya.MSHEIMNETZ> References: <1e7471d50903111737n75f9a80dna654240d60a23b84@mail.gmail.com> <8671.1236824944@gamaville.dokosmarshall.org> <1e7471d50903112055s2d46c521j298b1b80b632ff3c@mail.gmail.com> <1e7471d50903112128y77f0084fl89753e9fa19ae009@mail.gmail.com> <1e7471d50903112141y169f93f7h5499a355161c1378@mail.gmail.com> <1e7471d50903120641r1ff01628p90c06eb13cdf442d@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LhmO8-0000xj-FX for emacs-orgmode@gnu.org; Thu, 12 Mar 2009 11:00:00 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LhmO7-0000xL-As for emacs-orgmode@gnu.org; Thu, 12 Mar 2009 11:00:00 -0400 Received: from [199.232.76.173] (port=57398 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LhmO7-0000xI-5Q for emacs-orgmode@gnu.org; Thu, 12 Mar 2009 10:59:59 -0400 Received: from mail.gmx.net ([213.165.64.20]:35514) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1LhmO6-0002Mr-FQ for emacs-orgmode@gnu.org; Thu, 12 Mar 2009 10:59:58 -0400 In-Reply-To: <1e7471d50903120641r1ff01628p90c06eb13cdf442d@mail.gmail.com> (Saptarshi Guha's message of "Thu, 12 Mar 2009 09:41:20 -0400") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: saptarshi.guha@gmail.com Cc: emacs-orgmode@gnu.org It's not just putting line numbers and code into two elements. Putting line-numbers and code into different columns works and is done everywhere, but in Org's this will not be bullet-proof. This depends heavily on styles use for the CSS-classes in the code and the line-numbers. If one defines bigger (or smaller) fonts for some of the classes on the code side, line-numbers and code will get out of sync. 1: line 1, normal font size only 2: line 2 contains bigger fonts 3: 4: this is line 3 of code.... Actually, it will even look worse, because the lines will be gradually get out of sync. Not sure, if it could even go out of sync when just different fonts are used. The default line-height is 1.2 em which in turn depends on the font I believe. Hence we would have to put every line number and every code line into
elements with a certain height. The next problem would be, that we suddenly can't copy the example _with_ line numbers anymore ;-) Saptarshi Guha writes: > Hello, > I got this idea from Google code. An example can be found here (chosen > at random) > > http://code.google.com/p/compcache/source/browse/trunk/compcache.c > > The code is displayed as a table (albeit with lots of css markup > helping it) yet the source column is selectable. Hope it helps. Perhaps this is a candidate for org-export-blocks.el or some extension based on it? Regards, Sebastian > Thanks > Saptarshi Guha > > > > On Thu, Mar 12, 2009 at 3:14 AM, Carsten Dominik wrote: >> >> On Mar 12, 2009, at 5:41 AM, Saptarshi Guha wrote: >> >>> Lovely. One last question, is there a way to place the source in a >>> table of two cols one for the col numbers and one for the code? So >>> that the reader may easily select the code. >>> The emacs user does not have a problem what with C-x r k (rectangle >>> delete) and all, still it would be nice on the reader. >> >> Hi, >> >> how does one select a column in an HTML table? >> When I try this, it is always entire rows that are being selected, >> so I would not know how to make a table where this works correctly. >> >> - Carsten >> >>> >>> Thanks for amazing org. >>> Saptarshi Guha >>> >>> >>> >>> On Thu, Mar 12, 2009 at 12:28 AM, Saptarshi Guha >>> wrote: >>>> >>>> Ok. I'll update. >>>> Thanks >>>> >>>> Saptarshi Guha >>>> >>>> >>>> >>>> On Thu, Mar 12, 2009 at 12:25 AM, Manish >>>> wrote: >>>>> >>>>> On Thu, Mar 12, 2009 at 9:25 AM, Saptarshi Guha wrote: >>>>>> >>>>>> Thank you, quite excited I tried this small org file >>>>>> *Title >>>>>> Some tex >>>>>> >>>>>> #+BEGIN_SRC emacs-lisp -n >>>>>> (save-excursion >>>>>> (goto-char (point-min)) >>>>>> #+END_SRC >>>>>> >>>>>> Only to get this in the html file (as copied from my browser): >>>>>> >>>>>> (save-excursion (goto-char (point-min)) >>>>>> >>>>>> The corresponding html is >>>>>>

(save-excursion >>>>>> (goto-char (point-min)) >>>>>>

>>>>>> >>>>>> if i remove the -n it works - the exported code is formatted but no >>>>>> line numbers. >>>>>> (org version 6.09a) >>>>> >>>>> Line numbers and references were added in 6.17. >>>>> >>>>> -- >>>>> Manish >>>>> >>>> >>> >>> >>> _______________________________________________ >>> Emacs-orgmode mailing list >>> Remember: use `Reply All' to send replies to the list. >>> Emacs-orgmode@gnu.org >>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode >> >> > > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode > -- Sebastian Rose, EMMA STIL - mediendesign, Niemeyerstr.6, 30449 Hannover Tel.: +49 (0)511 - 36 58 472 Fax: +49 (0)1805 - 233633 - 11044 mobil: +49 (0)173 - 83 93 417 Email: s.rose@emma-stil.de, sebastian_rose@gmx.de Http: www.emma-stil.de