What is the best way to ensure the same font size in figures as in main text with open source formats and programs like Inkscape or Scribus?

A typical use case: I would like to include a figure consisting of two photos side-by-side. I annotate the first photo with the letter "A" in the upper right corner and the other one with "B". The size of the letters should be the same (or at least consistenly relative) to normal main text.

The TiKZ LaTeX package does a good job there, but it is time consuming and not WYSIWYG.

  • uh maybe I'm confused --- why does selecting the same font size not work in a WYSIWYG desktop publishing application?
    – Ryan
    Apr 1 '15 at 13:17
  • @Ryan: The issue the asker is having that TiKZ is not WYSIWYG; not that it doesn’t do the job.
    – Wrzlprmft
    Apr 1 '15 at 14:01

Inkscape‘s PDF+LaTeX option (when saving as PDF) may be exactly what you want.

It saves all non-text aspects of the graphics as a PDF and then creates a LaTeX snippet that imports this PDF and overlays all the text using LaTeX. You load the LaTeX snippet using \input and thus the text has the same font and size as your regular LaTeX text. You can also do such stuff as using custom LaTeX macros in the texts in your image (which obviously won’t be WYSYWIG in Inkscape).

  • So this allows you to reset the type styles in LaTex?
    – Yorik
    Apr 1 '15 at 14:19
  • I am not exactly certain what you mean by reset, but you can control the type style from LaTeX, if that’s what you are asking.
    – Wrzlprmft
    Apr 1 '15 at 14:22
  • "reset type" as in "setting type," and thanks.
    – Yorik
    Apr 1 '15 at 14:24

For Scribus, you would set up a paragraph style (see: stylesheets) such as "figures - Header"; place a text box to overlap the image box, add the "A" and then mark up the "A" with the style. If you edit the style, it will update all instances of the style throughout the document. Using only stylesheets (within reason) is always the best way to proceed and helps ensure uniformity.

If you are going to mark up the images before placement, then you need to ensure that both (all) images are set up so that they are not going to be scaled in any way after placement. Then you choose a specific the size typeface, possibly specified in (pixels * output intent dpi). You will need to handle this across all images in the document and then you will need to edit each image file with a recalculated size if you need to change dimensions of the image or need to edit the typeface.

Sizing the text: if you KNOW you are placing images at 100% and that you are printing 300dpi/150lpi, you can deduce that a 1/8 inch high "A" will be 300*.125 = 37 pixels. If you resize the image, the text scales with it.

The Scribus way is the better way, but if you are doing complex charts with text within them you need to set up your images as uniformly as possible so that you are not scaling the type. Generally, even in vector formats and typefaces with specific units, the type will still be scaled relative to the viewport when you scale the placed image. (* but see Wrzlprmft answer regarding PDF+LaTex)

  • Hi Yorik, I think your answer is exactly what I want. Scribus is a good tool, but the documentation is not always straightforward (as for other open-source projects, too). Apr 2 '15 at 13:16

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.