Hot answers tagged

17 votes
Accepted

Cropping some part of a `tikzpicture`

\documentclass[tikz, margin=3mm]{standalone} \begin{document} \begin{tikzpicture} \clip (0,0) rectangle + (1.2,-1.2); % <added, size of rectangle is estimated %...
Zarko's user avatar
  • 284k
9 votes
Accepted

Crop an image in tikz using 2 points of reference and a height

Package adjustbox Your preamble already contains package adjustbox. It provides the features you need for trimming and clipping I am not sure, which spacing is needed around the image. The following ...
Heiko Oberdiek's user avatar
9 votes
Accepted

Automatic page size to fit arbitrary content

\documentclass{article} \begin{document} \hoffset=-1in \voffset=-1in \setbox0\hbox{\begin{tabular}{cccc} ...
David Carlisle's user avatar
9 votes
Accepted

Cropping a Greek Letter in mathmode

The \clipbox command from the trimclip package does this. \documentclass{article} \usepackage{trimclip} \newcommand{\crop}[1]{\clipbox*{0pt -.5ex {\width} .7ex}{#1}} \begin{document} \crop{ABCDefgh$...
Sandy G's user avatar
  • 36.4k
9 votes
Accepted

How to print only first n items in itemization in ConTeXt?

Something like this could be easily done in Lua. The code below not only prints only the first five items from the list but also shuffles the items so that the order of the questions is randomized. \...
Henri Menke's user avatar
8 votes
Accepted

How to get correct PDF boxes (especially regarding bleeding and the TrimBox) in ConTeXt

Sorry for answering that question myself, but after having done some extensive research and with the help of @metafox (see the comments above, thank you very much!) I found out how to come pretty ...
Marcus C.'s user avatar
  • 745
8 votes
Accepted

\includegraphics: get the "scale" value of a figure whose size is expressed by "width"

All graphics are written to the PDF with a scale factor. When you specify a size the package just converts it to an appropriate scale factor. You can make \Gscale@box remember that scale factor for ...
Phelype Oleinik's user avatar
7 votes
Accepted

LuaLaTeX (0.95.0 TL-2016) has problem with crop and microtype packages being together

As Ulrike's comment suggests and luatex85 documentation explains, the problem is caused by changes in LuaTeX versions 0.85+, namely removing or renaming some pdfTeX extended primitives. So the ...
Marcel S.'s user avatar
  • 1,283
7 votes

Trim margins of the entire document (by command line)

Why don't you use crop package?! As David Carlisle said you can also use geometry package, but I prefer crop in this case; for more details see the package's manual. with setting width and height ...
javadr's user avatar
  • 2,372
7 votes
Accepted

How to discard an area of a pdf page using pdfpages?

You can place the image (yes, the page is just an image) on a blank page using eso-pic and graphicx. Then you can overlay a white rectangular \rule to fill in over the area you don't want. \...
Werner's user avatar
  • 589k
7 votes
Accepted

Cropping standalone documents using the beamer option

Using the beamer option normally also sets preview=false,crop=false,varwidth=false. The crop=false key can be reverted by passing it as an additional argument: \documentclass[beamer,crop]{standalone} ...
samcarter_is_at_topanswers.xyz's user avatar
6 votes
Accepted

Problem of display in tikz

Your issue is that you are clipping to the triangle with the corners you specify, while the circle should extend outside that triangle. Even though you don't specify the third edge it is automatically ...
Emma's user avatar
  • 3,463
6 votes
Accepted

Coloring a truncated/trimmed part of a character

The problem with rotating text and then rotating back is that the box surrounding the rotated text is bigger than the original box. So when you rotate back the new text is shifted. This is ...
Sandy G's user avatar
  • 36.4k
6 votes

IEEEtran, standalone, and XeLaTex: do not crop

The class tests for \pdfoutput. So you could fool it by defining it (and setting it to 1). But be aware that this could confuse other packages which test for pdfoutput too. Also IEEEtran is not meant ...
Ulrike Fischer's user avatar
6 votes

\includegraphics: get the "scale" value of a figure whose size is expressed by "width"

You can keep the width= on the graphics and trim/clip separately so not affecting the scaling, see the last example here: \documentclass{article} \usepackage{graphicx,adjustbox} \begin{document} \...
David Carlisle's user avatar
6 votes

How to Crop an Image Precisely in the Shape of a Norman Window

\documentclass[border=12pt]{standalone}% xelatex or lualatex \usepackage{pstricks} \usepackage{graphicx} \newsavebox\IBox \savebox\IBox{\includegraphics[width=6cm,height=6cm]{example-image}} \begin{...
user187802's user avatar
  • 15.6k
5 votes

Adding crop marks to legacy document

A non TeX solution is to "stamp" the legacy book with crop marks: convert the book to pdf, create a one page pdf with the crop marks in the right places (using TeX or a drawing software) and stamp the ...
alwaysask's user avatar
  • 2,208
5 votes

How to cut pdf at crop marks?

The pdfcrop utility is made to crop the white borders from a PDF. pdfcrop in.pdf out.pdf If you want to remove a little MORE so that the crop marks are also removed, then use the --margins option. ...
James's user avatar
  • 4,527
5 votes
Accepted

pdfcrop content remains

Cropping in pdfcrop, options viewport/trim of \includegraphics, or the very most other tools for cropping is done by shrinking the dimensions of the visible area, smaller values for /MediaBox or /...
Heiko Oberdiek's user avatar
5 votes

How can I crop included PDF documents?

If you check now the pdfpages manual, you will read: Internally the command \includepdf makes use of the \includegraphics command from the graphicx (actually graphics) package. Hence it is possible ...
Andrestand's user avatar
  • 1,035
5 votes
Accepted

5mm margin is not 5mm?

You should add 10mm to both dimensions. \documentclass{article} \usepackage[ showframe, paperwidth=297mm, paperheight=210mm, margin=5mm, nohead, nofoot, nomarginpar, pdftex=false,...
egreg's user avatar
  • 1.1m
5 votes

Coloring a truncated/trimmed part of a character

\documentclass{standalone} \usepackage{trimclip,graphicx} \usepackage{xcolor} \def\normala{a} \def\trima{% \raisebox{0.02em}{\textcolor{red}{a}}\hskip-0.435em% \rotatebox[origin=center]{25}{% ...
samcarter_is_at_topanswers.xyz's user avatar
5 votes
Accepted

What is the meaning of the commands "clip" and "trim" during image insertion?

The trim keyword affects the 'apparent size' of the image but does not in itself make any material invisible: anything outside of the trimmed border is simply overprinted with the surrounds. The clip ...
Joseph Wright's user avatar
  • 252k
5 votes
Accepted

How to Crop an Image Precisely in the Shape of a Norman Window

This uses TikZ. I assume the numbers were just for show. \documentclass[border=12pt]{standalone} \usepackage{tikz} \usepackage{graphicx} % Compiles with xelatex \newsavebox\IBox \savebox\IBox{\...
John Kormylo's user avatar
  • 75.4k
4 votes

How do You print flowfram book?

Based on the Nicola answer I added bleeding for tabs, tabs text rotation, page numbers and also backcover: \documentclass[a5paper,twoside,openany]{book} % ======= %% LaTeX: % penalty for breaking ...
Adobe's user avatar
  • 2,995
4 votes
Accepted

Adding crop marks to legacy document

I've ended up editing (a copy of) the legacy ps file and adding the code below just after %DVIPSSource. That was the advice given by @erreka in the comments. It's very nice that the output of dvips ...
lhf's user avatar
  • 2,160
4 votes
Accepted

standalone class would not crop AMS equations properly (left and top margin space remains)

I think you need an output that does not span across multiple page then converting displayed equations to inline equations. \documentclass[margin=1pt]{standalone} \usepackage{amsmath} \begin{document}...
Second Person Shooter's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible