Created
June 22, 2023 12:31
-
-
Save fmitha/c2e8e730b9a7b2c9e3037658ace85ca9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% 12pt default for scrlttr2 | |
\documentclass{scrlttr2} | |
% \NewDocumentCommand{\foo}{m +m} | |
% { | |
% \IfFileExists{./#1} | |
% {#2} | |
% {\PackageError{formletterbug}{CONFIG FILE '#1' DOES NOT EXIST - NOT CREATING FORMLETTER}{Check that the config filename (first argument) has been correctly passed to \formletter}} | |
% %{\PackageError{formletterbug}{CONFIG FILE '#1' DOES NOT EXIST - NOT CREATING FORMLETTER}{Check that the config filename (first argument) has been correctly passed to \foo}} | |
% } | |
\ExplSyntaxOn | |
\NewDocumentCommand{\foo}{m +m} | |
{ | |
\file_if_exist:nTF{./#1} | |
{#2} | |
{\PackageError{foo}{CONFIG~FILE~'#1'~DOES~NOT~EXIST~-~NOT~CREATING~FORMLETTER}{Check~that~the~config~filename~(first~argument)~has~been~correctly~passed~to~\formletter}} | |
%{\PackageError{foo}{CONFIG~FILE~'#1'~DOES~NOT~EXIST~-~NOT~CREATING~FORMLETTER}{Check~that~the~config~filename~(first~argument)~has~been~correctly~passed~to~\foo}} | |
} | |
\ExplSyntaxOff | |
% Parameters for document commands | |
\newcommand{\addressesconfigfilename}{fifmacroerr.txt} | |
\begin{document} | |
\newcounter{letternum} | |
\foo{\addressesconfigfilename} | |
{ | |
Text | |
} | |
\end{document} | |
%%% Local Variables: | |
%%% mode: latex | |
%%% TeX-engine: luatex | |
%%% TeX-master: t | |
%%% End: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment