Reuben Thomas | 18 Apr 2010 00:31
Gravatar

Apparent overlap in printing command configuration

Hi,

I'm using AuCTeX 11.85 as shipped with the upcoming Ubuntu Lucid, so
apologies if I'm out of date.

I have a bundle of overlapping questions, effectively:

1. I was trying to print PDF files, having chosen to use PDFTeX minor
mode. Should I expect the printer command to have been adjusted
automatically? When I tried to print with C-c C-c P(rint), I got the
command dvips -f foo | lpr, which would of course have failed to find
a DVI file.

2. I then tried to find out what to customize, and lit on
TeX-printer-command, but customizing this didn't change the command I
was offered.

3. I then found TeX-printer-list, which contained the command I was
being offered.

The manual doesn't mention either TeX-printer-command or
TeX-printer-list AFAICS, so I am puzzled: what is TeX-printer-command
for, and what is TeX-printer-list for? Is there overlap or redundancy
to fix here?

I see in the ChangeLog for 11.86 "An easy way to switch between TeX
engines (PDFTeX, LuaTeX, XeTeX, Omega) was added.", so perhaps I
should install 11.86 and try again? (It would be nice if AuCTeX were
available to package.el, is that in the works?)

(Continue reading)

Ralf Angeli | 18 Apr 2010 13:49

Re: Apparent overlap in printing command configuration

* Reuben Thomas (2010-04-18) writes:

> I have a bundle of overlapping questions, effectively:
>
> 1. I was trying to print PDF files, having chosen to use PDFTeX minor
> mode. Should I expect the printer command to have been adjusted
> automatically? When I tried to print with C-c C-c P(rint), I got the
> command dvips -f foo | lpr, which would of course have failed to find
> a DVI file.

At the moment there is unfortunately no automatism for switching the
printing command based on the produced output.

> 2. I then tried to find out what to customize, and lit on
> TeX-printer-command, but customizing this didn't change the command I
> was offered.

You probably mean `TeX-print-command'.  There is no variable named
`TeX-printer-command'.

> 3. I then found TeX-printer-list, which contained the command I was
> being offered.
>
> The manual doesn't mention either TeX-printer-command or
> TeX-printer-list AFAICS, so I am puzzled: what is TeX-printer-command
> for, and what is TeX-printer-list for? Is there overlap or redundancy
> to fix here?

See the description of the variable `TeX-printer-list available via
`C-h v TeX-printer-list <RET>'.  And yes, somebody™ should document this
(Continue reading)

Reuben Thomas | 18 Apr 2010 14:06
Gravatar

Re: Apparent overlap in printing command configuration

On 18 April 2010 12:49, Ralf Angeli <angeli <at> caeruleus.net> wrote:
>
>> 2. I then tried to find out what to customize, and lit on
>> TeX-printer-command, but customizing this didn't change the command I
>> was offered.
>
> You probably mean `TeX-print-command'.  There is no variable named
> `TeX-printer-command'.

Sorry, you're quite right.

>> 3. I then found TeX-printer-list, which contained the command I was
>> being offered.
>>
>> The manual doesn't mention either TeX-printer-command or
>> TeX-printer-list AFAICS, so I am puzzled: what is TeX-printer-command
>> for, and what is TeX-printer-list for? Is there overlap or redundancy
>> to fix here?
>
> See the description of the variable `TeX-printer-list available via
> `C-h v TeX-printer-list <RET>'.

Oops, I didn't read it closely enough. OK, so the second element of
the list defaults to TeX-print-command. But there is a default second
element of TeX-printer-list already.

> And yes, somebody™ should document this
> in the manual.

I'd be happy to write some documentation if the situation were a bit
(Continue reading)

Ralf Angeli | 18 Apr 2010 18:14

Re: Apparent overlap in printing command configuration

* Reuben Thomas (2010-04-18) writes:

> On 18 April 2010 12:49, Ralf Angeli <angeli <at> caeruleus.net> wrote:
>>
>> See the description of the variable `TeX-printer-list available via
>> `C-h v TeX-printer-list <RET>'.
>
> Oops, I didn't read it closely enough. OK, so the second element of
> the list defaults to TeX-print-command. But there is a default second
> element of TeX-printer-list already.

Perhaps somebody thought this would be a better default for a
configuration with multiple printers (others to be added to
`TeX-printer-list' by the user, obviously) in contrast to a
one-size-fits-all configuration with `TeX-print-command'.

>> And yes, somebody™ should document this
>> in the manual.
>
> I'd be happy to write some documentation if the situation were a bit
> clearer. It seems to me from reading the documentation of
> TeX-printer-list again that its default value should be simply
> (("Default")), i.e. a single list with only a first element. Then
> there would not be two different defaults for the same thing in play,
> and it would be clearer to me what to write for the documentation.

There are a few explanations regarding `TeX-printer-list' and
`TeX-print-command' in tex.el just below the "Site Customization"
heading.  They were added by David in 2004, so he likely knows a bit
more about the printing facilities.  David, any comment?
(Continue reading)

Reuben Thomas | 18 Apr 2010 18:57
Gravatar

Re: Apparent overlap in printing command configuration

On 18 April 2010 17:14, Ralf Angeli <angeli <at> caeruleus.net> wrote:
> * Reuben Thomas (2010-04-18) writes:
>
>> On 18 April 2010 12:49, Ralf Angeli <angeli <at> caeruleus.net> wrote:
>>>
>>> See the description of the variable `TeX-printer-list available via
>>> `C-h v TeX-printer-list <RET>'.
>>
>> Oops, I didn't read it closely enough. OK, so the second element of
>> the list defaults to TeX-print-command. But there is a default second
>> element of TeX-printer-list already.
>
> Perhaps somebody thought this would be a better default for a
> configuration with multiple printers (others to be added to
> `TeX-printer-list' by the user, obviously) in contrast to a
> one-size-fits-all configuration with `TeX-print-command'.

I can't see how it is any less one-size-fits-all than simply
defaulting to TeX-print-command. It's just a different default, which
is confusing.

> There are a few explanations regarding `TeX-printer-list' and
> `TeX-print-command' in tex.el just below the "Site Customization"
> heading.  They were added by David in 2004, so he likely knows a bit
> more about the printing facilities.  David, any comment?

I'll wait for any such comment before continuing.

> Also, before we can accept a contribution from you, we'd need a
> copyright assignment for the changes.  See e.g.
(Continue reading)

Reuben Thomas | 18 Apr 2010 22:03
Gravatar

Re: Apparent overlap in printing command configuration

On 18 April 2010 17:14, Ralf Angeli <angeli <at> caeruleus.net> wrote:
> There are a few explanations regarding `TeX-printer-list' and
> `TeX-print-command' in tex.el just below the "Site Customization"
> heading.  They were added by David in 2004, so he likely knows a bit
> more about the printing facilities.  David, any comment?

To help things along, here are those lines:

;;; Site Customization
;;
;; The following variables are likely to need to be changed for your
;; site.  You should do this with customize.  Here is the beef: If you
;; want to print, TeX-print-command must be non-nil (if it is nil,
;; you'll get a complaint when using the print menu).  If you want to
;; view the queue, TeX-queue-command needs to be non-nil (if it is
;; nil, it won't get mentioned in the menu).  If TeX-printer-list is
;; nil, nothing else gets asked: the menu entries lead directly to the
;; respective commands.  If those commands contain %p, the value of
;; TeX-printer-default gets inserted there, no questions asked.  Now
;; if TeX-printer-list is non-nil, you'll always get asked which
;; printer you want to use.  You can enter a configured printer from
;; TeX-printer-list, or an unknown one.  The respective menus will
;; show all configured printers.  Since you can enter unknown
;; printers, the printer name _must_ be set with %p in
;; TeX-print-command.

In other words, it's a bit of a fudge, because the variables are
partly set up the way they are for the benefit of the menus. The best
way out I can see is to have TeX-printer-list default to
(("Default")), as I previously suggested. This means that
(Continue reading)

Ralf Angeli | 19 Apr 2010 21:49

Re: Apparent overlap in printing command configuration

* Reuben Thomas (2010-04-18) writes:

> In summary, simply abbreviate
>
> (defcustom TeX-printer-list
>   '(("Default" "%(o?)dvips -f %s | lpr" "lpq"))
>
> to
>
> (defcustom TeX-printer-list
>   '(("Default"))
>
> Even better: for mere deletion of half a line, I don't think you have
> to wait for my copyright assignment :-)
>
> Does this sounds promising?

I'm planning to look into this during the next days, at the weekend at
the latest.  I wanted to check if the description from tex.el still
holds true.  Perhaps I even have an idea of how to deal with the
automatic switching of the print command when TeX PDF mode is enabled or
what to do when `lpr' is not available, such as is the case on my
computer.  (Not sure what Dvips does with the -P option, i.e. if it also
uses `lpr' or can interface directly with CUPS.)

--

-- 
Ralf

Reuben Thomas | 20 Apr 2010 00:08
Gravatar

Re: Apparent overlap in printing command configuration

On 19 April 2010 20:49, Ralf Angeli <angeli <at> caeruleus.net> wrote:
 (Not sure what Dvips does with the -P option, i.e. if it also
> uses `lpr' or can interface directly with CUPS.)

If dvips is given a printer name, it sets the output for the
appropriate printer using config.printername, which sets an output
pipe command (see dvips(1)). Hence, it can use lpr or CUPS, but is
dependent on the system and user's TeX configuration. This is normally
what you want unless you're trying to let Emacs select the printing
system, but surely this is best left to system and user configuration
outside Emacs rather than trying to let the Emacs user reconfigure
everything inside Emacs.

--

-- 
http://rrt.sc3d.org

Ralf Angeli | 25 Apr 2010 15:57

Re: Apparent overlap in printing command configuration

* Reuben Thomas (2010-04-20) writes:

> On 19 April 2010 20:49, Ralf Angeli <angeli <at> caeruleus.net> wrote:
>  (Not sure what Dvips does with the -P option, i.e. if it also
>> uses `lpr' or can interface directly with CUPS.)
>
> If dvips is given a printer name, it sets the output for the
> appropriate printer using config.printername, which sets an output
> pipe command (see dvips(1)). Hence, it can use lpr or CUPS, but is
> dependent on the system and user's TeX configuration. This is normally
> what you want unless you're trying to let Emacs select the printing
> system, but surely this is best left to system and user configuration
> outside Emacs rather than trying to let the Emacs user reconfigure
> everything inside Emacs.

Thanks for the info.  The printing commands might be a bit of a problem.
Up to now we've had Berkeley style commands (lpr, lpq) but those were
not available on my Debian system until I installed the cups-bsd
package.  So my impression is that the System V style commands (lp,
lpstat) might be available on a higher percentage of systems.  But
looking at how Debian handles this does not really qualify to derive a
conclusion like that.  Does anybody know which set of commands is more
widespread?

For now I've switched the commands to System V style in the defaults of
AUCTeX, but they can be changed again should somebody provide more
insight on the matter.  (Using lpq instead of lpstat would actually be
better because the former can provide output for an unnamed default
printer in contrast to the latter.)

(Continue reading)

Reuben Thomas | 26 Apr 2010 16:24
Gravatar

Re: Apparent overlap in printing command configuration

On 25 April 2010 14:57, Ralf Angeli <angeli <at> caeruleus.net> wrote:
> Thanks for the info.  The printing commands might be a bit of a problem.
> Up to now we've had Berkeley style commands (lpr, lpq) but those were
> not available on my Debian system until I installed the cups-bsd
> package.  So my impression is that the System V style commands (lp,
> lpstat) might be available on a higher percentage of systems.  But
> looking at how Debian handles this does not really qualify to derive a
> conclusion like that.  Does anybody know which set of commands is more
> widespread?

CUPS does have BSD-compatible wrappers, as you've noted, and will do
for the foreseeable future. Hence, the interesting question is: how
many BSD systems have the System V printing commands? Mac OS X, for
example, has CUPS, but I'm not sure about the proper BSDs.

> For now I've switched the commands to System V style in the defaults of
> AUCTeX, but they can be changed again should somebody provide more
> insight on the matter.  (Using lpq instead of lpstat would actually be
> better because the former can provide output for an unnamed default
> printer in contrast to the latter.)

I guess one can use something like

lpstat `lpstat -d`

> Regarding `TeX-print-command' and `TeX-printer-list', I think I've found
> out why they both have default values for the printing commands.

Thanks for this analysis. It would be good to explain this somewhere.
Having the commands more similar (as you have made them) will help
(Continue reading)

Reuben Thomas | 18 Apr 2010 23:50
Gravatar

Re: Apparent overlap in printing command configuration

On 18 April 2010 17:14, Ralf Angeli <angeli <at> caeruleus.net> wrote:
> Also, before we can accept a contribution from you, we'd need a
> copyright assignment for the changes.  See e.g.
> <URL:http://www.gnu.org/licenses/why-assign.html>.  Would it be possible
> for you to provide such a copyright assignment?

By the way, I mailed the FSF to ask for this, but do I need an
assignment specifically for AuCTeX, when I have already signed an
assignment form for Emacs?

--

-- 
http://rrt.sc3d.org

Ralf Angeli | 19 Apr 2010 21:50

Re: Apparent overlap in printing command configuration

* Reuben Thomas (2010-04-18) writes:

> By the way, I mailed the FSF to ask for this, but do I need an
> assignment specifically for AuCTeX, when I have already signed an
> assignment form for Emacs?

Yes, since AUCTeX is not a part of Emacs.

--

-- 
Ralf

Reuben Thomas | 20 Apr 2010 00:04
Gravatar

Re: Apparent overlap in printing command configuration

On 19 April 2010 20:50, Ralf Angeli <angeli <at> caeruleus.net> wrote:
> * Reuben Thomas (2010-04-18) writes:
>
>> By the way, I mailed the FSF to ask for this, but do I need an
>> assignment specifically for AuCTeX, when I have already signed an
>> assignment form for Emacs?
>
> Yes, since AUCTeX is not a part of Emacs.

Sure, although it's hard to see how this would be a problem
practically: it's unlikely that having parts of AUCTeX assigned to
Emacs would ever become a real problem.

In any case, I've asked for a copyright assignment and am awaiting it.

--

-- 
http://rrt.sc3d.org


Gmane