They probably don't use TeX in their publishing process but (most probably - are you talking about an AIP journal?) XML. And they probably have scripts that convert the input to XML - it's a pain to write them in such a way that all eventualities are considered.
I am using pgfplots and tikz to do my plots and thus I had to combine everything into one file when submitting. I wrote a perl script that parses csv input files and outputs LaTeX code. But in the end, I had to submit all the graphics as pdf after all: their TeX engine choked on my files even though all the other online-compilers and my local installation ran without complaining. Couldn't manage to get it working...
Anyway, here is the perl script in case you're interested. Remember: it only parses the files and outputs LaTeX code - it doesn't actually combine all the snippets. It's quick and dirty, but a good starting point if you want to have a go.
My advice: just copy the biblatex and everything else in one file as the absolutely last step and submit the graphics as PDFs.
#! C:/Programme/Perl/bin/perl -w
use strict;
unless(@ARGV<1){ # Check if input file is given as a commandline argument
open(FILE,"<".$ARGV[0]) or die("Error reading file: ".$ARGV[0]." ".$!);
my $textraw="";
while(<FILE>){$textraw.=$_;}
close(FILE) or die("Error closing file: ".$ARGV[0]." ".$!);
my $patternMatch;
my @addplot;
my $n=0;
while($textraw =~ /(\\addplot.*?)table\[(.*?)?,?\s?x expr\=(.*?),y expr\=(.*?)\]\n\s+\{([^\}]*)\}/sg){
$patternMatch++;
my $plotCommand=$1;
my $skipRows=$2;
my @xCol;
$xCol[0]=$3;
my @yCol;
$yCol[0]=$4;
my $DataFileName=$5;
if($skipRows){$skipRows=~s/skip first n=(\d)/$1/g;}
else{$skipRows=0;}
open(FILE,"<".$DataFileName) or die("Error reading file: ".$DataFileName." ".$!);
my $i;
#$addplot[$n]=$1."coordinates {";
print $1."coordinates {";
LINE:while(<FILE>){
my $xCoord;
my $yCoord;
chomp($_);
$i++;
if($i<=$skipRows){next LINE;}
if(($xCol[0]=~m/\\thisrow\{/)||($yCol[0]=~m/\\thisrow\{/)){
# I was going to put logic here to account for people using \thisrow.
# Screw this - it's too much hassle. Please use \thisrowno
die("Error: \thisrow{} detected - unable to parse. Please change LaTeX source to \thisrowno.");
}
my $xColStack=0;
my $xOperator="+";
my $xColTmp=$xCol[0];
while($xColTmp=~/\\thisrowno\{(.*?)\}(.*)?/g){
my $columnIndex=$1;
my $additionalDirectives=$2;
$xColTmp=$additionalDirectives;
$_=~m/\s*(\S*)\s*(\S*)\s*(\S*)?\s*(\S*)?\s*(\S*)?\s*(\S*)?\s*(\S*)?\s*(\S*)?\s*(\S*)?\s*(\S*)?\s*(\S*)?\s*(\S*)?\s*(\S*)?\s*(\S*)?\s*(\S*)?/;
my %selectColumn = (
0 => $1,
1 => $2,
2 => $3,
3 => $4,
4 => $5,
5 => $6,
6 => $7,
7 => $8,
8 => $9,
9 => $10,
10 => $11,
11 => $12,
12 => $13,
13 => $14,
14 => $15
);
if($xOperator eq "+"){
$xColStack+=$selectColumn{$columnIndex};
}
else{
die("Unsupported operator - you have to implement it yourself. I only added \"+\".")
}
if($additionalDirectives=~/(.)?\d?\\thisrowno/){
$xOperator=$1;
}
elsif($additionalDirectives=~/(.)\s*?(\d*)/){
#die "[".$additionalDirectives."]";
#$xColStack=$xColStack;
die("There are some additional operations to be executed on the data, namely: $additionalDirectives \n Please use awk to format the data as this cannot be parsed. awk usage is as follows:\n gawk \"{\$1=\$1*1000;\$2=\\\"\\\";$\3=$\3*12e-3*1e-6/284;print}\" file.in > file.out");
}
}
#$addplot[$n].="(".$xColStack.",";
print "(".$xColStack.",";
my $yColStack=0;
my $yOperator="+";
my $yColTmp=$yCol[0];
while($yColTmp=~/\\thisrowno\{(.*?)\}(.*)?/g){
my $columnIndex=$1;
my $additionalDirectives=$2;
print $2;
$yColTmp=$additionalDirectives;
$_=~m/\s*(\S*)\s*(\S*)\s*(\S*)?\s*(\S*)?\s*(\S*)?\s*(\S*)?\s*(\S*)?\s*(\S*)?\s*(\S*)?\s*(\S*)?\s*(\S*)?\s*(\S*)?\s*(\S*)?\s*(\S*)?\s*(\S*)?/;
my %selectColumn = (
0 => $1,
1 => $2,
2 => $3,
3 => $4,
4 => $5,
5 => $6,
6 => $7,
7 => $8,
8 => $9,
9 => $10,
10 => $11,
11 => $12,
12 => $13,
13 => $14,
14 => $15
);
if($yOperator eq "+"){
$yColStack+=$selectColumn{$columnIndex};
}
else{
die("Unsupported operator - you have to implement it yourself. I only added \"+\".")
}
if($additionalDirectives=~/(.)?\d?\\thisrowno/){
$yOperator=$1;
}
elsif($additionalDirectives=~/(.)\s*?(\d*)/){
#die "[".$additionalDirectives."]";
#$xColStack=$xColStack;
}
}
#$addplot[$n].=$yColStack.")";
print $yColStack.")";
}
#$addplot[$n].="};";
print "};\n\n";
close(FILE) or die("Error closing file: ".$DataFileName." ".$!);
#$n++;
}
#$n=0;
#while($textraw =~ /(\\addplot.*?)table\[.*?\]\n\s+\{.*?\}/sg){
#
# $n++;
#}
}
else{print "Error: no input file given!\n\nUsage: $0 inputfile.\n";}
\include
is not for sections (beside others it forces a\newpage
). And imho it is not suitable for articles. And in case you meant\input
: It depends on the length of the article and your workflow. I general prefer not to split my documents in to many parts. – Ulrike Fischer Jun 11 '13 at 7:47