New answers tagged

2

Lines break automatically; if you want to force a line break, use \protect\\ Example: \documentclass{article} \usepackage{graphicx} \usepackage{subfigure} \begin{document} \begin{figure} \subfigure[A long line\protect\\ and another]{% \includegraphics[width=0.23\textwidth]{example-image}% } \end{figure} \end{document} Note that subfigure has ...


0

you have to run the document twice. However, use package caption and \captionof if you do not want the image to float around. \documentclass{article} \usepackage[T1]{fontenc} \usepackage[demo]{graphicx} \usepackage{listings} \usepackage{caption} \begin{document} \begin{lstlisting}[caption={Testcode is here}\label{lst:Testcode is here},frame=single] ...


0

The \tiny stuff in your plots has the same size in both figures -- as well as all the other text in the plots. As you mentioned already by yourself in your question it is a very bad idea to scale an externalized picture, bechause then the mess of mixing up sizes starts, especially when you resize your picture not maintaining the aspect ratio. When you want ...


0

This might be a good starting point ... \begin{filecontents}{Lit.bib} @book{tadros2006applied, title={Applied surfactants: principles and applications}, author={Tadros, Tharwat F}, year={2006}, publisher={John Wiley \& Sons}, } @book{binks1998modern, title={Modern aspects of emulsion science}, author={Binks, Bernard P}, ...


1

Here's a solution that uses the [h!] position specifier to direct LaTeX to make the figure environment non-floating. Of course, this method won't work if there's not enough space remaining in the column to actually insert the two side-by-side images and their captions. Instead of absolute widths for the minipages and images, I'd use relative widths, e.g., ...


4

A common misunderstanding is that figures or tables have to be placed in an environment of the same name to let them float away. They can be placed in situ (given enough space is available), just dropping the figure or table environment. If a caption is needed (the \label command in the MWE is useless without \caption, then \captionof by the caption package ...


2

You can grab the floatrow documentation code: \floatsetup[widefloat]{margins=hangleft} \begin{figure*}% \begin{floatrow}[4] \ffigbox {\caption{Figure~I in the row (\texttt{floatrow}), ``column'' width}% \label{fig:row:Dog}} {\input{TheDog.picture}} \ffigbox[\FBwidth] {\caption{Figure~II in the row (\texttt{floatrow}), ...


0

You can use the strip environment, from cuted: \documentclass[twocolumn]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{ebgaramond} \usepackage{geometry} \usepackage{cuted} \usepackage{graphicx, subcaption, caption} \usepackage{lipsum} \begin{document} Some text some text some text some text some text some text some text some ...


2

How about \documentclass[preprint,12pt,authoryear]{elsarticle} \begin{document} \begin{figure} \caption{abc} \label{fig:abc} \includegraphics[width=\textwidth]{<filename>} \end{figure} \end{document} Simply use a real filename, of an image file encoded in a supported format, instead of <filename>.


1

Just make two rows, one for images, one for captions \begin{figure}[htbp] \centering \begin{minipage}{0.6\textwidth} \includegraphics[width=\textwidth]{figures/fig1.jpg} \end{minipage}%%% \hfill \begin{minipage}{0.35\textwidth} \includegraphics[width=\textwidth]{figures/fig2.png} \end{minipage} ...


0

If you want the figures to be on the same page no matter what, use a single figure environment. \documentclass{article} \usepackage{graphicx} \begin{document} Meanwhile, we also generate figures about the distribution of debris based on size (figures \ref{top}~and~\ref{bottom}). \begin{figure}[htbp] \centering ...


2

Some notes: To solve your issue, to each figure add \begin{figure}[!htb] Only one \centering is enough inside a figure/table environment, so you can remove the second one in each. The "Figure 5 and Figure 6" you manually added can be done automatically by Latex, by adding \label{<your label>} inside of each figure then writing \ref{<your ...


3

When the width of the caption is less than that of the float, by default, ConTeXt centers the caption box. So, visually, the captions don't appear to be left aligned. The simplest workaround is to tell ConTeXt to always choose the width of the caption box to be equal to that of the float. This can be done by adding the option width=max to \setupcaption. ...


0

Setting the page layout like this: \textwidth 6.75in \textheight 9.25in \oddsidemargin -.25in \evensidemargin -.25in \topmargin -1.5in is not very intuitive. It is not clear how big the actual margins are. You should use the geometry package for that. With it you can easily specify the margins like this. \usepackage[left=1.5cm, right=1.5cm, top=0.5cm, ...


3

It is possible with \usepackage{floatrow} that defines a new Option H for \begin{figure}[H]. With this, the figure is not floating and just placed where you include it. You can use caption and label like for floating figures. \documentclass[a4paper,10pt]{book} \usepackage{amsmath} \usepackage{mdframed} \usepackage{graphicx} \usepackage{xcolor} ...


1

This isn't quite what you wanted, but you might warm up to it. It moves all the floats to the end of the document. \documentclass{article} \usepackage[nofiglist,nomarkers]{endfloat} \usepackage{lastpage} \usepackage{mwe} \makeatletter \def\ps@float{\ps@plain \def\@oddfoot{\hfil Float \thepage{ of }\pageref{LastPage}\hfil}% \let\@evenfoot=\@oddfoot} ...


1

You cannot mix some text (section title) and sidewaysfigure on the same page. In your case, if the image is shorter than rest of vertical place on the page and you like to have both on the same page, just can rotate only image: \documentclass[a4paper]{report} %\usepackage{float} \usepackage[margin=25mm,showframe]{geometry} %\usepackage{rotating} ...


2

When using the caption package with the IEEEtran class you receive the following package warning: Package caption Warning: Unsupported document class (or package) detected, (caption) usage of the caption package is not recommended. See the caption package documentation for explanation. So let's not use caption. You can set the ...


4

It's easy to do it with the threeparttable environment, which measures the width of tables: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[showframe]{geometry} \usepackage{fourier, erewhon} \usepackage[justification=justified,singlelinecheck=false]{caption} \usepackage{booktabs} \usepackage{threeparttable} \begin{document} \vspace*{2cm} ...


3

\renewcommand\figurename{Figure} should work.


3

The order in the option does not matter as they just restrict where latex attempts to place the float so the main effect of the option you give is to prevent the float being placed on a float page as p is not included. Obviously h has to be tried first, at the point the float is entered, but top bottom and page floats are just cyclically tried as each time ...


3

The subcaption package interprets spaces between subfigure environments within the figure to be new rows. Removing the space between these environments (and the unnecessary \quad and bigskip) yields the desired 2x2 \documentclass{article} \usepackage{tikz} \usepackage{subcaption} \begin{document} \begin{figure} \centering ...


0

The correct solution is \usepackage{float} \let\origfigure=\figure \let\endorigfigure=\endfigure \renewenvironment{figure}[1][]{% \begin{figure*} }{% \end{figure*} }


1

I'm not very sure what is your problem. Appearing of references to table in appendix? So see, if this will help you: in preamble add package {chngcntr} and select numbering within section: \usepackage{chngcntr} \counterwithin{table}{section} after \begin{subappendices} add: \counterwithin{table}{section} after each section in appendices reset table ...


0

The following also worked for me, but make sure \usepackage[nolists,tablesfirst]{endfloat} \DeclareDelayedFloatFlavor{sidewaystable}{table} \DeclareDelayedFloatFlavor{sidewaysfigure}{figure} comes after \usepackage{rotfloat} in the LaTeX code.


4

You should modify the environnement from figure to figure*: \documentclass[twoside,twocolumn]{article} \usepackage[demo]{graphicx} \begin{document} \begin{figure} \includegraphics{tmp} \end{figure} \begin{figure*} \includegraphics[width=\linewidth]{tmp} \end{figure*} \end{document} So in your case: \begin{figure*}[h] ...


1

You place three images in a column in just the same way as you'd place three letters, just add them in a single paragraph if you want them side by side, or in separate paragraphs if you want them one above the other. Here are three paragraphs with one image in each. \documentclass{article} \usepackage{graphicx} \begin{document} \centering ...


2

I'm not absolutely sure what you mean with in one column. Because it looks like just two pictures beneath each other which doesn't necessarily imply that you actually need it column e.g. to display text on the side of the images. Although it's quite dirty you could probably just force the pictures on that location with [H]: \usepackage{graphicx} ...


1

\setlength\floatsep{1.25\baselineskip plus 3pt minus 2pt} \setlength\textfloatsep{1.25\baselineskip plus 3pt minus 2pt} \setlength\intextsep{1.25\baselineskip plus 3pt minus 2 pt} Put the above in the preamble, and change the 1.25 to desired one. The First Line is for length between two adjacent floats The Second Line - for floats on top and bottom of ...


2

The following calculates \textheight minus the size of the caption. I'm not sure why the 2pt fudge factor is needed (round off error?). \documentclass{memoir} \usepackage{mwe} \begin{document} \begin{figure}[p] \sbox0{\parbox{\textwidth}{\null\caption{\blindtext}\null}}% ...


3

1) The drawing is not centered Well, it is centered. The problem is that your eye would like to see the central box centered instead of the whole bounding box, which includes the side text "piastra..." etc. To understand this, wrap your tikzpicture in a \fbox{....}: you'll see that the box is centered in the page. To fix this you can use the trim right ...


3

If you only need to place some text besides the image, you can use a couple of minipage environments. If you want the whole document text to wrap around the image, a different solution would be in order (\wrapfloat for example). Output Code \documentclass{article} \usepackage{graphicx} \usepackage{capt-of} \begin{document} \subsubsection{Geometrische ...


1

In order to patch an environment such as figure* you can do \expandafter\patchcmd\csname figure*\endcsname{....}{...}{}{} This method is ineffective with commands such as \section*, which are defined in a completely different way. On the other hand, if you just want to add \centering to all floats, you can just add \centering to \@floatboxreset: ...


4

The fact that the writefile appears on the terminal means that the information got written to the aux file after the aux file was closed for writing. 99 times out of a hundred when that is seen it is because \include has been redefined not to use \clearpage, in which case the solution is to remove that redefinition.


1

You can also use \caption* when using the caption package which keeps only the caption title. You may do something else what did not work, but this example works as desired: \documentclass{article} \usepackage{caption} \usepackage[demo]{graphicx} \begin{document} \begin{figure}[ht] \centering \includegraphics{figure1} \caption*{Caption.} \end{figure} ...


1

Simple answer : If you want to shift 6 em to the left you do something like \hspace*{-6em} \begin{tabular}{ m{5em} m{14em} m{17em} m{4em} } \hline \textbf{Year} & \textbf{Degree/Certificate} & \textbf{Institute} & \textbf{CGPA} \end{tabular}


0

This is a simple solution: \usepackage[figurename=Fig.]{caption} Works with and without babel. Use tablename for tables.


0

LaTeX IDEs (I use AUC-TeX with xemacs) allow you to e.g. process just the file being edited, or even just a range in it. Check the documentation, or ask around for suggestions for your platform.


1

LaTeX assumes the order of the tables is important to you, and strictly respects that. Probably the easiest (but not sexiest) way to get what you want is to reorder them by hand. Unless this is a frequent, repetitive task, you risk xkcd's automation.


6

\documentclass{article} \usepackage{graphicx} \usepackage{caption} \usepackage[paperwidth=6in, paperheight=9in, margin=0.9in, showframe]{geometry} \usepackage{lipsum} \begin{document} \begin{figure} \centering \begin{minipage}{.4\textwidth} \centering \includegraphics[width=1\linewidth]{example-image} \end{minipage}\qquad \begin{minipage}{.4\textwidth} ...


4

Just reserve the wanted space to the minipages; with \dimexpr it's easy to fix the space in between the images (here to 2 ems). Note that you don't need \captionof. With \begin{minipage}[t] you ensure alignment with respect to the bottom of the pictures. \documentclass{article} \usepackage{graphicx} \usepackage{caption} \usepackage[paperwidth=6in, ...


2

Float styles can be set in a group, i.e. {% \floatstyle{plain} \restylefloat \begin{figure} ... \caption{foo} \end{figure} } This settings lasts only for all figures that are inside the {....}, outside the global setting holds. To switch off the framed style, just say \floatstyle{plain}. \documentclass[11pt]{article} \usepackage[demo]{graphicx} ...


0

With \item<7-> This is the second text line \item<8> This is the third text line this explicitly tells on which slides the second and third line should be visible. \documentclass{beamer} \usefonttheme{professionalfonts} \usefonttheme{serif} \definecolor{blue}{rgb}{0.1,0.3,0.8} \usepackage{amssymb,amsmath,amsfonts,amsthm,mathrsfs} ...


1

Leave an empty line, then simply add another \hfill like: % previous code \hfill \hfill \citep[30]{Khan14} It will add an extra empty line.


4

Starting a paragraph with a display is a sure source for bad output, particularly in connection with wrapfigure. I guess your aim is to start the picture insertion down the paragraph; this can only be done with some manual work (in the final revision stage, of course). One can add \nopar (defined in the code below) at the end of a suitable line, visually ...


0

I was also interested in creating protocol flow diagrams (also known as ladder diagrams, or sequence diagrams). I found this to be the closest to what I wanted: http://www.texample.net/tikz/examples/sequence-diagram/ But it was far over-complicated and the code was ugly. Here's my go at a more simple form: % Agents \def\Client {Client} ...


1

It would really be better to provide an example code, you don't need to post your real words just xyz and \rule{1cm}{1cm} instead of graphics is enough, but anyway... At the point that the third page is about to start, latex has the pending figure and it has to decide whether to output it at that point on a float page (which it has done) or to hold it back ...


2

You nested tabular ... if you omit the first, the cute cats appear in the image as you desired. \documentclass{article} \usepackage{caption} \usepackage{subcaption} \usepackage{graphicx} \usepackage[active,floats,tightpage]{preview} \setlength\PreviewBorder{1em} \begin{document} \begin{figure}[!htb] \centering ...


1

For making a caption, I could use caption package. Hints from Label and caption without float. \documentclass[conference]{IEEEtran} \usepackage{listings} \usepackage{lipsum} \usepackage{caption} \usepackage{color} \DeclareCaptionType{mytype}[Code][List of mytype] \newenvironment{code}{}{} \definecolor{delim}{RGB}{20,105,176} \lstdefinelanguage{rruby}{ ...


2

Only a preliminary version, I've to add the hyperref support etc. and other features. (Basically it's similar to my answer to this question here: Redefining \listoffigures and \listoftables as tables ) The principal idea is to put all the caption images into a tcolorbox raster (a table would do as well, I think) -- please note, that currently the list of ...



Top 50 recent answers are included