[texhax] help

Reinhard Kotucha reinhard.kotucha at web.de
Sun Dec 16 03:03:35 CET 2018


On 2018-12-15 at 14:25:21 +0000, Peter Flynn wrote:

 > On 15/12/2018 00:46, Reinhard Kotucha wrote:
 > [...]
 > > Many people, especially in the Windows world, believe that JPEG
 > > files are always smaller than PNG files.  This is only true if you
 > > don't care about quality.  If you want to achieve same quality (i.e.,
 > > avoid the JPEG artifacts), a JPEG file is most likely much larger
 > > than a PNG file.
 > 
 > That's useful information — I haven't used Windows seriously since
 > before W95, so I am fairly clueless about what Windows people do.

See below.

 > > Conversion doesn't make sense here because JPEG is supported by PDF
 > > natively.  Hence, a JPEG file is inserted into a PDF file as-is.
 > 
 > As I understand it, the PDF internal bitmap format is not JPEG but
 > Adobe's own. Maybe I misunderstood.

Among others, PDF also supports a DCTdecode filter which allows direct
inclusion of JPEG files.

 > > Pre-processing is only useful if the pre-processor is able to do some
 > > optimizations.
 > 
 > I'll skip this: this is a book for beginners.
 > 
 > >  >  3. XƎLATEX and PDFLATEX will search for the graphic file by file
 > >  >     type, in this order (check for the newest definition in your
 > >  >     pdftex.def): .png, .pdf, .jpg, .mps, .jpeg, .jbig2, .jb2, .PNG,
 > >  >     .PDF, .JPG, .JPEG, .JBIG2, and .JB2. [...]
 > >  
 > > This behaviour doesn't depend on the TeX engine you are using.  The
 > > behaviour is defined in a LaTeX macro package which is used by all
 > > LaTeX engines, so you could mention LuaTeX as well.
 > 
 > Can you identify which macro package this is? eg graphicx?

Yes, and you already mentioned it

  cd $(kpsewhich -var-value TEXMFDIST)/tex/latex/graphics-def

  grep '\Gin at extensions' *

 > > The search order is obviously wrong but can't be changed without
 > > breaking existing documents.  It's wrong to look for .png files
 > > before looking for .pdf files.
 > 
 > I was just about to ask about that. I wonder why it was chosen that
 > way?

It looks quite random.  And the upper case names were added later.
Many years ago I asked Heiko and he said that it's simply too late to
change anything.  So I suppose that he prefers another order nowadays.

I don't know whether the uppercase names are still needed.  AFAIR Karl
modified kpathsea so that it tries an exact match first (filename on
file system exactly matches representation in the TeX file) and if
that fails, kpathsea tries a case-insensitive match.

 > > The solution is not to rely on this order at all.
 > 
 > Which I do in my own documents, so I had better recommend it...

Good.  Different engines have different search orders.  IMO the user
shall control the computer and not vice versa.  And it's easier to
tell a beginner to type the file name as-is instead if explaining the
internals LaTeX.  Even Knuth's decision to allow the omission of the
extension .tex was quite unfortunate.

 > > On Windows Sam2p is part of the TeX Live distribution.  No need to
 > > download anything.
 > 
 > I believe most Windows users don't use the command line anyway.

Admittedly, I believe that many young Linux users avoid the
command line too.  The reason is that most Linux distributions install
a stupid GUI by default.  Starting a terminal is often much more
inconvenient than necessary.

The declared goal of KDE and Gnome is "to make Linux as convenient as
Windows".  Means: avoid the command line and hide the power of Unix.

After all, I mention Sam2p occasionally on mailing lists because I'm
convinced that it doesn't get the attention it deserves.  ImageMagick
users have to use the command line too.  Thus, poeple refusing to use
the command line lose functionality and can't solve particular
problems at all.

But according to my experience, TeX users are much smarter than
typical Windows users and more open to suggestions, even if the
command line is involved.  Try to tell a typical Windows user that
vector graphics are better than JPEGs.  You end up in an endless
discussion and get the impression that you are at an oriental bazaar.

For more than a quarter of a century I support TeX users when writing
their theses. But I never encountered such a discussion with any TeX
user I supported, regardless of the operating system being used.
Hence I don't see any reason *not* to tell TeX users how to use the
command line, even if they are using Windows.

In most cases the only reasonable way to explain users how to solve a
particular problem is to tell them what they have to type on the
command line.

Regards,
  Reinhard

-- 
------------------------------------------------------------------
Reinhard Kotucha                            Phone: +49-511-3373112
Marschnerstr. 25
D-30167 Hannover                    mailto:reinhard.kotucha at web.de
------------------------------------------------------------------



More information about the texhax mailing list