# Formatting Versions of the same Document

So I have a puzzle here that my Google-Foo is insufficient to handle. I've written my dissertation in Lyx with one master-document and a pile of child-documents for each important chapter or logical section. For the professor review it needs to be double spaced on A4 paper with nice margins for writing notes in.

My problem is that I would also like to make a personal copy ,and one for my family that looks more like a book and not a book report. To that end I'd like to set the paper size to B5, the spacing to single, and to jigger the margins. My first attempt to achieve this was copying the master document to a new file name and changing the desired document settings. This worked moderately well but there was some garbage in the figures. Specifically the figures didn't want to fit and ended up at the end of the chapters. Trying to trouble shoot this problem I got to the logs where latex/lyx was complaining about having two master-documents.

I then abandoned that line of enquiry and tried making a B5 sized wrapper document for my A4 document and making the A4 Document into a child of the wrapper. This resulted in copious errors as latex complained about not allowing nested includes. Which sent me to google and eventually here.

I've looked at the posted similar questions which seem most interested in changing the content of the document. Which is not what I want to do. I emphatically want the format to change and not the content.

Bonus Question: I'm happy with slightly reducing the size of any offending figure floats in both versions of my text in order to fit the smaller, but is there a cool way to problematically state that all .pngs in the document must be narrower than a specified width? (Of course things hard-coded to a smaller width should not grow to the specified width.)

Thanks for any pointers.

• Hi, welcome one http://tex.stackexchange.com, at first, I would recommand you to set the figure heigh or width base on textwith, that way they'll change automatically their size. Also, could you provide a minimal example of your master document and maybe one of your chapter ? – Julien Feb 17 '15 at 20:47
• On the mor general and user friendly level of LaTeX, that would be easy peasy in one single socument. *Ifprof* bigmargin, doublespace *else* b5, singlespace *FI* How to implement that with LyX, no freaking idea. Flexible input from the beginning, as @Julien said. Do not tell a picture to be 3 cm in width, but rather to take up 80 percent of the printable text width. – Johannes_B Feb 22 '15 at 17:58

As far as I can understand, mainly you have a problem with floats placements. At this respect, some suggestions for a smooth layout transition:

1. Inside the floats, always use table/image widths relatives to line width in %,never fixed sizes as 5 cm, nor sizes relatives to the text or column width. For example, for a figure use:

This must produce in the LaTeX source:

\includegraphics[width=1\linewidth]{mwe}

1. Relax the floats options as far as possible, ideally:

Right click on the float label > Settings...

This must produce in the LaTeX the options [!tbph] after \begin{figure} or \begin{table}

1. Alternatively, rather that ignore, relax the LaTeX rules:

Document > Settings... > LaTeX preamble

% Rule for all floats:
\renewcommand{\topfraction}{0.9}
\renewcommand{\bottomfraction}{0.8}

% Rules for floats in normal pages:
\setcounter{topnumber}{4}
\setcounter{bottomnumber}{4}
\setcounter{totalnumber}{8}
\renewcommand{\textfraction}{0.07}
% Floats in two columns
\setcounter{dbltopnumber}{2}
\renewcommand{\dbltopfraction}{0.9}
%   Floats in page floats
\renewcommand{\floatpagefraction}{0.7}
\renewcommand{\dblfloatpagefraction}{0.7}


Change this rules as you need. See How to influence the position of float environments like figure and table in LaTeX?.

1. Move the position of the floats within the text so that each page might fit between the above rules, even if the reference is placed at several pages of the figure. This is always better that obtain “too many un­pro­cessed floats” that go to the end of the document, or many figures at the end of a chapter (but only because the child document insert a \clearpage). In needed, you can use insert a ERT box with \clearpage or \FloatBar­rier (need the placeins package) at some point in the text (before reach 18 unprocessed floats!), or try with the morefloats package.