Tag Info

New answers tagged

1

You can get the arrows to be at the same vertical height it you apply a \vphantom{<text>} with <text> being the tallest content, and if you want them to be the same width you can typeset the content into a fixed width \makebox. In this case x^2 is the tallest content, so we get: In the above, I fixed the width of the \makebox to be 2.0em. ...


0

You don't want to use alignment characters for this, because as your equations get more complex, you might want to align the equals signs or something and that'll break it. This uses \overbracket and \overbrace from \mathtools so that the alignment of the align environment isn't effected: The first example draws a brace over the text you're writing ...


3

Your description isn't so clear, but perhaps this. Note you should avoid \ in math mode, and don't use math italic for multi-letter works such asmaxand just use\text` for text phrases, not math operators. Also, please always post complete documents. \documentclass{article} \usepackage{amsmath} \begin{document} \begin{align*} &\min \mu \\ ...


5

you have told dcolumn that you only have one decimal place in the numbers so it only leaves room for one digit after the . Also please always post complete documents not fragments with bits removed. The 2.4 leaves enough room for a minus sign and a digit to the left of the . and 4 digits after. \documentclass[a4paper,12pt,icelandic]{report} ...


2

I think the problem is your ... in the second-to-last row in your table. I was able to use the siunitx package by replacing ... with \dots. Also, have a look at the mhchem package. I've replaced your first equation using the \ce{} command provided by mhchem. \documentclass[a4paper,12pt]{report} \usepackage[icelandic]{babel} \usepackage{dcolumn} ...


2

You can either use the functionality of multirow, or merely raise/lower the contents into place, making sure you also remove any vertical height as a result of the movement. Below, \vertcenter does exactly that, moving the contents up by half of the regular baseline skip (.5\normalbaselineskip): \documentclass{article} \usepackage{booktabs,multirow} ...


1

If I've understood your question, this may, possibly do something vaguely of the kind you want. But I'm very far from confident about this! \documentclass{scrartcl} \usepackage{longtable} \usepackage{tabu} \usepackage{calc} \usepackage{blindtext} \newlength{\mytopheight} \newlength{\mybotheight} \newcommand*\mymidrule{\noindent\rule[1mm]{\linewidth}{2pt}} ...


0

This is one way. The \raisebox takes up precisely half the page. \documentclass{scrartcl} \usepackage{longtable} \usepackage{tabu} \usepackage{blindtext} \newsavebox{\tempbox} \begin{document} \noindent\raisebox{-\height}[0pt][0.5\textheight]{% \begin{minipage}{\textwidth} \begin{longtabu}{XXX} %#1 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & ...


3

There's also a tcolorbox solution (using tikz in the background): \documentclass{scrartcl} \usepackage{lipsum} \usepackage[breakable]{tcolorbox} \newtcolorbox{stretchbox}[1][]{ height fill, sharp corners, colback=yellow!10!white, colframe=yellow!50!black, #1} \begin{document} \lipsum[1] \begin{stretchbox} \lipsum[2] \end{stretchbox} ...


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 ...


1

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 ...


2

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

Another alternative is the use of newcommand which is similar to newenvironment. For references: Link1 Link2 Code \documentclass[final,oneside,11pt]{memoir} \usepackage{tikz} \usepackage{calc} \usepackage{wrapfig} \usepackage{lipsum} % \usepackage{showframe} \newcommand*{\offset}[1] { \begin{wrapfigure}[19]{r}[1in]{2in} \noindent ...


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{equation} \begin{array}[t]{c @{\,} c @{{}={}} c} AAAAAA & yyyyy & bbbbbb \\ A & y & b \\ \end{array} \end{equation} \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).



Top 50 recent answers are included