Graphics, Figures & Tables ⇒ unwanted lines
unwanted lines
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 !
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
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.
unwanted lines
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 (43.39 KiB) Viewed 7025 times
- Stefan Kottwitz
- Site Admin
- Posts: 10335
- Joined: Mon Mar 10, 2008 9:44 pm
Re: unwanted lines
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
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
unwanted lines
\centering
to center your stuff inside the figure environment.Re: unwanted lines
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 !