TransWikia.com

Apply fgruler on the whole document and change it to inch

TeX - LaTeX Asked on May 22, 2021

I want to apply fgruler on my whole document, such that every page has top, left, right, and bottom ruler (if it’s not possible, top ruler and left ruler only is ok). Just like when i’m using M. W@rd, it helps me to measure vspace. But i want the measurement is in inch instead of cm.

Here, my MWE only produces ruler on the first page only:

documentclass{article}
usepackage{blindtext}
usepackage[a4paper, inner=4cm, outer=5cm, top=4cm, bottom=3cm]{geometry}
usepackage[type=none]{fgruler}
begin{document}
    fgruler{upperleft}{0cm}{0cm}
    blinddocument  
end{document}

2 Answers

Below I use eso-pic to insert top/bottom/left/right rules on each page manually, since you may want to tweak the direction of the rulers individually.

enter image description here

documentclass{article}

usepackage{blindtext}
usepackage[type=none]{fgruler}
usepackage{eso-pic}

% Top-to-bottom, left-to-right
AddToShipoutPictureFG{%
  AtPageLowerLeft{ruler[in]{downright}{paperheight}}
  AtPageLowerLeft{ruler[in]{rightup}{paperwidth}}
  AtPageUpperLeft{raisebox{-height}{ruler[in]{rightdown}{paperwidth}}}
  AtPageLowerLeft{makebox[paperwidth][r]{ruler[in]{downleft}{paperheight}}}
}%
% Bottom-to-top, left-to-right
%AddToShipoutPictureFG{%
%  AtPageLowerLeft{ruler[in]{upright}{paperheight}}
%  AtPageLowerLeft{ruler[in]{rightup}{paperwidth}}
%  AtPageUpperLeft{raisebox{-height}{ruler[in]{rightdown}{paperwidth}}}
%  AtPageLowerLeft{makebox[paperwidth][r]{ruler[in]{upleft}{paperheight}}}
%}%

begin{document}

blinddocument  

end{document}

Correct answer by Werner on May 22, 2021

documentclass{article}
usepackage{blindtext}
usepackage[type=user,unit=in]{fgruler}
fgrulerdefuserin{fgrulertype{in}{upperleft}fgrulertype{in}{lowerright}}
begin{document}
blinddocument  
end{document}

enter image description here

Answered by hair-splitter on May 22, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP