0

I'm using LaTeX to render a set of custom glyphs. Each glyph is perfectly rectangular, at a 3.5 x 5 aspect ratio, and they're defined something like this (the following example just lines the borders of the glyph):

\newcommand\glyph[1][1]{%
  \begin{tikzpicture}[scale=0.1]
    \draw[lightgray] (0,0) to (0,4);
    \draw[lightgray] (0,0) to (3,0);
    \draw[lightgray] (3,0) to (3,4);
    \draw[lightgray] (0,4) to (3,4);
  \end{tikzpicture}%
}

Each glyph is rendering correctly. When I invoke them in text:

\begin{document}
\glyph\glyph\glyph\glyph
\end{document}

I get some decently-kerned glyphs:

enter image description here

However, this isn't enough. I'd like to get the gap between characters down to a couple of pixels, if possible. How would I go about this?

  • 2
    Welcome to TeX.SX! Your macros are suffering from the "missing % syndrome" :) Add a % here: \newcommand\glyph[1][1]{% <-- and here: \end{tikzpicture}% <--. – Phelype Oleinik May 25 '19 at 03:08
  • That was the solution, thank you – Green Cloak Guy May 25 '19 at 03:32
  • @PhelypeOleinik Well, it was a partial solution. While it did fix the wide kerning issue I was having, I'd like the kerning to go even narrower, if possible. I've edited my question to make that clear now – Green Cloak Guy May 25 '19 at 03:41
  • For future reference, I found the solution to the second problem too, in this answer – Green Cloak Guy May 25 '19 at 03:47
  • 1
    For future reference, provide a complete working example, not just code snippets. When I put your snippets into a code framework, I do not get the separated images you show, but totally adjacent images. I would vote to close this as a duplicate, but I am unable, having recently voted to reopen it prior to your recent comment on "issue 2" – Steven B. Segletes May 25 '19 at 03:52
  • And you can shorten your code with \draw[lightgray] (0,0) rectangle (3,4); instead of your \draws. – CarLaTeX May 25 '19 at 04:46
  • @StevenB.Segletes I've done it for you :) – CarLaTeX May 25 '19 at 04:46

0 Answers0