9

Every time LaTeX happens to generate a corrupted .aux file for whatever reason, the following dialog appears, reading _Whil tupesetting, a corrupt .aux file from a previous run was detected. You should remove it and rerun the typesetting process. Do you want to displaythe "Remove Aux Files..." dialog now?

enter image description here

Not only it is redundant (why not to display the other dialog immediately with Skip button?), but more importantly it is very annoying.

I do not want any dialogs to appear! Can it be switched off somehow or do I have to get the source, erase this part and recompile it?

  • 1
    Tom, I can't provide an answer right now, but the root of all evil relies on a hook named logParser.js inside ~/.TeXworks/scripts/Hooks. You can either disable this hook via the Scripts menu or edit the corresponding code function and remove the .aux cleanup warning. :) – Paulo Cereda Mar 26 '14 at 17:06
  • @PauloCereda You're my hero! Please, make it an answer. It suffices to add return; at the beginning of LogParser.prototype.WarnAuxFiles function in the file you mention. – yo' Mar 26 '14 at 18:57
7

From my comment to a proper answer. :)

The root of all evil relies on a hook named logParser.js inside <USERHOME>/.TeXworks/scripts/Hooks. If you are not sure where to find this path, TeXworks has a shortcut for it:

Quack 1

Namely, Scripts ▶ Scripting TeXworks ▶ Show Scripts Folder. Then you can access a folder named Hooks in there. Pretty easy, isn't it? :)

The file to blame is logParser.js,

Quack 2

which is a JavaScript code. We have two ways of dealing with it. Either by disabling the whole execution of this log parser via:

Quack 3

(Scripts ▶ Scripting TeXworks ▶ Manage Scripts)

And then unchecking the item Errors, warnings, badboxes under the Hook Scripts tab.

Quack 4

Or we can edit logParser.js directly. The function that deals with warning about auxiliary files is around line 373:

LogParser.prototype.WarnAuxFiles = function()
{
  for (var i = this.Results.length-1; i >= 0; i--) {
    if (this.Results[i].Description.indexOf("File ended while scanning use of") > -1) {
      if (TW.question(null, "", "While typesetting, a corrupt .aux " +
        "file from a previous run was detected. You should remove " +
        "it and rerun the typesetting process. Do you want to display" +
        "the \"Remove Aux Files...\" dialog now?", 0x14000) == 0x4000)
        TW.target.removeAuxFiles();
      break;
    }
  }
}

Although I could add a return statement right after the function body opening block, I'd favour commenting the offending parts. :) So:

LogParser.prototype.WarnAuxFiles = function()
{
/*
No more! (Dr. Who, The Day Of The Doctor)

                        _.._
                       /   a\__,
                       \  -.___/
                        \  \
                   (\____)  \
               |\_(         ))
          _____|   (_        /________
               _\____(______/__
                    ______

  ooh a duck! :)

  for (var i = this.Results.length-1; i >= 0; i--) {
    if (this.Results[i].Description.indexOf("File ended while scanning use of") > -1) {
      if (TW.question(null, "", "While typesetting, a corrupt .aux " +
        "file from a previous run was detected. You should remove " +
        "it and rerun the typesetting process. Do you want to display" +
        "the \"Remove Aux Files...\" dialog now?", 0x14000) == 0x4000)
        TW.target.removeAuxFiles();
      break;
    }
  }
*/
}

And we are done. :)

|improve this answer|||||
0

I have met the same problem.

This problem may be caused by the errors in the typesetting process. In my case, if there is a mistake in the tex file, then I compile it, the typesetting process reports that error occurs and I stop typesetting, when I typesetting it again, the dialog appears to inform you to remove the aux file, actually if you click 'OK', another dialog will appear to choose which file should be removed, then you click 'Delete', all selected files will be deleted.

This problem may be inferred that:

  • Error occurs in your typesetting process, it makes your aux files invalid. You should correct the error and remove the aux files, then typeset again.

  • This dialog appears when you typeset the file in the second time after the error occurs.

  • This dialog just inform you and actually the aux files will be deleted by the next dialog.

So my solution is that if error occurs in the typesetting process, when I abort it, the removing files dialog appears, then click 'delete' button to remove the aux files. (There is still a dialog because I find it hard to remove aux files by using the script and I don't know how to do it.)

And here is my code. The WarnAuxFiles function around line 373 in logParser.js is modified.

LogParser.prototype.WarnAuxFiles = function()
{
  for (var i = this.Results.length-1; i >= 0; i--) {
    if(this.Results[i].Severity == Severity.Error) {
        TW.target.removeAuxFiles();
        break;
    }
  }
}
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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