Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Hot answers tagged

169

The PDF format supports a feature "ActualText" that is used for copy-paste instead of the actual typeset text. However, it is not supported by all PDF viewers, but Acrobat Reader does support it. \documentclass{article} \usepackage{accsupp} \newcommand*{\copyable}[1]{% \BeginAccSupp{% ActualText=\detokenize{#1},% method=escape, }% #1% \...


154

So pdfpc on github (which is a forked and improved version of the pdf-presenter-console) is the closest thing I found. Features It has all the features I looked for. Regular slides on the projector, view of the next slide and the current one on the laptop. It pre-caches the slides for fast switch and can provide an overview with thumbnails for each slide (...


150

Use the hyperref package, included in pretty much every latex distribution these days. \usepackage[pdftex, pdfauthor={Your Name}, pdftitle={The Title}, pdfsubject={The Subject}, pdfkeywords={Some Keywords}, pdfproducer={Latex with hyperref, or other system}, pdfcreator={pdflatex, or ...


117

PDF has a feature called "Page Groups" (PDF Reference, section 11.4.7). These descibe transparency effects between top-level objects on one page. When pdfTeX (or LuaTeX or XeTeX) includes a page from a PDF, it converts all pages into "Form XObjects" (section 8.10.1). pdfTeX also converts the Page Groups into /Group entries of the XObjects. The problem now ...


75

1. Download PostScript output (dvips output) Try to get the PostScript version, at least the cached version seems to work. The file was generated with dvips with bitmap fonts. Therefore the "poor" quality. 2. Analyzing PostScript file At the top of the page we find: %%Creator: dvips 5.47 Copyright 1986-91 Radical Eye Software That is too old for pkfix. ...


74

Can be solved by proper setting in TeXnicCenter: Go to menu: "Build"-> "Define Output Profiles." choose profile "LateX to PDF". Switch to "Viewer" tab Set-up parameters: "Executable path" should be something like (check, where have you installed Adobe Reader): C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroRd32.exe Parameters: "Command", "...


68

Suppose your main file is maintex.tex: \documentclass[a4paper]{book} \begin{document} \include{chap01} \include{chap02} \include{chap03} \end{document} Then you can compile only chapter 1 by calling, from the command line pdflatex -jobname=thechap01 "\includeonly{chap01}\input{maintex}" In order to do all at once, the command might be (bash shell) for i ...


65

By default, pdflatex will create a PDF version 1.5 file. It seems that here one of your included PDF graphic is in fact in version 1.6 of the format and therefore has different features which will be lost in included in a pdf file of a previous version. chances are that the graphic in question do not use any of the features available in PDF 1.6 but that is ...


65

I did it this way with package pdfpages: \includepdf[pages=-,pagecommand={},width=\textwidth]{file.pdf}


62

The problem is also reported in a german forum mrunix.de. It might be a bug in the tex distribution (pdftex). The problem happens only when you include multiple pdf pages, created in a specific manner (e.g. by MS Office products), in a single page. Solution: Convert pdf files into ps and then back to pdf using Ghostscript, then the warning will go away (...


61

The elephant in the room are the embedded bitmaps, which can blow up the file size really fast. I have a 400 page book manuscript with lots of molecular structures rendered at 600 dpi (for print), and the overall file size is 50 Mb. I just googled around for a way to reduce the resolution of embedded images and found that ghostscript can do this: gs -...


60

Newer versions of Ghostscript (version 9.05 and later) include a "device" called inkcov. It calculates the ink coverage of each page (not for each image) in Cyan (C), Magenta (M), Yellow (Y) and Black (K) values, where 0.00000 means 0%, and 1.00000 means 100%. Example commandline: gs -o - -sDEVICE=inkcov /path/to/your.pdf Example output: Page 1 0.00000 ...


59

Evince and Okular will auto-reload when the file being viewed changes. So does another option: Zathura. That said, my recommendation would still be MuPDF instead, though it'll take some more work to set up. The reason is that MuPDF in general is a much faster program, and will reload faster. It doesn't auto reload like these do, but this can be solved. I ...


56

The preflight tool of PDFBox validates against the PDF/A-1b standard, more than just PDF. The first errors regarding PDF/A-1b should be resolved by a recent pdfTeX, I do not get these errors with pdfTeX 1.40.16 (TeX Live). The last error 7.1 about MetaData comes from the requirement of PDF/A-1b to also embed the meta data in XMP format, see package ...


54

You could use the transparent package to set the opacity of your background image: \documentclass{article} \usepackage{lipsum} \usepackage{graphicx} \usepackage{transparent} \usepackage{eso-pic} \AddToShipoutPicture*{ \put(0,0){ \parbox[b][\paperheight]{\paperwidth}{% \vfill \centering {\transparent{0.4}\...


53

There are some cases, where the answer is "yes": DVI files do not contain images, but their names are referenced. These names are needed and used by the DVI processor to find the images. PDF images that are included by pdfTeX or LuaTeX: These engines store the file name in the additional key /PTEX.FileName and the information dictionary of the PDF images is ...


51

You can use the pdfjam tool with the syntax pdfjam <input file> <page ranges> -o <output file> and an example of page ranges would be 3,67-70,80 to extract page 3, pages 67 to 70 and page 80, and put these pages into a single document. Note however that this will break the hyperlinks in your document. [edit] pdfjam is actually a front ...


50

This was an interesting question :) The pdfTeX manual shows some concerns with reproducible PDFs. There are two (three) primitives to set if you want every run of pdfTeX to generate the exact same PDF. First there is /CreationDate and /ModDate. You can either set these values with \pdfinfo: \pdfinfo{% /CreationDate D:YYYYMMDDhhmmssTZ /ModDate D:...


49

To import a slide from another beamer presentation as a "picture", you can use pdfpages. You'll have to \setbeamercolor{background canvas}{bg=} as explained in this answer because only a white frame will be shown otherwise: \documentclass{beamer} \usepackage{pdfpages} \begin{document} \begin{frame} Content \end{frame} { \setbeamercolor{background canvas}{...


49

I found the solution : \setboolean{@twoside}{false} And \includepdf[pages=-, offset=75 -75]{file.pdf} And it works !


44

Use the \pdfinfo macro, where the contents are given in PDF notation: \pdfinfo{ /Author (Nicola Talbot) /Title (Creating a PDF document using PDFLaTeX) /CreationDate (D:20040502195600) /Subject (PDFLaTeX) /Keywords (PDF;LaTeX) } (Source: http://theoval.cmp.uea.ac.uk/~nlct/latex/pdfdoc/pdfdoc/pdfdoc.html)


44

Moving fonts As Patrick Gundlach and pluton suggest, you can just make the fonts available to Illustrator. They're in your system's texmf, which you can find by running kpsewhich -var-value TEXMFDIST For TeX Live 2011, $TEXMFDIST is by default at Windows: C:\texlive\2011\texmf-dist OS X: /usr/local/texlive/2011/texmf-dist All the CM* fonts are at $...


43

This answer, taken partially verbatim from Digital signature on TeX.SX: Using the PDF Toolkit you can specify a separate owner and user password. Owner passwords are required when changing document properties, while user passwords may be required for performing certain actions, like printing. However, only specifying an owner password and allowing printing ...


43

Follow all the steps mentioned in the TeXnicCenter + Sumatra Tutorial, but keep in mind these few things: In the (La)TeX tab / (La)TeX compiler section / Command line arguments to pass to the compiler bar, you should write: -synctex=-1 -interaction=nonstopmode "%Wm" In the Viewer tab / Executable path section, what should be written is: "C:\Program Files\...


43

The PDF format knows a feature "ActualText" that allows to specify a replacement string for copy/paste: \documentclass{article} \usepackage{accsupp} \newcommand*{\Csharp}{% C% \BeginAccSupp{ method=hex, unicode=false, ActualText=23, }% $^\sharp$% \EndAccSupp{}% } \begin{document} \Csharp \end{document} The feature is supported by ...


42

(Importantly, this does not work with XeTeX. I mostly tested using pdfTeX, but things also seem to work in LuaTeX.) In a pdf file, colors of an included image can be affected by a /Decode array. This is accessed via the decodearray keyword of \includegraphics. However: this fails in some cases when the color model is cmyk; and this does not allow to ...


42

If you did not know, man pages are already written in a typesetting system that is even older than TeX. This is the *roff family: at different points in history, related programs have gone by names like RUNOFF, runoff, roff, nroff, troff, ditroff, groff, etc. If you're using a Unix-like system (a good guess as you're asking about man pages), you probably ...


40

Both Gonzalo Medina and Audrey posted an excellent solution. But the things are simpler now. See the fancy-preview webpage - based on the new version of fancytooltips (May 2012), preview.sty and some bash scripts you get tooltips for bibliographic entries, theorems, definitions, displayed equations etc. automatically. Edit: Small example and screenshots ...


37

You can try pdfpagediff package: \usepackage{pdfpagediff} \layerPages[<optional page numbers>]{<file1>}{<file2>}


37

(See Update at the end, to get proper colors) By default pandoc uses its own highlighting engine, but it can be changed to use package listings instead. Simply add --listings option to your pandoc command line. However, the format used by listings does not break long lines either, but you can prepare all the required options in a separate tex file, for ...


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