Recently, using Latex to write articles, images need to use EPS format. If you have installed the Bmeps tool (typically you have ctex on it), you can open the CMD window in the directory you want to convert, and then enter:
Bmeps-c a.jpg A.eps
The-c parameter means to keep the color information, and if you don't add this parameter sometimes something strange happens ...
A.jpg can also be BMP, but preferably JPG, otherwise there will be strange things happen ...
Then wrote a batch code for the batch conversion, very short, as follows:
1 @echo off2 setlocal enabledelayedexpansion3 Echoplease put JPG files that need to be processed in this script directory4 EchoAll outputs are located in./eps/5 Echo;6 Pause7 EchoStart Conversion ...8 Echo;9 Ten ifNot exist log\ MD log One ifNot exist eps\ MD EPS A ifexist log\list.txt del log\list.txt - - dir/a/b *.jpg >Log\list.txt the -set/a count =0 - for/F"delims=."%%iinch(Log\list.txt) Do ( - ifExistI.jpg ( +Bmeps-c%%i.jpg eps\%%i.eps -set/a Count + =1 + ) A ) at - EchoConversion complete, co-processing%count%a file - Echo; -rd/s/Q Log -Pause
The core section is 17 to 22 rows.
Line 14th Prints the file name of all JPG files to a text file
17 rows/F parameter indicates that the collection of loops is from the file
Delims stands for separators, here with '. ' To split to get all filenames without a suffix
(I won't tell you I didn't find a way to use the string substitution)
Those on the Internet.
Set a = aaabbbset b=!a:aaa=bbb!
Purely nonsense, anyway, I tried completely useless, there is a percent of the party, the position of the exclamation point I also for a number of combinations, all are nonsense.
%%i is the name of the local variable for the For loop
Later, it is easier to call the Bmeps tool.
[Script] A bat script implementation for BMP to EPS conversion (requires installation of bmeps)