Skip to content

Accept other format than PNG for the logo #49

Description

@quark67

The line 183 of the code of the class is:

\def\tlc@logoFile{\tlc@location/logo.png}%

So the PNG format is mandated.

But PNG is a very bad format for logos. Especially in documents produced with LaTeX.

The PDF format would be better.

On line 418, we read:

\fancyhead[L]{\includegraphics[width=3cm,height=1cm]{\tlc@logoFile}}%

In fact, \includegraphics don't need the extension of the file.

So, with \def\tlc@logoFile{\tlc@location/logo}% in line 183,

and with this modified code:

\newcommand{\useLogoFile}{%
%  \IfFileExists{\tlc@logoFile.png}%
%  {%
%    \fancyhead[L]{\includegraphics[width=3cm,height=1cm]{\tlc@logoFile}}%
%  }%
%  {%
%   % Else: no operation because tlc@logoFile does not exist.
%  }%
\newif\iffileexists
  \fileexistsfalse
  \@for\@tempext:=\Gin@extensions\do{%
    \IfFileExists{\tlc@logoFile\@tempext}{\fileexiststrue}{}%
  }%
  \iffileexists
    \fancyhead[L]{\includegraphics[width=3cm,height=1cm]{\tlc@logoFile}}%
  \else
    % no operation because tlc@logoFile does not exist.
  \fi
}%

(Code from an IA, I was not aware of the list of extensions known by the graphicx package (\Gin@extensions).)

the logo is displayed if the user put logo.jpeg, or logo.png or logo.pdf in /data/ folder.

But the code deforms the shape of the logo, because it mandates an aspect ratio of 3:1 ([width=3cm,height=1cm]). This is not documented in the manual.

Strangely, the file logo.png is a 145 × 52 pixels image, which is not a 3:1 ratio (it's a 2.79:1 ratio).

Anyway, it would be better in a PDF format, as I have shown that you can use other formats than the PNG.

A side note: please stop using the very old listings package. Minted is far better.
If I copy code typeset with listings, this very old package adds spaces between letters (because it use non monospaced fonts, and simulate monospaced with variable width space):

Image

Only the strange old author of the listings package choose to display code with a serif font. Probably because 30 years ago, there was not a monospaced font with bold variant. So the author of listings has decided to use a serif font and tried to fake a typewriter font by adding variable space between letters. With the bad result in copy of PDF as showed above.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions