# Tag Info

0

You can centre the images with a simple \raisebox{-0.5\height}{…}. As the vertical spacing in tables is very tight, you can introduce some more with the cellspace package: it ensures a minimal spacing between a cell and the above and below cells in columns that have an S prespecifier. Here is an example, using one of my favourite images. In order to have a ...

2

The tex model of table layout doesn't really allow for vertically centering within the space of a cell, each cell has a base reference point and these are aligned. l, c, r columns it is the baseline of the text p columns it is the baseline of the top row. and for m columns it is that cell's centre and b it is that cells bottom line. The baseline of an ...

0

Type \usepackage[export]{adjustbox} to your document preamble immediately above \usepackage{graphicx}. Then include your images as \includegraphics[scale=0.7,valign=t]{\visualizadordeperfil apontador.png} This will shift the picture vertically, so that its height is just like the height of a line of text. Here's an example, I used \fbox around ...

1

If you do not mind using a package for the job, you can use tcolorbox. Note that you will need the brand-new version 3.30 (2014/11/17) for this. \documentclass[pdf]{beamer} \usepackage[many]{tcolorbox} \begin{document} \begin{frame} \begin{tcbitemize}[raster columns=3,raster equal height,blanker, raster column skip=5mm,raster left skip=-5mm,raster ...

3

No need for guessing shifting values. You can let LaTeX do all the calculations for you: use minipages, measure the total height of the right and left minipages, select the maximum height and then use this value in the optional argument for minipage to get the desired alignment. The \TCTcolumns will do this; it has three mandatory arguments: ...

2

It is easy, use \parbox. You will have to do some dirty tweak of the actual vertical displacement of the rule. \documentclass[pdf]{beamer} \begin{document} \begin{frame} \begin{columns}[T] \begin{column}{0.33\linewidth} This is the first column. This is the first column. \end{column} \begin{column}{0.33\linewidth} \centering ...

1

The \tablenum command relies on begin able to 'bump' into the side of the column, which can only work if the natural width of the column is maintained all the way down. With a longer header you are going to have to add some dummy digit space to help alignment. For example \documentclass{article} \usepackage{multirow,siunitx} \begin{document} ...

4

\documentclass{article} \usepackage{siunitx} \begin{document} \newbox\mybox \sbox\mybox{\begin{tabular}{@{}S[table-format=2.2]@{}}1.31\\1.48\end{tabular}} \begin{tabular}{S[table-format=2.2]S[table-format=2.2]S[table-format=1.2]} {Energy} & {Efficiency} & {Uncertainty} \\ 14.14 & 10.41 & 3.82 \\ 22.10 & 4.17 & 3.14 \\ % oops 30.97 ...

1

Another option is to load \usepackage[export]{adjustbox} and use valign=c in \includegraphics[keepaspectratio=true,width=.2\paperwidth,valign=c]{example-image-a} Code: \documentclass{beamer} \usepackage[export]{adjustbox} \begin{document} \begin{frame}\frametitle{Transportation polytope constraints} A $\nu$-index transportation polytope is a polytope ...

3

The reference point of an image is on its bottom edge and the default reference point of a tabular or array is its vertical centre, which is why your image shows the bottom edge of the image in line with the array's centre. Use \begin{array}[b] so the reference point for the array is on its bottom row, or use \raisebox to move the reference point of the ...

7

You are missing an awful lot of % at the ends of lines, and \parbox{1.75in}{\textsf{ \hspace{-5pt} } { }} Just always makes an empty parbox. I don't think the tikz code is helping here really it is just complicating things if you just want to draw three lines. \documentclass[final,oneside,11pt]{memoir} \usepackage{wrapfig} ...

3


6

Several things are going on that are not working for you. First, the new lengths that you're defining should be defined outside of the environment. Secondly, you cannot call \parbox{1.75in}{ in one part of the definition for your new environment and close it in the second part. It's best to use an lrbox for that purpose. Thirdly, wrapfigure needs to be ...

1

In addition to the titleframe \vfill I mention, in my comment, better centering can also be achieved with more \vfills in the definition of \blankframe. \documentclass[xelatex]{beamer} \usepackage[quiet]{fontspec} \usepackage{xunicode} \usepackage{xltxtra} \usepackage{graphicx} \usepackage{xcolor} \setbeamerfont{question}{size*={14}{1.4em}} ...

3

I suggest the adjustbox package, which allows to use the valign=t option that's exactly what you want. I suggest also some simplifications of your input, with macros that substitute the repetitive tasks. \documentclass[a4paper]{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[danish]{babel} \usepackage{graphicx} ...

2

Using the origin=c option to \rotatebox will give text that is vertically centered without the use of an extra subfigure. Alternatively you can [t] align the subfigures are rotate with origin=l: origin=c: origin=l and subfigures with [t]: \documentclass{article} \usepackage{graphicx} \usepackage{caption} \usepackage{subcaption} \begin{document} ...

4

You have used \raisebox{-\totalheight}{\includegraphics which moves the baseline of the picture to its top edge, so as you see in your image the top edge aligns with the baseline of the text in the l columns, such as AUG. You want the baseline of the image to be roughly 15pt from the top of the image so ...

1

Using baseline option in tikz was the solution. Here is the MWE that produces the desired result: \documentclass{article} \usepackage{tikz} \newcommand{\rbox}[1]{ \begin{tikzpicture}[baseline] \node[rounded corners=3pt, draw, anchor=base]{#1}; \end{tikzpicture} } ...

6

The problem goes if you lose this line %\parskip2ex plus1ex minus1ex or even just change it to \parskip2ex plus1ex %minus1ex Putting lots (or any) of shrink glue into the vertical list rather complicates the assessment of whether there is room... longtable could try harder to estimate the amount of glue that will really stretch/shrink but currently, ...

1

You should use proper tool for each job ;-) Here it is tcolorbox \documentclass[12pt,border=5]{standalone} \usepackage[most]{tcolorbox} \newtcolorbox{mybox}[1][]{ enhanced, colframe=gray!80, colback=gray!40, left=2em,right=1ex,top=1ex,bottom=1ex,%boxsep=1em, leftrule=4pt, rightrule=0pt, toprule=0pt, bottomrule=0pt, arc=0pt, %breakable, ...

4

You could try: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{mathtools} \begin{document} $$\begin{array}[t]{c @{\,} c @{{}={}} c} AAAAAA & yyyyy & bbbbbb \\ A & y & b \\ \end{array}$$ \end{document} Addendum, to address the OP's follow-up query: To typeset the two versions of ...

5

Isn't this what you want \documentclass{article} \usepackage{booktabs} \usepackage{siunitx} \begin{document} \begin{table} \begin{tabular}{lS[table-format=-1.4e-1]} \toprule Variable & {Coefficient Weight} \\ \midrule A & 0.0018 \\ B & -6.0113E-4 \\ C ...

5

You should put all your math inside of a wrapfigure. Like this, the text will just wrap around it. % arara: pdflatex \documentclass[a4paper, 11pt]{article} \usepackage{mathtools} \usepackage{wrapfig} \usepackage{blindtext} \newcommand*{\vstrut}{\vphantom{\frac{1}{2}}} \begin{document} \blindtext \begin{wrapfigure}{l}{.5\textwidth} ...

2

You have forced centre alignment of your inner tables, but you want top alignment. \documentclass{article} \usepackage{lscape} \usepackage{booktabs}% http://ctan.org/pkg/booktabs \newcommand{\tabitem}{~~\llap{\textbullet}~~} \begin{document} \begin{landscape} \begin{table}[ht] \small \begin{tabular}{|p{4cm}|p{9cm}|p{8.2cm}|} \hline \textbf{Control ...

0

It may seem counterintuitive, but bottom aligning the column works. I have emended your example, including the array packaage and changing the table spec to \begin{tabular}{|b{4cm}|p{9cm}|p{8.2cm}|}. \documentclass{article} \usepackage{lscape} \usepackage{array} \usepackage{booktabs}% http://ctan.org/pkg/booktabs ...

0

The blank line between the \question line and the \includegraphics line means that the graphic is in a separate paragraph. Remove the blank line and you should get the desired result. \documentclass[12pt,a4paper]{exam} \renewcommand{\baselinestretch}{1.2} \oddsidemargin 0in \evensidemargin 0in \topmargin 0in \textheight 9.2in \textwidth 6.5in %\hoffset ...

1

Code \documentclass[12pt,a4paper]{exam} \renewcommand{\baselinestretch}{1.2} \oddsidemargin 0in \evensidemargin 0in \topmargin 0in \textheight 9.2in \textwidth 6.5in %\hoffset -1in %\voffset -1in %\evensidemargin 14pt \usepackage{amsmath,amsthm,amsfonts,amssymb,graphicx,dsfont,multicol} \DeclareGraphicsRule{.bmp}{bmp}{.bb}{} \begin{document} ...

1

Insert a manual vertical skip back to the baseline of the \item (a total of \baselineskip plus \topsep): \documentclass[11pt]{article} \usepackage{amsthm} \newtheorem{deff}{Definition} \begin{document} \noindent \begin{tabular}{@{}p{.48\linewidth}p{.48\linewidth}@{}} \begin{itemize} \item In line. \item ...

5

i'm largely guessing here, but since you're using amsart, ... from your description, it seems that you want a large gap between two math displays. that is usually considered inappropriate (see recommendations in Mathematics into Type), but presumably you have a reason. there is a standard facility for adding space between two lines of a multi-line display. ...

5

The amsart class redefines ~ to be \protect\nonbreakingspace that indeed does \unskip and \ignorespaces, because it wants to catch cases when users type some ~ word and normalize them as if it were some~word. The correct way for “leaving a blank line” is to say text above \bigskip text below With the definition in amsart, this makes ~ illegal at the ...

6

The standard definition of ~ will not generate this error \documentclass{article} \usepackage{amsthm} \begin{document} \begin{proof} ... $$some stuff$$ $$some more stuff$$ ~ % want space here to set apart from above $$yet more stuff$$ ... \end{proof} \end{document} produces You appear to have a local redefinition of ~ that starts with \unskip ...

5

minipage are vertically centred by default, use [t] for example \begin{minipage}[t]{0.4\textwidth} so they align on their top line

3

To "vertically centre" the Point ans Score headings you could use an m column but really alignment is baseline oriented so it probably works better to \raisebox{2pt}{\makebox[0pt]{Point}} and raise it by whatever amount looks best "by eye" (the \makebox hides the width to allow it to centre horizontally as explained in the other question).

5


3

There are a variety of ways to approach such things. Here's an example using tikz \documentclass{article} \usepackage{amsmath,amssymb} \usepackage{tikz} \usetikzlibrary{positioning} \begin{document} \begin{tikzpicture}[ my node style/.style={ draw, outer sep=0pt, inner sep=4pt, minimum height=2*23.76836pt}] \node[my node style] (A) at ...

1

Use a strut. In the following command I also set \scriptstyle to avoid the letters to become too small. \documentclass{article} \usepackage{amsmath} \newcommand{\coeff}[2]{% \underset{\underset{\scriptstyle\mathstrut #2}{\uparrow}}{#1}% } \begin{document} $\coeff{1}{a}x^2-\coeff{3}{b}x-\coeff{10}{c}=0$ \end{document}

1

Here's an answer using stacks, which I have incorporated into the macro \ptto{}{}. Note: I have made it so that a wide comment does not disrupt the spacing of the equation above. However, if the width of the underset was such that you needed to adjust the spacing of the above equation, then the [F] option to \ptto will accomplish it, as in ...

8

If you start a paragrah inside a vbox (or vcenter) the lines will be broken to \hsize which is \textwidth here which is wider than you want. You should use a tabular which will vertically centre and look more like latex. All LaTeX box and rule commands consistently start a paragraph (so \rule here) but TeX primitives like \hbox do not.

Top 50 recent answers are included