0

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.

2
  • 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:

\documentclass{article}
\usepackage{graphicx}

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

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 Aug 8 '17 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 Aug 8 '17 at 19:06

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.