On Sun, Apr 18, 2021 at 09:14:17AM +0200, Jürgen Spitzmüller wrote: > Am Freitag, dem 16.04.2021 um 12:43 -0400 schrieb Scott Kostyshak: > > Thanks to the Jürgens for your work on this. On master branch, if I > > export a file on the command-line with a child document that is not > > found, I no longer get an error and the command exits "successfully" > > (i.e., 0 exit code). It shows a warning in the terminal but it is > > easy > > to miss it. > > > > I attach a patch that amends c41df5b671e by converting the warning to > > an > > error. Any objection? If preferred, we could show both the warning > > and > > the error, but it seems reasonable to show just one message of the > > problem. > > The advantage of the warning is that you can still productively work > with the file (e.g. if you don't have the included file at hand, but > want to edit the master only anyway; or if the included file is still > to be written).
I wonder if using branches would be a better way to achieve the desired workflow above. I believe we should preserve the previous default behavior of giving an error in the GUI when there is a missing included file. A couple of notes on issues related to the above. I think that they could be worked around if we decide that a warning is better than an error: 1. I think that LyX should try its best to export the same LaTeX code on different systems. I understand that in some cases it is difficult to avoid different exported code on different systems (I think we sometimes condition on which features are available?), but it would be nice to keep those cases to a minimum. After this commit, if the file exists on one system but does not exist on a different system, LyX exports different LaTeX code. Perhaps as an alternative LyX could add code to the preamble to redefine the \include command for LaTeX to check if the file exists and condition accordingly. I really don't like this idea but at least the same .tex code would be exported in all cases. 2. Starting with this commit, if you view the source code (e.g., set to "Complete Source"), every time you type a character you get the warning. > Can we have warnings on the cl that require user prompts before the > process continues? Perhaps we could try to emulate what LaTeX does. They have prompts for undefined commands and if you press return the compilation tries to continue. They also have a batch mode where there is no prompt and it just errors out. I don't really like this idea of adding this prompt-like behavior to LyX's command-line export and an additional batch mode (preference?), but perhaps we could consider it if that's what the majority prefers. In any case, we might want to figure this out after we figure out the GUI behavior discussed above. Scott
signature.asc
Description: PGP signature
-- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel