File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change
1
+ import os
2
+ import sys
3
+
4
+ mainfolder = str (sys .argv [1 ])
5
+ print ('Your folder(containing images) path:' + mainfolder )
6
+
7
+ if (len (sys .argv )> 2 ):
8
+ print ('Usage details: fig_latex.py <input1>' )
9
+ sys .exit
10
+
11
+ files = os .listdir (mainfolder )
12
+
13
+ f = open (os .path .join (mainfolder ,"includegraphics_text.txt" ), "w" )
14
+
15
+ print ('#####################################' )
16
+ for i in range (len (files )):
17
+ print ('Loop running for:' + os .path .join (mainfolder ,files [i ]))
18
+ f .write ('\\ begin' + str ('{' )+ 'figure' + str ('}' )+ '[H] \n \t \includegraphics[width =0.5\\ textwidth]{' + files [i ]+ '} \n \end' + str ('{' )+ 'figure' + str ('}' )+ '\n \n ' )
19
+
20
+ f .close ()
21
+ print ('#####################################' )
22
+ print ('Text File saved in the same folder' )
You can’t perform that action at this time.
0 commit comments