2

I need to turn a list of about 300 names into images which are exactly the size of the text. My first thought was to use standalone, but that cuts off the edges of some letters (J, u, etc) So I tried adding an arbitrarily small border to it (\documentclass[border=1pt]{standalone}), which prevented the clipping, but unfortunately means that I can't use the images (I really need the resulting pdf edges to line up exactly with the visual edges of the text) Is there any way to achieve the desired effect?

My current code:

\documentclass[margin=1pt]{standalone}

\begin{document}
Jane Doe
\end{document}

I am away from a computer right now, but if necessary I can upload an image of the clipping I'm seeing without adding the margin.

3
  • Welcome to TeX.SX! That's because TeX can't "see" the glyph, it only knows about its bounding box, which not necessarily (actually rarely) match. You can check that by doing \fboxsep0pt \fboxrule1sp \fbox{J}. You'll see that the J protrudes a little below the bounding box. – Phelype Oleinik Oct 2 '19 at 12:29
  • You can add a smaller margin, for example 0.1pt. You may also try another font, if that is an option. – Sveinung Oct 2 '19 at 12:33
  • @phelypeoleinik I figured that the problem was something to that effect. Does that mean there's no way to achieve what I want? – josef Oct 2 '19 at 14:27
1

You could add a vertical phantom letter on the baseline (which takes vertical space but no horizontal space) and then raise the actual text a little bit:

\documentclass{standalone}

\begin{document}
\vphantom{X}\raisebox{0.3pt}{Jane Doe}
\end{document}

enter image description here

Or raise individual letters (and optionally adjust the kerning left and/or right of the letter):

\documentclass{standalone}

\begin{document}
\kern-0.035em\raisebox{0.3pt}{J\kern-0.1em}\raisebox{0.1pt}{a}ne Doe
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.