Generalhow can I add this special picture to my latex?

LaTeX specific issues not fitting into one of the other forums of this category.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

how can I add this special picture to my latex?

Post by localghost »

gcheer3 wrote:[…] Thorsten, how did you extract the picture from the PDF file? Do you use some sofeware? I think this is the easier way. I am using windows, pdfcrop may not work very well as you said. […]
I took the file you provided and opened it with KPDF, the PDF viewer of KDE3 on a Linux system. I used the snapshot tool by marking the area to be copied with the mouse cursor and saved this extract directly to a PNG file. The same procedure can be done on a Windows system with the Adobe Reader and IrfanView, which is able to save the contents of the clipboard directly as PDF. But the loss in quality remains.

Stefan already provided a solution. Another approach could be to include the untouched file (Doc4.pdf) with the \inlcudegraphics command and use its trim or viewport option. This only works when compiling directly with pdflatex. Please refer to the documentation (Section 4 - Including graphics files, p. 9ff) of the graphicx package first. In case of occurring questions, feel free to ask.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

gcheer3
Posts: 41
Joined: Wed Jun 25, 2008 4:39 pm

Re: how can I add this special picture to my latex?

Post by gcheer3 »

Thank you, Stefan and Thorsten.
all my questions are solved promptly.
Irfanview works very well and I will try pdfcrop later.
I used "{\par\tiny blablabla...\par}" added the text under the graph too. Everything is fine now. Thank you so so much.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

how can I add this special picture to my latex?

Post by localghost »

According to my last post I want to show the mentioned solution with including the original file you provided.

Code: Select all

\documentclass[11pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage[english]{babel}
\usepackage[bindingoffset=1cm,centering,includeheadfoot,margin=2cm]{geometry}
\usepackage{graphicx}

\parindent0em
\fboxsep0pt

\begin{document}
  \fbox{\includegraphics[viewport=89 461 471 721]{Doc4}}

  \fbox{\includegraphics[trim=89 461 141 72]{Doc4}}
\end{document}
This method would spare the time to process the file. Perhaps this solution also works fine for you.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

how can I add this special picture to my latex?

Post by localghost »

Inspired by a discussion on mrunix.de and according to an announcement in an earlier post, I now present a solution that makes it possible to work successfully with pdfcrop under Windows [1].

The Version 1.8 of pdfcrop delivered with the current version of MiKTeX gives an error message even if all prerequisites are fulfilled (see posts above). With Version 1.13 this issue has been fixed. The current Version 1.14 can be found on CTAN. With two more steps this script can be made working.
  • The path in which pdfcrop can be found within the MiKTeX installation tree is

    Code: Select all

    C:\Program Files\MiKTeX 2.7\scripts\pdfcrop\perl
    The file pdfcrop.pl will have to be placed there in its current version.
  • The CTAN entry of pdfcrop contains a link called "Location on CTAN"

    Code: Select all

    /support/pdfcrop/pdfcrop.pl
    With a click of the right mouse button on that link the context menu of the browser pops up, where "Save target as" (or similar) has to be chosen. Target directory is the above mentioned path of the MiKTeX installation tree (replace old file).
A refresh of the file name database (texhash or mktexlsr on command prompt) is not necessary, because only a file has been replaced hence there is already an entry in the database.

[1] Grafiken vorteilhaft erstellen - mrunix.de
Post Reply