Code Monkey home page Code Monkey logo

crop's Introduction

crop
====

This package provides different forms of cropmarks for trimming paper
stacks, for camera alignment and for visualizing the page dimensions. There
are options for centering the page with respect to some physical paper size,
for marking the vertical and horizontal middle axis, for mounting pages on a
physical sheet, for reflecting and inverting the whole document or printing
it upside-down, and for suppressing either text or graphics output.


COPYRIGHT NOTICE
================
This package is free software that can be redistributed and/or modified
under the terms of the LaTeX Project Public License as specified
in the file macros/latex/base/lppl.txt on any CTAN archive server.


Extracting the package & processing the documentation
=====================================================

Run "make" to get the style file and the documentation, then install
crop.sty and crop.pdf in appropriate directories.

crop's People

Contributors

drehscheibe avatar rrthomas avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

ccszwg

crop's Issues

Misplaced \pdfrestore if mirror option is used

\documentclass{article}
\usepackage[mirror]{crop}
\begin{document}
Some text
\end{document}

If compiled with pdflatex gives the warning

        Misplaced \pdfrestore by (40258437sp, 0sp)

with lualatex one gets

       warning  (pdf backend): misplaced 'restore' by (40258437sp, 0sp)

The problem is that \rlap is robust since texlive 2018, but the reflection code is executed in a place where \protect has the meaning \noexpand and so it doesn't expand. The following seems to correct the problem:

\documentclass{article}
\usepackage[mirror]{crop}
\makeatletter
\renewcommand*\CROP@genreflect[1]{%
    \leavevmode
    \dimen0\CROP@horigin
    \kern2\dimen0
    \begingroup \set@typeset@protect %change protect
    \reflectbox{%
        \hb@xt@\paperwidth{%
            \vbox to\paperheight{%
                #1%
                \vss
            }%
            \hss
        }%
    }%
   \endgroup
}
\makeatother
\begin{document}
Some text
\end{document}

center option broken in a current LaTeX

crop.sty uses in various places \stockwidth and \stockheight to set the mediabox. It sets it to paperwidth/paperheight at the begin, but only if the dimen don't exist:

\expandafter\ifx\csname stockwidth\endcsname\relax
    \newdimen\stockwidth
    \stockwidth\paperwidth
\fi
\expandafter\ifx\csname stockheight\endcsname\relax
    \newdimen\stockheight
    \stockheight\paperheight
\fi

This fails in a current LaTeX 2022-11-01 as the kernel now defines \stockwidth and \stockheight too. As can be seen in this example

\documentclass[10pt]{book}
\usepackage[center]{crop}


\begin{document}
abc
\end{document}

which produce a wrong mediabox:

image

I suggest to change the test and test for invalid values of the dimen too:

\ifcsname stockwidth\endcsname
   \ifdim\stockwidth > 0pt 
   \else
    \stockwidth\paperwidth
   \fi 
\else
    \newdimen\stockwidth
    \stockwidth\paperwidth
\fi
\ifcsname stockheight\endcsname
   \ifdim\stockheight > 0pt 
   \else
    \stockheight\paperheight
   \fi     
\else
     \newdimen\stockheight
    \stockheight\paperheight
\fi

crop might need adaption to the new hook system of LaTeX

We just released a new development version of the next LaTeX version,
In this dev release we implemented a new hook system and extended the existing set of hooks.

Details can be found in the announcement:
https://www.latex-project.org/news/2020/07/22/latex-dev-2020-10-1b/

Beside other we implemented a number of shipout hooks which were previously provided by various external packages.

As crop is redefining \shipout it is possible that it clashes with this new implementation, so it would be nice if you could test and (if possible) change the code to use the provided hooks instead. In case you have questions, comments or problems, open please an issue at the LaTeX 2e github.

Ulrike Fischer, LaTeX team

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.