@echo off setlocal enabledelayedexpansion rem ============================================================ rem Pack necessary LaTeX paper files into a zip archive. rem Run this .bat in the paper root directory. rem ============================================================ set "ZIPNAME=doa_doppler_est.zip" set "TEMPDIR=_pack" rem Clean old package folder and zip if exist "%TEMPDIR%" rmdir /s /q "%TEMPDIR%" if exist "%ZIPNAME%" del /q "%ZIPNAME%" mkdir "%TEMPDIR%" rem ------------------------------------------------------------ rem Copy main LaTeX source files rem ------------------------------------------------------------ copy /y "*.tex" "%TEMPDIR%\" >nul 2>nul copy /y "*.bib" "%TEMPDIR%\" >nul 2>nul copy /y "*.bst" "%TEMPDIR%\" >nul 2>nul copy /y "*.cls" "%TEMPDIR%\" >nul 2>nul copy /y "*.sty" "%TEMPDIR%\" >nul 2>nul rem ------------------------------------------------------------ rem Copy common subfolders rem ------------------------------------------------------------ if exist "parts" ( xcopy "parts" "%TEMPDIR%\parts\" /e /i /y >nul ) if exist "fig" ( mkdir "%TEMPDIR%\fig" for %%E in (pdf eps png jpg jpeg bmp) do ( for /r "fig" %%F in (*.%%E) do ( set "SRC=%%F" set "DST=!SRC:%CD%\fig=%TEMPDIR%\fig!" for %%D in ("!DST!") do if not exist "%%~dpD" mkdir "%%~dpD" copy /y "%%F" "!DST!" >nul ) ) ) rem ------------------------------------------------------------ rem Remove LaTeX temporary files if any were copied accidentally rem ------------------------------------------------------------ for /r "%TEMPDIR%" %%F in ( *.aux *.log *.out *.toc *.lof *.lot *.fls *.fdb_latexmk *.synctex.gz *.blg *.run.xml *.bcf *.gz ) do ( del /q "%%F" >nul 2>nul ) rem ------------------------------------------------------------ rem Create zip archive using PowerShell rem ------------------------------------------------------------ powershell -NoProfile -ExecutionPolicy Bypass -Command ^ "Compress-Archive -Path '%TEMPDIR%\*' -DestinationPath '%ZIPNAME%' -Force" if errorlevel 1 ( echo. echo ERROR: Failed to create package. echo Please check whether PowerShell is available and whether the files are locked. echo. pause exit /b 1 ) rem Clean temporary folder rmdir /s /q "%TEMPDIR%" echo. echo Package created: %ZIPNAME% echo. exit /b 0