Question: how to write multiline string to a file?

I want to save multiline string to a file. I am not sure Maple likes my string. Also when I look at the textfile after writing the string to it, the string does not look like what is expected. I given small example

First, created a "proc.mpl" in the folder. Here is the content of "proc.mpl"

process_file := proc()
local str;
  
str:="
   \\begin{align*}
     A =& B \\\\
       =& 3
   \\end{align*}
";

FileTools[Text][WriteString]("output.txt", str);
FileTools[Text][Close]("output.txt");

end proc:

Then opened Maple, and from a worksheet, called the above proc() like this

restart;
currentdir("C:\\where_the_file_is");
read("proc.mpl");
Warning, incomplete string;  use " to end the string
Warning, incomplete string;  use " to end the string
Warning, incomplete string;  use " to end the string
process_file();

You see these warnings there. So how does one make a multiline string in Maple? Please tell me it is possible. Else this whole process will not work.

When I look at the "output.txt", where the string is written, this is what shows


   \begin{align*}
     A =& B \      =& 3
   \end{align*}

Which is wrong, I expected this


   \begin{align*}
     A =& B \\     
        =& 3
   \end{align*}

 

I use \ to escape each \, since this is Latex code. 

QUestions are:

1) Can one have multiline string in Maple? as in

"
line one
line two
"

With implied carriage return, just as it appears in the input?  I do this all the time in Mathematica.

2) Is something wrong with how I am saving the string to the file?
 

On a side note: I noticed I had to close the textfile to see the output in it. It looks like FileTools[Text][WriteString] does not flush the string autmatically to a otuput file after each write() which is a little annoying.

Using Maple 2017.3 on windows.

This is how the above is done in Mathematica

And this is "test.txt" which shows the output as expected

   \begin{align*}
     A =& B \\
       =& 3
   \end{align*}

I'd like to do the same in Maple.

Please Wait...