# Dimensions too large + multiple pictures [closed]

I've been searching for a solution for hours how - including this forum. Maybe somebody can point me in the right direction, it's getting really frustrating.

Basically I want to do the same thing as: Big picture with several smaller ones on the side

I need 7 pictures on one page, 3 in a row, then 1 in the middle, then 3 in a row:

xxx

_x

xxx

the middle picture is really large and I can't get it to a) show up at all (without error) or b) show up and not align correctly/ overlap with the other pictures

current code:

\documentclass[landscape]{article}
\usepackage{subfigure}
\usepackage{graphicx}
\usepackage[a4paper]{geometry}

\begin{document}
\pagenumbering{gobble}

\begin{figure}[!htbp]
\centering
\fbox{\subfigure{
\subfigure{\includegraphics[scale = 0.3]{testdata.png}}
\subfigure{\includegraphics[scale = 0.3]{testdata.png}}
\subfigure{\includegraphics[scale = 0.3]{testdata.png}}
}}
\fbox{\centerline{\subfigure{\includegraphics[scale = 0.003]{testpic.png}}}}
\fbox{\subfigure{
\subfigure{\includegraphics[scale = 0.3]{testdata.png}}
\subfigure{\includegraphics[scale = 0.3]{testdata.png}}
\subfigure{\includegraphics[scale = 0.3]{testdata.png}}
}}
\end{figure}

\end{document}


I always get some errors when I try to fix the scaling or the picture doesn't show up anymore. The smaller ones work. I added the fbox to see the outline of the boxes - the middle one is too small, no matter what I do and usually gets misaligned. Also it's upside down - I wouldn't even mind that (angle = 180, I know, aligned even worse after that)

I'd really appreciate any kind of help. I'm sitting on something like 150 pictures and I don't want to start copying them to Office (plan is to write a python-skript to get the tex-code for all pics at once, but for that this tex-code has to work)

EDIT: this code just doesn't show the picture:

\documentclass[landscape]{article}
\usepackage{graphicx}
\usepackage[a4paper]{geometry}

\begin{document}

\begin{figure}[!htbp]
\centering
\fbox{\includegraphics[scale = 0.3]{testdata.png}
\includegraphics[scale = 0.3]{testdata.png}
\includegraphics[scale = 0.3]{testdata.png}
}

\fbox{\includegraphics[width = 4cm]{testpic.png}}

\fbox{\includegraphics[scale = 0.3]{testdata.png}
\includegraphics[scale = 0.3]{testdata.png}
\includegraphics[scale = 0.3]{testdata.png}
}
\end{figure}
\end{document}


this code gets me the 'Dimensions too large' error:

\documentclass[landscape]{article}
\usepackage{graphicx}
\usepackage[a4paper]{geometry}

\begin{document}

\begin{figure}[!htbp]
\centering
\fbox{\includegraphics[scale = 0.3]{testdata.png}
\includegraphics[scale = 0.3]{testdata.png}
\includegraphics[scale = 0.3]{testdata.png}
}

\fbox{\includegraphics[width = 5cm]{testpic.png}}

\fbox{\includegraphics[scale = 0.3]{testdata.png}
\includegraphics[scale = 0.3]{testdata.png}
\includegraphics[scale = 0.3]{testdata.png}
}
\end{figure}
\end{document}


## closed as unclear what you're asking by Zarko, TeXnician, Schweinebacke, Troy, MoriambarMay 26 '17 at 13:29

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• You write that you get some errors. It might be helpful for us, if you could tell us which errors. – Jürgen Apr 25 '17 at 13:55
• The subfigure package is deprecated I think. See tex.stackexchange.com/questions/144782/…. Better to use subfig or subcaption. – Troy Apr 25 '17 at 13:59
• If your graphic is really very large then you have a problem: LaTeX won't be able to use its dimensions to calculate the scaling. See tex.stackexchange.com/questions/257153/… – Ulrike Fischer Apr 25 '17 at 14:08
• usually it just says 'Dimensions too large' when I try the scaling method that Zarko (next post) suggested, or the picture just doesn't show up at all without error - just a little box between the other pictures picture size is 1024x768 px, or 630kB – some_guy Apr 25 '17 at 14:44

I found a solution for my problem. Thank you for providing the proper code for ordering, but in this case out of some reason resizing the picture (a miniscule amount even) took care of the "Dimensions too large" error. I guess some meta-data in the picture messed the whole thing up (maybe because it's a SEM-picture @270k scale?). Anyway, works now

I used this resize tool: http://www.faststone.org/FSResizerDetail.htm

thanks you everbody for the help, I might've given up otherwise :) I'll probably write up a small tutorial some time for bulk data & image processing using Gnuplot and LaTeX. Next up is the Python-Script to generate the LaTeX-Code for all the pictures (~150) :)

EDIT: in case somebody is interested, this is the python-code I used for generating lots and lots of LaTeX-code:

f = open('Hex06.tex', 'w')

hex = 'Hex06'
print('\n')
print('writing Hex06.tex .....\n')
for field in ['03_2h3h','03_23','04_6h5','04_36h','04_55h','06_55h','07_6h5','07_44h','07_55h','07_66h','06_6h5','07_5hh4','07_34','09_13','16_12','08_16']:
if(field == '03_2h3h'):seg = '0'
if(field == '03_23'):seg = '0'
if(field == '04_6h5'):seg = '0'
if(field == '04_36h'):seg = '0'
if(field == '04_55h'):seg = '0'
if(field == '06_55h'):seg = '0'
if(field == '07_6h5'):seg = '0'
if(field == '07_44h'):seg = '0'
if(field == '07_55h'):seg = '0'
if(field == '07_66h'):seg = '0'
if(field == '06_6h5'):seg = '1'
if(field == '07_5hh4'):seg = '1'
if(field == '07_34'):seg = '1'
if(field == '09_13'):seg = '1'
if(field == '16_12'):seg = '1'
if(field == '08_16'):seg = '2'
f.write('\n')
f.write('\\begin{figure}[!htbp]\n')
f.write('\centering\n')
f.write('\\fbox{\includegraphics[scale = 0.7]{' + hex + '/2P_UI_all-currents_' + hex + '_'+seg+'seg_field'+field+'_+15V.png}\n')
f.write('      \includegraphics[scale = 0.7]{' + hex + '/2P_UI_all-currents_' + hex + '_'+seg+'seg_field'+field+'_0V.png}\n')
f.write('      \includegraphics[scale = 0.7]{' + hex + '/2P_UI_all-currents_' + hex + '_'+seg+'seg_field'+field+'_-15V.png}\n')
f.write('}\n')
f.write('\n')
f.write('\\fbox{\includegraphics[scale = 1]{' + hex + '/SEM-pics/resized/' + hex + '-done_field'+field+'.png}\n')
f.write('\\textbf{{\Huge '+hex+' '+seg+'-Au-Segments}}}')
f.write('\n')
f.write('\\fbox{\includegraphics[scale = 0.7]{' + hex + '/2P_TR_all-currents_' + hex + '_'+seg+'seg_field'+field+'_+2V.png}\n')
f.write('      \includegraphics[scale = 0.7]{' + hex + '/2P_TR_all-currents_' + hex + '_'+seg+'seg_field'+field+'_0V.png}\n')
f.write('      \includegraphics[scale = 0.7]{' + hex + '/2P_TR_all-currents_' + hex + '_'+seg+'seg_field'+field+'_-2V.png}\n')
f.write('      }\n')
f.write('\end{figure}\n')
f.write('\\newpage\n')
f.write('\n')
f.close()
print('done with Hex06.tex, starting Hex07.tex.....\n')
f = open('Hex07.tex', 'w')
hex = 'Hex07'

for field in ['06_41','06_56','08_4h5h','08_45','11_16','14_21','14_66h','18_6h1h','06_15','09_23','18_16h','14_16']:
if(field == '06_41'):seg = '0'
if(field == '06_56'):seg = '0'
if(field == '08_4h5h'):seg = '0'
if(field == '08_45'):seg = '0'
if(field == '11_16'):seg = '0'
if(field == '14_21'):seg = '0'
if(field == '14_66h'):seg = '0'
if(field == '18_6h1h'):seg = '0'
if(field == '06_15'):seg = '1'
if(field == '09_23'):seg = '1'
if(field == '18_16h'):seg = '1'
if(field == '14_16'):seg = '2'
f.write('\n')
f.write('\\begin{figure}[!htbp]\n')
f.write('\centering\n')
f.write('\\fbox{\includegraphics[scale = 0.7]{' + hex + '/2P_UI_all-currents_' + hex + '_'+seg+'seg_field'+field+'_+15V.png}\n')
f.write('      \includegraphics[scale = 0.7]{' + hex + '/2P_UI_all-currents_' + hex + '_'+seg+'seg_field'+field+'_0V.png}\n')
f.write('      \includegraphics[scale = 0.7]{' + hex + '/2P_UI_all-currents_' + hex + '_'+seg+'seg_field'+field+'_-15V.png}\n')
f.write('}\n')
f.write('\n')
f.write('\\fbox{\includegraphics[scale = 1]{' + hex + '/SEM-pics/resized/' + hex + '_field'+field+'.png}\n')
f.write('\\textbf{{\Huge '+hex+' '+seg+'-Ni-Segments}}}')
f.write('\n')
f.write('\\fbox{\includegraphics[scale = 0.7]{' + hex + '/2P_TR_all-currents_' + hex + '_'+seg+'seg_field'+field+'_+2V.png}\n')
f.write('      \includegraphics[scale = 0.7]{' + hex + '/2P_TR_all-currents_' + hex + '_'+seg+'seg_field'+field+'_0V.png}\n')
f.write('      \includegraphics[scale = 0.7]{' + hex + '/2P_TR_all-currents_' + hex + '_'+seg+'seg_field'+field+'_-2V.png}\n')
f.write('      }\n')
f.write('\end{figure}\n')
f.write('\\newpage\n')
f.write('\n')
f.close()
print('done with Hex07.tex, starting Hex10.tex.....\n')
f = open('Hex10.tex', 'w')
hex = 'Hex10'

for field in ['01_1h2','01_6h6','01_13','01_55h','02_55h','02_66h','01_5h6h','01_21','02_6h5','02_34','04_45','05_1h3','07_61','08_4h3','08_32','09_64','12_1h6','16_63']:
if(field == '01_1h2'):seg = '0'
if(field == '01_6h6'):seg = '0'
if(field == '01_13'):seg = '0'
if(field == '01_55h'):seg = '0'
if(field == '02_55h'):seg = '0'
if(field == '02_66h'):seg = '0'
if(field == '01_5h6h'):seg = '1'
if(field == '01_21'):seg = '1'
if(field == '02_6h5'):seg = '1'
if(field == '02_34'):seg = '1'
if(field == '04_45'):seg = '1'
if(field == '05_1h3'):seg = '1'
if(field == '07_61'):seg = '1'
if(field == '08_4h3'):seg = '1'
if(field == '08_32'):seg = '1'
if(field == '09_64'):seg = '1'
if(field == '12_1h6'):seg = '1'
if(field == '16_63'):seg = '1'
f.write('\n')
f.write('\\begin{figure}[!htbp]\n')
f.write('\centering\n')
f.write('\\fbox{\includegraphics[scale = 0.7]{' + hex + '/2P_UI_all-currents_' + hex + '_'+seg+'seg_field'+field+'_+15V.png}\n')
f.write('      \includegraphics[scale = 0.7]{' + hex + '/2P_UI_all-currents_' + hex + '_'+seg+'seg_field'+field+'_0V.png}\n')
f.write('      \includegraphics[scale = 0.7]{' + hex + '/2P_UI_all-currents_' + hex + '_'+seg+'seg_field'+field+'_-15V.png}\n')
f.write('}\n')
f.write('\n')
f.write('\\fbox{\includegraphics[scale = 1]{' + hex + '/SEM-pics/resized/' + hex + '_Au-seg_field'+field+'.png}\n')
f.write('\\textbf{{\Huge '+hex+' '+seg+'-Au-Segments}}}')
f.write('\n')
f.write('\\fbox{\includegraphics[scale = 0.7]{' + hex + '/2P_TR_all-currents_' + hex + '_'+seg+'seg_field'+field+'_+2V.png}\n')
f.write('      \includegraphics[scale = 0.7]{' + hex + '/2P_TR_all-currents_' + hex + '_'+seg+'seg_field'+field+'_0V.png}\n')
f.write('      \includegraphics[scale = 0.7]{' + hex + '/2P_TR_all-currents_' + hex + '_'+seg+'seg_field'+field+'_-2V.png}\n')
f.write('      }\n')
f.write('\end{figure}\n')
f.write('\\newpage\n')
f.write('\n')
f.close()
print('done with Hex10.tex\n')
print('\n')
print('pleasure to do business with you\n')
print('see you next time\n')
print('\n')