Author Topic: how to adjust content to gutter margin  (Read 3183 times)

mdarbygr

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
  • Scribus User
how to adjust content to gutter margin
« on: December 03, 2015, 09:38:46 pm »
I've spent hours trying to figure out how to do a proper gutter margin.
It's easy to set the inside margin larger than the outside margin.

However, if you insert or delete an odd number of pages (even just 1), all the subsequent content is offset by one page. The places originally content aligned for a left side gutter to be placed on a left hand page and vice versa.

For example, if I have a 1 inch margin on all sides with an extra 1/2 inch gutter. Content aligned properly on a right side page at x=1.5 inches, stays at 1.5in when it id bumped to a left side page. But on a left page it  should be at 1.0in since the extra half in should be on the right. All the content following on insertion is off by 1/2 inch.

I'm creating a workbook that comes in shorter and longer versions. To create the multiple versions is becoming a nightmare, because every time I add or remove a page I have to manually adjust the page content on all 140 succeeding pages.

It makes no sense that a gutter margin cannot be automated.
Anyone know what I am doing wrong?

a.l.e

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1644
  • Karma: 23
    • the graphics lab
Re: how to adjust content to gutter margin
« Reply #1 on: December 04, 2015, 11:35:42 am »
yep, if you have a facing pages layout, you're not supposed to delete a single page (except the last one, of course!)

i guess that scribus should forbid it.
(i've filled a request to do so: http://bugs.scribus.net/view.php?id=13587)

there is no way (or only hard to program and error prone ones) to automatically move your content when you have facing pages (with non mirrored margins).

that's one of the main  differences between a flow oriented software like libreoffice write and a frame based one like scribus :-)

Nermander

  • Hero Member
  • *****
  • Posts: 1218
  • Karma: 15
Re: how to adjust content to gutter margin
« Reply #2 on: December 04, 2015, 08:12:53 pm »
Of course it can be done, it's just a matter of deciding what is the reference for the position.

I guess today all positions are relative to the page upper left corner, making the positions relative the margins would solve the issue.

mdarbygr

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
  • Scribus User
Re: how to adjust content to gutter margin
« Reply #3 on: December 04, 2015, 09:35:09 pm »
Nermander's solution would be perfect.
It makes no sense to me that a program as mature as Scribus doesn't already have this feature.

And as a programmer myself, it does not seem like it would be that hard to implement.

If any of the powers that be are reading, please make relative positions a reality.

Kunda

  • Administrator
  • Full Member
  • *****
  • Posts: 218
  • Karma: 2
  • Scribus User
Re: how to adjust content to gutter margin
« Reply #4 on: December 05, 2015, 03:30:16 am »
> It makes no sense to me that a program as mature as Scribus doesn't already have this feature.

There are many things I could say the same things for. The obvious issue is that someone needs to program it and then get it merged in to trunk. Check out bugs.scribus.net and see how many pending bugs there are. I say, if you want to see this issue get fixed then help to rally some support behind it. Open source is written by volunteers.

Nermander

  • Hero Member
  • *****
  • Posts: 1218
  • Karma: 15
Re: how to adjust content to gutter margin
« Reply #5 on: December 05, 2015, 10:44:52 am »
Looking at my MS Word 2010 Starter, MS Word has the following options for placement of a text frame (the same applies to all objects that can be placed "not inline" if I'm not wrong):

Horisontal
Adjusted - Left/Center/Right - relative Margin/Page/Column/Character/Left_margin/Right_margin/Inner_margin/Outer_margin
Book layout - Inside/Outside of Margin/Page
Absolute - xx cm to the right of Margin/Page/Column/Character/Left_margin/Right_margin/Inner_margin/Outer_margin
Relative - xx cm relative Margin/Page/Left_margin/Right_margin/Inner_margin/Outer_margin

Vertical
Adjusted - Top/Center/Bottom/Inside/Outside of Page/Margin/Line/Top_margin/Bottom_margin/Inner_margin/Outer_margin
Absolute - xx cm under Margin/Page/Paragraph/Line/Top_margin/Bottom_margin/Inner_margin/Outer_margin
Relative - xx cm relative Margin/Page/Top_margin/Bottom_margin/Inner_margin/Outer_margin

(I could have made a screen dump, but my Word is in Swedish.)

And this is in MS Word, a Word processor, not DTP software :)

LibreOffice Writer seems to have similar settings, however they are a bit simplified with a checkbox for "mirror on even pages".


Yes, I understand that someone has to write the code, but the code would not be very complicated. It's just a matter of a lot of select-case-statements and additions/subtractions of number. But I guess it will take quite a job to check for errors, since it will be many combinations that need to be tested.

I have once written a perl script for doing impositions (I think it's in the wiki). Here's a short extract from the loop iterating through pages
Code: [Select]
    $c=$loop; # Used thisto make mirroring easier
   
    # Page index is page number minus 1
    $spec.=$sheet[$s][$r][$c]{'f_pg'}-1;

    # Rotation is taken straight from the imposition
    $spec.= $sheet[$s][$r][$c]{'rot'};
   
    # Location of the cell
    $x=($c*$cw);
    $y=($r*$ch);
   
    # Adjust location based on rotation
    $sheet[$s][$r][$c]{'rot'} =~ /[uU]/ && do {$x+=$pw; $y+=$ph};
    $sheet[$s][$r][$c]{'rot'} =~ /[lL]/ && do {$x+=$ph};
    $sheet[$s][$r][$c]{'rot'} =~ /[rR]/ && do {$y+=$pw};

    # Adjust within cell depending on orientation and adjustment
    if ($sheet[$s][$r][$c]{'rot'} =~ /[rRlL]/) {
$sheet[$s][$r][$c]{'adj'} =~ /[Nn]/ && do {$y+=($ch-$pw)};
$sheet[$s][$r][$c]{'adj'} =~ /[Ee]/ && do {$x+=($cw-$ph)};
    } else {
$sheet[$s][$r][$c]{'adj'} =~ /[Nn]/ && do {$y+=($ch-$ph)};
$sheet[$s][$r][$c]{'adj'} =~ /[Ee]/ && do {$x+=($cw-$pw)};

    }

    # Adjust for creep
    while($_=chop $sheet[$s][$r][$c]{'creep'}) {
/[Rr]/ && do {$x+=$creep;};
/[Ll]/ && do {$x-=$creep;};
/[Uu]/ && do {$y+=$creep;};
/[Dd]/ && do {$y-=$creep;};
    }

    # Now we have the correct location
    $spec .= "($x,$y)+";

What this code does is that it places a shrinked and possibly rotated page into a cell that is larger than the page. The location of the page within the cell is specified by cardinals, like N (north=upper center), SE (southeast=lower right). Since the job is done on postscript files the center of rotation is the lower left corner of the page (before rotation), so all movements need to be adjusted based on rotation in addition to the difference in size between the page and the cell.


a.l.e

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1644
  • Karma: 23
    • the graphics lab
Re: how to adjust content to gutter margin
« Reply #6 on: December 05, 2015, 12:07:53 pm »
of course it can be done!
and for simple cases it will also be easy to do.

and for the simplest cases it would propably also be rather simple to use.

but if that would work well, you would probably do your layouting in libre office writer instead of scribus :-)


seriously, scribus has a hard time getting the frames and pages placed correctly in every case (and so do also writer and word), after every possible event...

on the other side, your script, nermander, *is* a good idea!
doing it with a script that takes care of specific cases, is a good way to move around content and is -- as far as i can tell -- much simpler than having it as a core feature!

personally, i stick to my opinion that one should not be able to remove a single page in a page facing document...
but i also would for sure welcome it, if there were tools making it easy to shuffle around the content (also when moving a page, not only when deleting it!)... and it will very likely happen at some time.

Nermander

  • Hero Member
  • *****
  • Posts: 1218
  • Karma: 15
Re: how to adjust content to gutter margin
« Reply #7 on: December 05, 2015, 06:47:00 pm »
Doing it with a script sucks, because you would have to remember to run that script every time you insert or delete a page, or when you move a page (pages can be moved within the document using Arrange Pages, which could change them from left side to right side).

No, what Scribus needs is a way to set positions relative to other references than the page's upper left corner.

There may be other things that need higher priority now, but more and more users are going to want it.

And yes, I often use Libre Office Writer or even MS Word instead of Scribus becuase Scribus lacks features like this.

mdarbygr

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
  • Scribus User
Re: how to adjust content to gutter margin
« Reply #8 on: December 05, 2015, 10:13:50 pm »
With all do respect, layout in Word or Libreoffice writer is an even bigger pain because they don't handle pagination like DTP software.

I was hoping for a different answer, but a script seems to be the best solution at this time. Thanks for the snippet Nermander



Nermander

  • Hero Member
  • *****
  • Posts: 1218
  • Karma: 15
Re: how to adjust content to gutter margin
« Reply #9 on: December 05, 2015, 10:55:12 pm »
They do if you use text frames (which they support) instead of writing directly on the page.

Note: My script snippet is written in perl, for doing impositions, it will not help in this case. It was just an example of how "easy" it is to write.

 

palmate