Tag Info

New answers tagged

2

\includegraphics[quiet... %%%%%


2

Better lie! The following tells LaTeX that the box containing the image is 0pt in width, but then puts an image with width .5\paperwidth inside. This corrects the centring and prevents complaints about overfull boxes. (It should therefore only be used when you are sure you do not want to hear TeX's warnings!) \documentclass[12pt]{article} ...


1

It seems rather pointless to include an image like this but anyway tex can allow boxes bigger than \maxdimen so long as you never do any arithmetic on the lengths: \documentclass[10pt,notitlepage]{article} \usepackage{graphicx} \begin{document} \centering \mbox{\pdfimage height \textheight{image.pdf}} \end{document}


1

This is surely not the most efficient or elegant way but I was curious whether this might work. bashful allows you to run scripts from within a LaTeX document provided, of course, that you compile with shell escape enabled. Put the following in myimagewidth.sh: #!/bin/sh - pdfinfo $1.pdf | grep "Page size" | sed -e 's/^Page size:[[:space:]]*//' -e 's/ ...


5

There's a limit for graphics dimensions, bounded above by \maxdimen (16384pt); in the case of the height for images, the limit is around 574cm to 576cm for some of the images I tested. For example, \documentclass{article} \usepackage{graphicx} \begin{document} \includegraphics[height=576cm,width=2cm]{example-image-a} \end{document} triggers the ...


2

When the logo is stored as Vector Art in the pdf (The case in OP), you can use Inkscape to do the job: Import the pdf into inkscape. Select the object that appears, right-click and select "ungroup" as many times as needed to disentangle the bit you want from all the others. Delete everything except the desired graphic. Go into "Document Properties" and ...


2

The command \includegraphics[page=n,viewport=x y X Y,clip]{filename} extracts page n from filename.pdf and clips it to a rectangular viewport with corners at (x,y) and (X,Y). Coordinates are relative to the origin of the bounding box. Since the clipping is arbitrary, performing it by mere deletion of the objects in the input document would be impossible. A ...


0

The problem is with turkish language that makes the character = active. See tex.stackexchange.com/q/160385/27635 for a workaround Thanks karlkoeller, it was related with turkish language. As you suggested in your other comments, adding \shorthandoff{=} and \shorthandon{=} before and after \includegraphics command solved the problem.


0

I recommend using lettrine which is designed for this purpose. Although it is primarily designed for use with decorative initials and dropped capitals, it can also be used with images in place of letters. It assumes that your images will be named for the letters they replace in the initial word of the paragraph. However, provided you can rename your images ...


10

Reading filenames from another file can be tricky as soon as there are special characters in the file name, such as _ etc. This uses \readline, which changes the catcodes accordingly and stores the read file name to a list, here called \mylist. To display the graphics, it's 'sufficient' to define a list processor, basically doing \includegraphics. ( I ...


2

Something like this may work (untested) \usepackage{etoolbox,graphicx} \newcommand\HandlePic[1]{% \includegraphics[width=3cm]{#1} \par } \forcsvlist\HandlePic{A,B,C} Each item in the list is given one by one to the handler. Just an addition to Christians solution. Here is a POC using the verbatim package to misuse \verbatiminput ...


1

What are the problems you are facing when you use wrapfig? The following code works: \documentclass[10pt,a4paper,twocolumn]{report} \usepackage[utf8]{inputenc} \usepackage{wrapfig,lipsum} \begin{document} \textbf{Title} \lipsum[2] \noindent \begin{wrapfigure}[2]{l}{20pt} \vspace{-1\intextsep}\rule{20pt}{20pt} \end{wrapfigure} \textbf{Title} \lipsum[2] ...


5

This is by no means a solution. It's just a really dirty workaround, but it might be good enough if you are in a hurry. \documentclass{article} \usepackage{graphicx} \usepackage{accsupp} \newcommand\squelchgraphics[2][]{% \BeginAccSupp{method=plain,ActualText={}}\includegraphics[#1]{#2}\EndAccSupp{}} \begin{document} ...


1

I am not sure whether it is as elegant as \graphicspath, but another idea may be to have a command pointing to the relative path of the document. In the document, you can do \makeatletter% \ifx\mypath\@empty% \xdef\mypath{.}% \fi% \makeatother% right at the document's beginning, which sets the path to . (the current folder) if it has not been defined. In ...


2

If you put \listfiles as the very first line of the master file, the name of every used file is dumped to standard output, including style and font definition files. This is plain old LaTeX.


0

With tikz, simply change the vertical location of the signature image with yshift key \documentclass{article} \usepackage{graphicx} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw[thick](0,0)--(5,0)node[midway,yshift=1.2cm](c){\includegraphics[width=4cm]{example-image-a}}; \node[yshift=-3mm] at (c.south) {\textbf My Name}; \end{tikzpicture} ...


8

This is not really a documentsclass, but also viable: the papercdcase package. It's beautiful because it's foldable ;) \documentclass[a4paper]{article} \usepackage[margin=0pt]{geometry} \usepackage[pdftex]{graphicx} \usepackage{papercdcase} \setcdbackmatter{% \centering \huge\bfseries\LaTeX3\par \includegraphics[scale=.5]{expl3.png} } ...


11

Here's a simlpe little example using cd-cover: \documentclass{cd-cover} \usepackage{graphicx} \setlength\parindent{0pt} \begin{document} \CDbookletTopMargin=0pt \CDbookletMargin=0pt \begin{bookletsheets} \vspace*{5mm} \hspace{5mm} \begin{center} {\LARGE \LaTeX3}\par\bigskip \includegraphics[width=4cm]{expl3} \end{center} \end{bookletsheets} \end{document} ...


1

Use \addtobeamertemplate to add the image inside a TikZ \node to control the opacity (since internal calculations are involved two or three runs are needed until the image reaches its final position): Update: The image has to span the full width of the headline but without the sidebar and the height of the image has to be equal to the headline height; in ...


1

I am not sure if I got you right as you have not give so much information. But maybe you have been searching for the [b] parameter of the tabular environment. Like it stands now, it is too wide for the page, but as I do not know your documentclass and margin settings, I just leave it as it is. % arara: pdflatex \documentclass{article} ...


0

I have a solution, the problem is that I'm not particularly proud of it. Matlab appears to have a problem saving .eps files. The only way around this that I have found is to save a figure with a different extension (say, .png) and then convert to .eps using Inkscape or something similar.


1

It now works as I wanted, using the command \cventrylogo defined as this: \renewcommand{\cventrylogo}[9][.25em]{% \cvitem[#1]{#2}{% {\bfseries#3}% \ifthenelse{\equal{#4}{}}{}{, {\slshape#4}}% \ifthenelse{\equal{#5}{}}{}{, #5}% \ifthenelse{\equal{#6}{}}{}{, #6.}% \ifthenelse{\equal{#7}{}}{}{% \ifthenelse{\equal{#8}{}}{}{\hfill ...


6

Same distance for square nodes is not obvious. In your example the centers are at the same distance. Here is one possible interpretation of "same distance" by changing the anchor of the surrounding nodes. \documentclass[tikz,border=7mm]{standalone} \begin{document} \begin{tikzpicture} \draw[lightgray] circle(1.5cm); \node (context) ...


6

This is quite straight forward in the sense that you can use calc library of tikz and access the points between two points with any ratio. For example, ($(foo.north east)!0.25!(foo.south east)$) is the point that is 25% away from foo.north east on the line connecting foo.north east and foo.south east. Hence we could use \draw[->] ($(foo.north ...


4

Try this config file: \Preamble{xhtml} \Configure{@HEAD}{\HCode{<link href="basic.css" rel="stylesheet" type="text/css" />\Hnewline}} \DeclareGraphicsRule{.png}{bmp}{.xbb}{} \ConfigureEnv{figure} {\ifvmode\IgnorePar\fi\EndP\HCode{<div class="figure"\Hnewline>}% \bgroup \Configure{float}{\ShowPar}{}{}% } {\egroup ...


2

This should do the trick: \raisebox{-0.3\height}{\includegraphics[scale=0.6]{figures/warning.png}}


3

The simplest method for arranging material in rows and columns is with tabular, in this case nested ones. \documentclass{article} \usepackage{graphicx} \begin{document} \begin{figure} \centering \begin{tabular}{@{}cc@{}}% outer tabular \begin{tabular}{@{}c@{}}% inner tabular for the big picture \includegraphics[height=3cm,width=4cm]{duck} ...


2

You could place the rectangle in one minipage and the six squares in another. \documentclass{article} \usepackage[demo]{graphicx} % remove 'demo' option in real document \begin{document} \begin{figure} \centering \begin{minipage}{2.5cm} \includegraphics[width=2.5cm,height=1cm]{rectangle} \end{minipage} % note: no line break after end of minipage ...


13

standalone can be set up to recompile included pictures only if required. Otherwise, it will include the previously compiled PDF. So it is not necessary to switch to \includegraphics to benefit from pre-compilation. Here's a basic example. The figure: % mytikz.tex \documentclass[tikz,border=5pt]{standalone} \usetikzlibrary{cathod} \begin{document} ...


2

It seems to me that publications will mostly want pre-compiled graphics. You can ease your quandary relatively painlessly by moving your preamble and Tikz/PGF graphics to separate .tex files and use \input to give yourself a choice at compile time. For instance, your main document might look like: \documentclass{report} \input{preamble} \begin{document} ...


7

Because even after scaling it, the image's width is bigger than \textwidth so it protrudes to the right. With your example code you get a warning about this: Overfull \hbox (11.64403pt too wide) in paragraph at lines 10--10 Instead of scale, control the width using: \includegraphics[width=\textwidth]{tikz.pdf} or a fraction of \textwidth: ...


6

This is why I like compiling on the command line and not with TeXMaker etc. stuff: There is a clear warning in the .log file (and a often occurring error:) No floats inside multicols environment: Package multicol Warning: Floats and marginpars not allowed inside `multicols' environment!. This is documented behaviour, the multicol manual describes this ...


2

Try using a minipage as this: \documentclass[12pt,a4paper]{article} \usepackage{caption} \usepackage{graphicx} \begin{document} \makebox[0pt][l]{% \begin{minipage}{\textwidth} \centering \includegraphics[width=.4\textwidth]{example-image.pdf} \captionof{figure}{figure caption} \label{fig:fig1} \end{minipage} } \medskip I used Figure \ref{fig:fig1} ...


3

You can use \captionof from the capt-of or caption packages and place the captions inside nodes of the desired width (I chose \linewidth, but make the adjustments that best suit your needs); the positioning library was used to easily place the captions under the images: The code: \documentclass{article} \usepackage{graphicx} \usepackage{tikz} ...


0

\includegraphics does not recognise the key page. This is not an option. You cannot specify a particular page. If you need to specify a page or pages, you need to use the \pdfpages package and \includepdf[pages=<spec>]{filename}. Do not use the extension .pdf_tex if the file is a PDF. You need to use the correct extension for packages such as ...


0

Snapshot of a Simulink model: Open the Simulink system which you would like to print to file. Switch to the Matlab application and run the following code: print -dpdf -s <outputFileName>.pdf %vector format print -dpng -r225 -s <outputFileName>.png %raster format For vector format: I'm using r2013b, which has pdf capability despite ...


1

It's easier if you place the image in the same folder as your .tex file and then just input the filename without the extension (it's not necessary). Like \includegraphics[width=6.5cm]{SSE Ari&Geo} The & causing errors is inconsistent (it seems to throw the error when there is a space in the filename though). In any case, I'd suggest removing it to ...


0

You shouldn't use the subfigure, which hasn't been maintained for may years. I suggest using the subfigure environment from subcaption, and the epstopdf package to compile with pdflatex: \documentclass{article} \usepackage{graphicx} \usepackage{subcaption} \usepackage{epstopdf} \begin{document} \begin{figure}[t] \centering \begin{subfigure}{3.5in}{ ...


3

To set-up the captions use the caption package, together with setspace to cope with the double spacing requirement for figure captions. Now you can use \captionsetup[table] and \captionsetup[figure] to define the styling of captions for the two environemnts. There are hooks for the different fonts involved, the justification of the text and the formatting ...


1

If you do not want the figures to float away, just do not use a floating environment like figure. I can not test your case, as I have no real MWE, but I guess that something is pushing your figure to a position, LaTeX sees better fit in. Below I show you how to get the same result with a center (second figure). This environment does not float. % arara: ...


1

Following up on Sean's idea, I've put together a working solution that postprocesses the pdf output and then updates the .synctex file. Using the original SyncTex data (and the C parser provided by jerome laurens), it's easy to figure out where the first line of each pageXXX.tex ended up in the pdf output, and from that the 2up version is easily generated ...


1

Here is another way, with \stackinset. In this MWE, I inset it 10pt from the right-top of the main image. Those values can be changed in the argument list, even including negative offsets. \documentclass{beamer} \usepackage{stackengine} \begin{document} \begin{frame}{Title} \begin{figure} \centering ...


4

You can remove white margins from a pdf file with pdfcrop, in the simplest version pdfcrop file.pdf which generates a maximally cropped output file named file-crop.pdf. You can also specify new own margins in points (default is zero), and name your output file as you want, as in pdfcrop --margins 10 input.pdf output.pdf


2

You may be interested in the following setup: \documentclass{beamer} \usepackage{adjustbox} \begin{document} \begin{frame} \frametitle{My title} \centering \adjustbox{valign=T}{\begin{tabular}[t]{@{}c@{}} \includegraphics[width=.7\linewidth]{example-image-a} \\ Some caption \end{tabular}}% ...


0

I too faced the same problem, but after several trials, i corrected the error. finally the settings shown in the figure are working.


1

From data, which you provide, I only can suggest to ad option h to figure environment. If after line, to which follows figure is enough place, figure will stay there, otherwise it will move on top to next column/page. \begin{figure}[h]% <--- h as here, sometime help !h \centering \caption{Original Image} ...


7

Interesting. Not seen that before, I'd work around it as follows but we should probably make it not do that (not sure if it's graphics or pdftex.def at present) \documentclass{article} \usepackage{graphicx,fancyhdr} \newbox\zzz \sbox\zzz{\includegraphics[height=2cm]{example-image-a}} \fancypagestyle{xxx}{\fancyhead[C]{\usebox\zzz}} ...


2

Closest i can come up with just looking at the picture. \documentclass{article} \usepackage{geometry} \geometry{top=0cm,a4paper,left=3cm,right=2cm,bottom=1.5cm} \usepackage{graphicx} \usepackage{scrextend} \usepackage{tgadventor} \begin{document} \begin{titlepage} \sffamily \vspace*{.5cm} \begin{addmargin}[0cm]{-2cm} ...


1

I would use the package adjustbox here. Please note the option valign=t I added to each image: % arara: pdflatex \documentclass[headsepline]{scrreprt} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \PassOptionsToPackage{demo}{graphicx} % you can remove this. \usepackage[export]{adjustbox} \usepackage{tikz} \usetikzlibrary{positioning} ...


0

I was also looking for a way to fix this issue with flowing text around full page figures. To extend on David Carlisle's answer for figures that are not the full page height on their own, I've found that putting a full page minipage environment inside a figure float seems to do the trick. \begin{figure} \begin{minipage}[c][\textheight][c]{\textwidth} ...



Top 50 recent answers are included