From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robert Goldman Subject: Re: Request for suggestions including source code Date: Wed, 04 May 2011 17:01:51 -0500 Message-ID: <4DC1CCCF.5070403@sift.info> References: <4DC1BCE7.8060503@sift.info> <3B495FCF-216C-4B81-BC13-DC74B8C401B9@tsdye.com> <6167.1304545481@alphaville.americas.hpqcorp.net> Reply-To: rpgoldman@sift.info Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([140.186.70.92]:60398) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QHk8q-0007ep-US for emacs-orgmode@gnu.org; Wed, 04 May 2011 18:01:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QHk8q-000894-1t for emacs-orgmode@gnu.org; Wed, 04 May 2011 18:01:56 -0400 Received: from mpls.sift.info ([75.146.46.193]:56486) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QHk8p-000890-Ud for emacs-orgmode@gnu.org; Wed, 04 May 2011 18:01:56 -0400 In-Reply-To: <6167.1304545481@alphaville.americas.hpqcorp.net> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: nicholas.dokos@hp.com Cc: Org Mode On 5/4/11 May 4 -4:44 PM, Nick Dokos wrote: > Tom provides the practical answers, I go for the frivolous ones :-) : the following > latex program will give you the text width of the page: > > --8<---------------cut here---------------start------------->8--- > \documentclass{article} > > \begin{document} > \the\textwidth > \end{document} > > %%% Local Variables: > %%% mode: latex > %%% TeX-master: t > %%% End: > --8<---------------cut here---------------end--------------->8--- > > I get 345.0pt (but you can use geometry.sty to change it). > > Let's say we want to use cmtt10 (at its design size of 10pt, i.e. not scaled up > or down). The character sizes of this font can be obtained from the TFM file. An > easy way to get them in human-readable form is to use tftopl: > > tftopl /usr/share/texmf-texlive/fonts/tfm/public/cm/cmtt10.tfm | grep CHARWD > > will give you the character widths as fractions of the design size. Since this > is a fixed-width font, all widths are the same: > > (CHARWD R 0.524996) > > So the width of each character in points is: > > 0.524996 * design size = 5.24996pt > > and you can accommodate > > floor(345.0 / 5.24996) = 65 > > characters per line. > > So there you have it: a frivolous exercise, almost completely OT for the > list and an almost useless answer[fn:1]. This actually was pretty helpful. The problem is, of course, that I can't rewrite all of my source code to be in 65-width lines, nor can I convince my colleagues to do so. So what I need now is some way to fix the verbatim environments that are produced by org-mode to use a smaller font. I.e., instead of trying to fix the source code to match char-width, fix the char-width to match the source code. Any idea how to do that? thanks, r