Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am writing an article consisting of multiple sections. For each section I more or less have a separate tex file, which are included in a main file. The journal I'm submitting to now asks me to integrate all files in a single file. I'm just wondering, isn't this quite bad practice? I mean, there's a reason for LaTeX to provide include commands.

This is not so much of a question, but I was just hoping to hear some opinions.

share|improve this question
1  
It makes it much easier for a production editor's workflow if all the code is in one file. As a producton editor I've wasted a lot of time going through each file to replace a problematic obsolete command or trying to work out which of the included files a particular problem is in. –  Nicola Talbot Jun 11 '13 at 7:44
1  
\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
    
@NicolaTalbot: I get that it must be an effort, but isn't that the job of the production team? After all, we're paying close to USD 2000 for it. –  TMOTTM Jun 11 '13 at 8:16
    
@TMOTTM I'm a volunteer production editor, so I don't get paid for it. Those who do get paid may well be more willing to do that extra effort. –  Nicola Talbot Jun 11 '13 at 9:20
1  
Remember also that journals (and authors) are keen to have a rapid turnaround so the longer it takes to process the files, the longer it takes to publish the journal. There is also the danger that a journal may decide that the effort (and cost) involved isn't worth their while and as a result they may decide not to accept LaTeX submissions and move over to a solely Word-based production line. –  Nicola Talbot Jun 11 '13 at 10:03
show 4 more comments

2 Answers 2

As a general practice I like to use \include to keep everything clean and tidy, specially because it allows me to include just the files I want.

That said, when you have a large document, you can use \includeonly{chapter1,chapter2} and that will make ignore the rest of things and only compile chapter 1 and 2.

Now, if they are asking you to have everything in one file just comply... Maybe it's because of file storage purposes that they are asking it (or perhaps they just don't want to have a lot of files associated with one author).

Either way, you can also have a look at this post When should I use \input vs. \include? for more information about \include and several files projects.

share|improve this answer
    
please note -- \include and \includeonly are suitable for books, but not for journal articles. –  barbara beeton Jun 11 '13 at 12:44
    
Working in one large multi-thousand line document is much less convenient then having the document split up into semantic sections. I dont think the inserted newpages by include should be a problem, the article is buing built from scratch anyway by the production team –  TMOTTM Jun 11 '13 at 13:17
add comment

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";}
share|improve this answer
    
even if a publisher does use tex exclusively, the more pieces a job is delivered in, the greater the possibility that something will get lost, not be delivered, be misnamed, ... all these things slow down the process. the best advice i can offer is to always follow the publisher's guidelines, run the job one last time with only the files that will be delivered (except for "standard" packages, which should not be included in the collection submitted) to make sure that it runs smoothly, and package everything into a zip file to minimize the chance of loss. –  barbara beeton Jun 11 '13 at 12:52
    
It's a bit different in my case, the publisher claims to be incapable of processing tex files, which I find rather surprising, given the fact that it's a scientific publisher. Arxiv.org for example can handle any kind of tex construct I submitted so far with ease. –  TMOTTM Jun 11 '13 at 13:06
    
If they are indeed incapable of processing TeX files, why do they allow you to hand in one? Or are they saying: hand in a PDF file? –  Meferdati Jun 12 '13 at 7:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.