尺寸太大+多張圖片

尺寸太大+多張圖片

我幾個小時以來一直在尋找解決方案 - 包括這個論壇。也許有人可以給我正確的方向,這真的很令人沮喪。

基本上我想做同樣的事情: 大圖,旁邊有幾張小圖

我需要一頁上 7 張圖片,連續 3 張,然後中間 1 張,然後連續 3 張:

xxx

_X

xxx

中間的圖片非常大,我無法讓它a)完全顯示(沒有錯誤)或b)顯示但未正確對齊/與其他圖片重疊

中心 SEM 影像

目前代碼:

\documentclass[landscape]{article}
\usepackage{subfigure}
\usepackage{graphicx}
\usepackage[a4paper]{geometry}
\input{setup/header.tex}

\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}

當我嘗試修復縮放比例或圖片不再顯示時,我總是會遇到一些錯誤。較小的可以工作。我添加了 fbox 來查看盒子的輪廓 - 中間的盒子太小,無論我做什麼,通常都會錯位。而且它是顛倒的 - 我什至不介意(角度= 180,我知道,之後對齊得更糟)

帶數據的小圖像

我真的很感激任何形式的幫助。我有大約 150 張圖片,我不想開始將它們複製到 Office(計劃是編寫一個 python-skript 來一次獲取所有圖片的 tex-code,但為此,這個 tex-code 有上班)

編輯:此程式碼不顯示圖片:

\documentclass[landscape]{article}
\usepackage{graphicx}
\usepackage[a4paper]{geometry}
%\input{setup/header.tex}

\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}

這段程式碼給我帶來了「尺寸太大」錯誤:

\documentclass[landscape]{article}
\usepackage{graphicx}
\usepackage[a4paper]{geometry}
%\input{setup/header.tex}

\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}

答案1

我找到了解決我的問題的方法。感謝您提供正確的訂購代碼,但在這種情況下,出於某種原因調整圖片大小(甚至很小的量)解決了“尺寸太大”錯誤。我猜圖片中的一些元資料搞亂了整個事情(也許是因為它是 SEM 圖片@270k 比例?)。無論如何,現在可以工作了

我使用了這個調整大小工具:http://www.faststone.org/FSResizerDetail.htm

謝謝大家的幫助,否則我可能會放棄:) 我可能會在某個時候寫一個小教程,使用 Gnuplot 和 LaTeX 進行批量數據和圖像處理。接下來是為所有圖片 (~150) 產生 LaTeX 程式碼的 Python 腳本:)

編輯:如果有人有興趣,這是我用來產生大量 LaTeX 程式碼的 python 程式碼:

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')

最終頁面佈局,包括文字和正確的圖片

相關內容