I am an newbie looking to achieve a sort of two column effect with my LaTeX report – I am using LaTeX KOMA-script
as a base.
I want my margin to appear in a different background color, (say) gray, and main text background is (say) blue and I want to put images, text, graphs and equations in this margin. These contents are synched with particular paragraphs, i.e. I don't want them floating around, just fixed with respect to particular paragraphs in the main text.
So, how can I solve these two conditions?
Again,
- Different background color for main text and the margin contents. (See Similar questions panel in tex.stackexchange.com website)
- Make the contents of the margin par stay fixed with respect to the paragraphs of main text.
I have tried using a background image of two colors and stretching it across the entire page, but the effect is horrific… it does not align well with the main text and margins.
Any suggestions are really welcome.
Best Answer
The color problem may be solved using eso-pic. Figures at the margin but not moving up or down may be done using marginnote. But sometimes moving would be recommended, so you should have a look at marginfix too. Here an example with even some more colors than asked for:
Maybe using option
mpinclude
would be a good idea, if you have a lot of material at the margin (see KOMA-Script manual scrguien.pdf) for more information about this option). In this case, increasing\marginparwidth
may or may not be a good idea.If you would like to use text area + margin area for a figure or equation, you may use something like
addmargin
andaddmargin*
are KOMA-Script environments. You may find them at the KOMA-Script manual.I've used
\dimexpr
for some calculations at my example. You may find this at the e-TeX manual. An alternative would be to use package calc. To avoid all the\LenToUnit
you may simply use package picture. Packagepicture
extends LaTeX'spicture
environment and you may use lengths instead of numbers at\put
,\makebox
,\framebox
etc.