I'm trying to convert the LyX documentation to PDFs to read on a tablet. Some of the LyX documentation, though, is set to double-sided which of course a table isn't.
buffer-params-apply \papersides 1 ought to do that. I'm testing on
Customization.lyx, and if I run that in the GUI (after
buffer-toggle-read-only to make the buffer editable), it seems to set it to single-sided... but also toss the rest of the document settings. I ran it with
-dbg action, and the amount of stuff hitting "apply" in the document settings dialog passes to that function is ridiculous.
If I try it on the command line:
lyx -x 'buffer-toggle-read-only' -x 'buffer-params-apply \papersides 1' \ -E pdf2 '/tmp/LyX/Customization.pdf' 'Customization.lyx'
... then it seems to just do nothing (I tried both with and without buffer-toggle-read-only). That is, no errors are produced (even with adding
-dbg action) and the generated PDF is still double-sided.
LyX does its best to complicate simple solutions using
sed as well:
$ lyx -E pdf2 /tmp/LyX/Customization.pdf <(sed -e 's!^\\papersides 2$!\\papersides 1!' Customization.lyx ) LyX failed to load the following file: /dev/fd/63.lyx
sed to work with a tempfile, but it seems really hard to believe there isn't an easy way to override single/double-sided when exporting to PDF. What did I miss?
(This is LyX 2.3.2, running on Debian Buster)