Tag Info

Hot answers tagged

7

Here I introduce \pushfigure[alignment]{width}{content}{captioningof} to push figures onto a "stack", and then \popfigures to set them all on a line. In all cases, captioning should be done with \captionof for any figure being "pushed". Bottom alignment is the default. The \pushfigure phase of the operation saves all the parameters, and measures the ...


5

With adjustbox \documentclass[letter,11pt]{article} \usepackage{adjustbox} \usepackage{showframe} %% just for demo \newenvironment{FitToWidth}[1][\textwidth]{% \begin{adjustbox}{width=#1,center} } {\end{adjustbox}} \begin{document} \begin{adjustbox}{width=\textwidth} HELLO \end{adjustbox} \bigskip \begin{FitToWidth} HELLO \end{FitToWidth} \bigskip ...


4

Here is your code: \newenvironment{FitToWidth}{ \begin{center} \begin{minipage}{\textwidth} \begin{center} \resizebox{\textwidth}{!}{% } { } \end{center} \end{minipage} \end{center} } This has the following syntax: \newenvironment{arg1}{arg2} But \newenvironment` expects 3 arguments (optionally 4 or 5): ...


4

You haven't provided full mwe, so I expanded your sample to illustrate the problem: \documentclass{article} \begin{document} \begin{figure} \begin{minipage}{0.6\textwidth} \makebox[0.4\columnwidth][l]{line1} \par \makebox[0.4\columnwidth][l]{line2} \par \makebox[0.4\columnwidth][l]{line3} \end{minipage} ...


4

Get rid of the minipage and enclose the listing inside a figure*; it will be moved to the top of the following page but you won't have the problems that you are experiencing now: \documentclass[10pt,journal,compsoc]{IEEEtran} \usepackage{listings} \lstdefinestyle{base}{ language=C, basicstyle=\footnotesize\ttfamily, multicols=2, ...


4

Capture the environment contents, and then resize it. The former is the difficult part, which is causing the problem. However, it's made easy by the environ package: \documentclass{article} \usepackage{graphicx,environ} \NewEnviron{FitToWidth}[1][\textwidth]{% \begin{center} \makebox[\textwidth]{resizebox{#1}{!}{\BODY}}% \end{center} } ...


3

Here is one try with tabulars. \documentclass{article} \usepackage[landscape, paperwidth=15cm, paperheight=30cm, margin=0mm]{geometry} \usepackage[table]{xcolor} \begin{document} \pagestyle{empty}% \noindent \begin{tabular}{@{}c@{}} \cellcolor{blue!50}% \begin{minipage}[t][\paperheight][t]{0.5\paperwidth}% FRONT COVER ...


3

The images show the difference between \flushbottom and \raggedbottom, adding \raggedbottom to your preamble (which is the default for single side `article) will cause LaTeX to pad any short pages with stretchable space at the bottom of the page.


3

The subcaption package is doing something dodgy. For example, you can't use \captionof{subfigure} inside a subfigure (anywhere else is fine). I overcame the problems of my previous solution by permanently replacing subfigure with minipage and creating my own \caption from scratch. % arara: pdflatex % !arara: indent: {overwrite: yes} ...


3

You can use two sets of side-byu-side minipages; the top set has b (bottom) alignment for the images and the second set has t (top) alignment for the captions: \documentclass{article} \usepackage{graphicx} \usepackage{caption} \begin{document} \begin{figure} \captionsetup{justification=raggedright} \begin{minipage}[b]{.3\textwidth} \centering ...


3

Use the [H] option of the package float to position your figures at their exact location. Combine it with a negative value for \vspace* to "align" the figure with your multiple choice answers. Refering to your pictures is done with \ref and by placing \label inside the figure environment (after the caption). Also, your tikzfigures can be drawn with way ...


3

It's the default indentation. As far as LaTeX is concerned, a minipage is just like a big letter. So \begin{minipage} starts a paragraph, if not already inside one. \noindent\begin{minipage}{\textwidth} solves the issue. About the height, I'm not sure what you really want to achieve. For a full page float, you can do like \documentclass{article} ...


3

You can re-centre the box using \raisebox. I also reduced the width a bit to leave room for the shadow as tex was warning about overfull box \documentclass{article} \usepackage{fancybox} \begin{document} \noindent \makebox[\textwidth]{% \parbox{1.2\textwidth}{% \setlength{\fboxsep}{10pt}% \fbox{% \begin{minipage}[c]{.53\textwidth} text\\[8pt] text\\[8pt] ...


2

You can also use the adjustbox package to easily get any desired vertical alignment: The code: \documentclass{article} \usepackage{fancybox} \usepackage{adjustbox} \begin{document} \noindent \makebox[\textwidth]{% \parbox{1.2\textwidth}{% \setlength{\fboxsep}{10pt}% \adjustbox{valign=c}{\shadowbox{% \begin{minipage}[c]{.52\textwidth} text\\[8pt] ...


2

A better hack might be to use \makeatletter \renewcommand*{\m@mscapopboxes}{% \m@mcalcscapraise% \usebox{\m@mscap@fbox}%\m@mscapcheckside \ifscapmargleft% \rlap{\kern-\m@mscaplkern% \raisebox{\m@mscapraise}{\smash[b]{\usebox{\m@mscap@capbox}}}% }% \else% \rlap{\kern\sidecapsep% ...


2

\break isn't really a latex command, and multicols provides \columnbreak and as noted in comments, your usage of \center is incorrect, although doesn't affect the column breaking.


2

Use the floatrow package: \documentclass{article} \usepackage{graphicx,floatrow} \begin{document} \begin{figure}[ht] \begin{floatrow}[2] \ffigbox{ \caption{3D illustration of the membrane of the polymersome, which consists of a hydrophillic bilayer at the in- and outside of the biodegradable aliphatic core. This membrane ...


2

First I tried to translate it back to something readable with some guessing, what might be intended. Lots of curly braces are removed. For example, TeX's math spacing around binary and relational operators is lost, if they are put into curly braces. These braces form a subformula which is treated by TeX as ordinary math atom without additional spacing as a ...


2

You can save the positions of the top/bottom of the \vfill using zref's savepos module, and then stretch an image to fill this space: \documentclass{article} \usepackage{zref-savepos,graphicx} \usepackage[nopar]{lipsum}% Just for this example \usepackage[margin=1in]{geometry}% Just for this example \begin{document} \noindent \begin{minipage}{\linewidth} ...


2

You can't break cells across pages; what you can do is splitting the itemize environment across rows. That said, you don't need to use a minipage. With the enumitem package, I define a tabitemize environment that removes the vertical space at the beginning of the cell: \documentclass[a4paper, 10pt]{article} \usepackage[utf8]{inputenc} ...


1

Perhaps something like this. This uses figure* to produce a double-column float. To centre the caption, caption is used so that the figure* caption can be assigned to the lstlisting captions rather than regular figures. \documentclass[10pt,journal,compsoc]{IEEEtran} \newcommand{\us}{\char`_} \usepackage{listings} \lstdefinestyle{base}{ language=C, ...


1

Quick and dirty trick, add the following to your preamble: \makeatletter \renewcommand{\endsidecaption}{\m@mscapend@fbox\refstepcounter\@captype\m@mscaplabel% \begin{lrbox}{\m@mscap@capbox}% \raisebox{0pt}[\height][0pt]{% This line is added, to remove the depth of the box \begin{minipage}[c]{\sidecapwidth}% ...



Only top voted, non community-wiki answers of a minimum length are eligible