0

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.

It'd seem 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

I got 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)

  • @KJO Yeah, that's what I'm trying to do, but automatically when exporting, not manually by opening LyX and saving a new copy of the document. – derobert Jun 25 at 20:50
  • @KJO My apologies if I've posted an off-topic question, but I'm confused as LyX is listed as on-topic in tex.stackexchange.com/help/on-topic ("Related software and tools, BibTeX, MakeIndex, Lyx, etc.") Checking meta I couldn't find anything to the contrary either. – derobert Jun 25 at 21:06
0

Taking this on as a TeX related task

In LyX files, double page spread is simply stored as:-

\papersides = 2

When converted to TeX using:-

lyx --force-overwrite --export pdflatex doublepage.lyx

such documentation files will default to 2 sided with a third line of:-

\documentclass[12pt,fleqn,german,french,english,bibliography=totoc,index=totoc,BCOR7.5mm,titlepage,captions=tableheading]{scrbook}

What LyX would do is to inject oneside, between 12pt, and fleqn, and rename to oneside.tex

Then you can attempt PdfLaTeX oneside.tex. However be warned in testing this approach there are many undesirable warnings about old Latex constructs like the visible BCOR7.5mm (should be changed to lowercase with = i.e. bcor=7.5mm). Also it may be worth waiting this week for the new 2.3.3 release to see if anything improves.

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.