0

In order to get three output files at the same time (by one compilation) I added the option --shell-escape and

\ifx\conditionmacro\undefined
\immediate\write18{%
    pdflatex --jobname="\jobname"
    "\gdef\string\conditionmacro{1}\string\input\space\jobname"
}%
\immediate\write18{%
    pdflatex --jobname="\jobname_halb"
    "\gdef\string\conditionmacro{2}\string\input\space\jobname"
}%
\immediate\write18{%
    pdflatex --jobname="\jobname_voll"
    "\gdef\string\conditionmacro{3}\string\input\space\jobname"
}%
\expandafter\stop
\fi

to my preamble, but errors aren't displayed anymore now and a failing compilation process isn't being stopped. How can I achieve a normal behavior again?

Update

This example works and produces three different output files:

\documentclass{article}

\usepackage{tagging}

\ifx\conditionmacro\undefined
\immediate\write18{%
    pdflatex --jobname="\jobname"
    "\gdef\string\conditionmacro{1}\string\input\space\jobname"
}%
\immediate\write18{%
    pdflatex --jobname="\jobname_halb"
    "\gdef\string\conditionmacro{2}\string\input\space\jobname"
}%
\immediate\write18{%
    pdflatex --jobname="\jobname_voll"
    "\gdef\string\conditionmacro{3}\string\input\space\jobname"
}%
\expandafter\stop
\fi

\ifnum\conditionmacro>1 \usetag{halb}\fi

\ifnum\conditionmacro=3 \usetag{voll}\fi

\begin{document}

    test

    \tagged{halb}{test-halb}

    \tagged{voll}{test-voll}

\end{document}

This one doesn't (of course), but instead of stopping the process and displaying errors (like the normal behavior of TeXstudio), it gets stucked:

\documentclass{article}

\usepackage{tagging}

\ifx\conditionmacro\undefined
\immediate\write18{%
    pdflatex --jobname="\jobname"
    "\gdef\string\conditionmacro{1}\string\input\space\jobname"
}%
\immediate\write18{%
    pdflatex --jobname="\jobname_halb"
    "\gdef\string\conditionmacro{2}\string\input\space\jobname"
}%
\immediate\write18{%
    pdflatex --jobname="\jobname_voll"
    "\gdef\string\conditionmacro{3}\string\input\space\jobname"
}%
\expandafter\stop
\fi

\ifnum\conditionmacro>1 \usetag{halb}\fi

\ifnum\conditionmacro=3 \usetag{voll}\fi

\begin{document}

    test

    \tagged{halb}{test-halb}

    \tagged{voll}{test-voll}

    }

\end{document}

I would like to keep the usual behavior of TeXstudio.

Thrash
  • 653
  • 2
    the first call looks very suspicious as you are using the same output (and log file) as the main calling routine. I'd be really wary of using --shell-escape as a routine usage, it is disabled by default for good reason. – David Carlisle Nov 28 '18 at 17:18
  • No, I took it from a LaTeX expert here: https://tex.stackexchange.com/a/5265 – Thrash Nov 28 '18 at 17:31
  • No that is completely different: it uses a different jobname for all the subsiduary files. – David Carlisle Nov 28 '18 at 17:40
  • I don't understand. I just adjusted the jobnames for my purpose. I've tried it out with the original code, it has the same effect. – Thrash Nov 28 '18 at 17:49
  • 2
    In my example the subsidiary names are \jobname1, \jobname2 and \jobname3. Remark the numbers at the end. – Ulrike Fischer Nov 28 '18 at 17:52
  • It doesn't matter if there is written 1, 2, 3 or blabla, halb, voll! It's just about output names. The thing is: TeXstudio doesn't stop a failing process and doesn't produce an error message either. I need the numbers afterwards (conditionmacro) in order to distinguish several cases after that code block. – Thrash Nov 28 '18 at 18:00
  • 1
    Improve your problem description. Your code snippet is faulty and incomplete and so can't be used to test your problem. – Ulrike Fischer Nov 28 '18 at 18:04
  • I've just improved it now, see above. – Thrash Nov 28 '18 at 18:19
  • 1
    I don't understand what you expect txs to do here, there are 3 log files and 3 pdf files. which one do you want txs to open? to prevent the stuck issue at the very least, probably pass in -interaction=nonstopmode to your internal calls as well. – Troy Nov 28 '18 at 18:20
  • The last one (\jobname_voll.log) because it contains the other two cases, or rather the whole document (for my actual purposes). I've passed your mentioned option to my internal calls (to each of the three corresponding lines) now. Thank you! But how can I tell TeXstudio to load the right log file? – Thrash Nov 28 '18 at 18:49
  • 1
    you still have the first write18 writing to \jobname that can not work in general. – David Carlisle Nov 28 '18 at 19:46
  • Actually it's superfluous for the desired output, I can omit this option. But even if I give it a different name, how can I achieve that TeXstudio shows my desired log then, i.e. as if there was just \jobname_voll running as the only instance? – Thrash Nov 28 '18 at 19:58

0 Answers0