Skip to content

Commit b5b7aac

Browse files
authored
Add files via upload
1 parent 20778d9 commit b5b7aac

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

fig_latex.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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')

0 commit comments

Comments
 (0)