I have two TikZ figures that are identically sized images saved as separate tex files. The images have vertical symmetry. I would like to plot one image of the same size, with the left half from the first image and the right half from the second image to compare them.

The files are long and automatically generated and hence I don't want to modify the source TikZ files. I don't want to compile the source files and join rendered images as they will be updated.

1 Answer 1

  • for each image generate pdf or any other format, which is supported by pdflatex
  • include image in document on the way, that at firsts trim-out right half of image, and at second one left half of image (or top and bottom part)
  • for trim function use graphicx option:

an example:


\includegraphics[trim=0cm 0cm 5.7cm 0cm,clip]{example-image-a}%
\includegraphics[trim=5.7cm 0cm 0cm 0cm,clip]{example-image-b}

enter image description here

  • Thanks! I was hoping there would a solution that didn't have to go through PDFs first, but that might not be possible.
    – JP Janet
    Commented Aug 8, 2017 at 18:34
  • @JPJanet, all other solutions interferes in code, i.e you need to wrote/generate new code for join image. way over pdf is simplest as far i can estimate.
    – Zarko
    Commented Aug 8, 2017 at 19:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .