I use LaTeX with Brainstorm for the reasons described in the other post on this subject. LaTeX is a sort of markup language, so although the files are plain ASCII, they can be turned into really beautiful documents by running the latex program on them. With that in mind I wrote a small perl script to turn the text output from Brainstorm into a latex document. I can then use Brainstorm to plan my writing and to work out the outline of the argument, export it as text (which may contain LaTeX code such as \emph{an emphasised part of the text}) and run the brn2latex script on that text file. I then work on the LaTeX document using Emacs/AucTeX (a nice combination for editing LaTeX files) but the creative part has all been done in Brainstorm.

In case this is useful for anyone else, I have cut and pasted the perl code below. Just cut between the dashed lines below, save the copied text in a file 'brn2latex.pl', make sure the AUTHOR environment variable is set to your name, and then (assuming you have perl installed) run:

------------------ cut below ------------------------
#!/perl/bin/perl
############################################################
# brn2latex
# Convert a BrainStorm .brn document into a LaTeX document.
#
# Note that the environment variable AUTHOR should be
# set to the name of the document author.
############################################################
use strict;
use warnings;

# Prepare the LaTeX document
# Use the same name as the BrainStorm file, but with a .tex suffix in
# place of the .txt suffix. Also replace spaces with underscores in
# the filename.
my $latex;
($latex = $brain) =~ s/\.txt$/.tex/;
$latex =~ tr[ ][_];

# Read lines from the BrainStorm text output file
# Use the level of indentation to determine the section heading Ignore
# the first indent since the entry with no indentation is simply the
# title of the BrainStorm model
while (<BRAIN>) {
if (/^\s+$/s) {
print LATEX $_;
next;
}

Yes, I am assuming that each level of the Brainstorm structure is marked by a leading TAB character in the text file export. The perl script uses the number of TAB characters at the start of a line to deduce the logical structure of the LaTeX document. If the user selects the 'report' or 'book' document classes the first three levels of Brainstorm structure translate into 'chapter', 'section' and 'subsection' level headings in the LaTeX output. If the user selects the 'article' document class (or doesn't specify one at all) then the Brainstorm structure translates into 'section' and 'subsection' logical levels. Everything below these levels becomes a normal paragraph in LaTeX. It may be that in the LaTeX tweaking stage, some lists exported from Brainstorm would end up as LaTeX lists (\items in an enumerate or itemize environment), but that would be added by hand after running brn2latex.

Many thanks for your submission to the forum; a new use has just been created for Brainstorm. I only guessed the potential in theory but it's great to know that someone has actually implemented this.

Are there any TeX/LaTeX forums where you have already posted your script or plan to do so? I imagine that TeX/LaTeX conoisseurs would like to know of the ways that Brainstorm can help them be more productive.

I also have the impression that the existing Brainstorm user base has yet to grasp the TeX/LaTeX potential; I wonder whether you could attach a graphic sample of one of your LaTeX scripts originally created in Brainstorm.