Graphics, Figures & Tablesunwanted lines

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
salvators
Posts: 3
Joined: Fri Mar 27, 2015 11:28 pm

unwanted lines

Post by salvators »

hello,

I have a problem with my figures. When I compile my file in TeXstudio, the view gives unwanted lines around figures. It is no box. Sometimes a single line at the bottom of the figure, sometimes a line at the right side of the figure. When I open the pdf file in my pdf reader (pdf Xchange) the lines are gone. Reading the file with adobe reader, the unwanted lines are given.

I don't found a solution. I will handle in my document in pdf, so everyone must see nice pictures.

Thanks for your answer !

edit: The centering tip works fine ! Thanks !
Last edited by salvators on Sat Mar 28, 2015 4:02 pm, edited 1 time in total.

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Re: unwanted lines

Post by Johannes_B »

Hi and welcome,

hard to say what causes the issue, it might be a simple fault of the pdf-viewer that is gone by zooming in or out.

You could give a small sample document and the resulting pdf for us to test.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
salvators
Posts: 3
Joined: Fri Mar 27, 2015 11:28 pm

unwanted lines

Post by salvators »

Hello,

The figure gives a line at the bottom and right side in the Texstudio view. The figure is added in the attachment. I copied all used settings/packages.

Code: Select all

\documentclass[11pt,a4paper,oneside,notitlepage]{book}
%\documentclass[11pt,a4papert,twoside,notitlepage]{book}
\usepackage[english]{babel}
\usepackage{float} %om bij figuren H te gebruiken, hier en nergens anders
% marges aanpassen
% (opmerking: moet *voor* inclusie van fancyhdr package komen)
\setlength{\hoffset}{-1in}
\setlength{\voffset}{-1in}
\setlength{\topmargin}{2cm}
\setlength{\headheight}{0.5cm}
\setlength{\headsep}{1cm}
\setlength{\oddsidemargin}{3.5cm}
\setlength{\evensidemargin}{3.5cm}
\setlength{\textwidth}{16cm}
\setlength{\textheight}{23.3cm}
\setlength{\footskip}{1.5cm}
\newcommand{\graden}{\ensuremath{\tcdegree}}
\setcounter{tocdepth}{3}
\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage{textcomp}
\usepackage{eurosym,mathcomp}
\usepackage{url}
\usepackage{amsmath}
\usepackage{color}
\usepackage{csvsimple}  % Excel -> CVS -> Latex
\usepackage{xspace} % Voor magische spaties na een commando
\usepackage{hyphenat}
\usepackage{longtable}
\usepackage{capt-of}


%\usepackage{hyperref}

\renewcommand{\baselinestretch}{1.15} % anderhalve interlinie (opm: titelblad gaat uit van 1.5)



\newcommand\abs[1]{\left|#1\right|}
\begin{document} 
  
   \begin{figure}[H] \begin{center}	
   		\includegraphics{Figure/Kansasmodel} 
   		\caption{Schematic view }
   		\label{fig:Kansasmodel}
   	\end{center}\end{figure} 
  
   
      	
    \end{document}
Attachments
Kansasmodel.png
Kansasmodel.png (43.39 KiB) Viewed 7026 times
Last edited by Stefan Kottwitz on Sat Mar 28, 2015 12:28 pm, edited 1 time in total.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Re: unwanted lines

Post by Stefan Kottwitz »

Welcome to the forum!

Open the picture with an image viewer, and zoom in, 800% or more. I did it and noticed transparent lines around the image. They may cause it. You could cut them off. Transparency may be handled differently by different readers.

Stefan
LaTeX.org admin
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

unwanted lines

Post by Johannes_B »

Another small thing, you are using the center environment inside your figure environment, which places some additional white space. Better to use command \centering to center your stuff inside the figure environment.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
salvators
Posts: 3
Joined: Fri Mar 27, 2015 11:28 pm

Re: unwanted lines

Post by salvators »

Because it is very difficult to adapt a lot of my figures, I've looked at a solution with the input you give me !

Tranparancy can be adapted in the pdf reader by switch on the smooth line settings. This solves a lot but not al unwanted lines disapear.
I make my figures in pptx. The bad pictures I had saved by selecting everything on a slide and save as picture. I save now by the following steps: under file - save as - ".png" and save only the current slide. Saving the slide in this way lets disappear the unwanted lines. (I change my slides to a smaller format )

I hope my explanation is clear for other people with the same problem!

Thanks for helping me !
Post Reply