mailing-list for TeXmacs Users

Text archives Help


Re: [TeXmacs] letter size preference


Chronological Thread 
  • From: Henri Lesourd <address@hidden>
  • To: address@hidden
  • Subject: Re: [TeXmacs] letter size preference
  • Date: Mon, 28 Jan 2008 22:30:12 +0100

Robert Jerrard wrote:

On Mon, 2008-01-28 at 21:29 +0100, Henri Lesourd wrote:

Robert Jerrard wrote:


OK, so where does it get the default paper size setting for a new
document when texmacs is started with no document, i.e. the system wide
default?




I would say :
[[
Edit->Preferences->Printer->Paper type
]]


Sorry, I am not being clear enough. Texmacs must determine the default
paper size for the system somehow, even the very first time you use
texmacs before you have selected any preferences. Ours "knows" the paper
size is "letter" rather than A4. How does Texmacs determine what paper
size to use but default?

The preferences are stored somewhere in .TeXmacs (need
to grep them to know exactly where and how a given default
value is stored).

One could imagine that the preferences in the .TeXmacs are
initialized during the install, although I don't think it
is the case.

Usually, default values are stored in env_default.cpp, but
for the paper size, it cannot be, for it is :
[[
env (PAGE_TYPE)= "a4";
]]

, and as you said, the real value is "letter", thus it is
overriden later.


Does it run some command system command or is
it using an environment variable or does it examine the
file /etc/papersize (on Debian this file has the word letter in it) or
what?


Bingo (tm-print.scm) :
[[
(tm-define (get-default-paper-size)
(or (getenv "PAPERSIZE")
(let ((papersizefile (or (getenv "PAPERCONF") '"/etc/papersize")))
(if
(access? papersizefile R_OK)
(let ((pps-port (open-input-file papersizefile)))
(let ((size (read-line pps-port)))
(begin
(close-input-port pps-port)
size)))
"a4"))))
]]



Archive powered by MHonArc 2.6.19.

Top of page