0

I need to create a figure in latex, which I want to extract as a PNG.

My latex code:

\documentclass{article}
\usepackage{svg}
\usepackage{graphicx}
\usepackage{subfig}
\usepackage[papersize={1000px,1000px}]{geometry}
\pagestyle{empty} % Remove page numbers

\begin{document}

\begin{figure}
  \centering
  \subfloat[Noisy Plot]{\includesvg[width=0.5\textwidth]{test.svg}\label{fig:noisy}}\hfill
  \subfloat[Good Plot]{\includesvg[width=0.5\textwidth]{test.svg}\label{fig:good}}\\
  \subfloat[Nice Plot]{\includesvg[width=0.5\textwidth]{test.svg}\label{fig:nice}}\hfill
  \subfloat[Signal Plot]{\includesvg[width=0.5\textwidth]{test.svg}\label{fig:signal}}
  \caption{My test plots}
  \label{fig:four-plots}
\end{figure}

\end{document}

Result:

enter image description here

Problem: The width of the page must exactly be 1000 pixels. The width of the plots should be adjusted accordingly (while maintaing the aspect ratio). But when I convert the PDF to PNG, the dimension of the PNG is 2778 x 2778 pixels. How do I enforce the dimension to have a width of 1000 pixels?

1
  • My recommendation is to force the output to match your needs. So, when you're converting the PDF to PNG, set the output size to 1000px x 1000px. See the -size option within ImageMagick's convert.
    – Werner
    Commented Nov 4, 2023 at 18:25

0

You must log in to answer this question.

Browse other questions tagged .