Tag Info

New answers tagged

4

There are a few problems with your table: You shouldn't use \hline. Instead, use \...rule from the booktabs package. Putting \textbf around a math expression has no effect; if you want bold math, use \mtathbf. If you use \ce from the mhchem package when typesetting chemical elements, you get the correct output. Here, use \si{<unit>} instead of ...


2

The package booktabs changes the spacing between lines and the table cells. It uses the commands \toprule and \bottomrule for thicker lines (you used a double \hline for it) and midrule inside the table. Vertical lines are problematic in booktabs and this solution somewhat changes your layout, but maybe it helps: \documentclass{article} ...


3

You can set extrarowheight with the help of array package. \documentclass{article} \usepackage{siunitx} \usepackage{array} \setlength{\extrarowheight}{2pt} %% adjust suitably \begin{document} \begin{tabular}{lcccc} \hline\hline & \textbf{$d_{(O_{1}-Zn/Mg)}(\SI{}{\angstrom})$} & \textbf{$d_{(O_{2}-Zn/Mg)}(\SI{}{\angstrom})$} & ...


2

My suggestion would be to use some sectioning command rather than your font-change macro. Perhaps \newcommand{\Largebf}{\subsection*} or the like. Why doesn't \textbf{\Large ...} provide the desired spacing? That's because font switching macros doesn't take the \baselineskip into account unless a \paragraph is set (or a proper \strut is inserted). The ...


3

The problem is that right after \begin{remarks} TeX is in vertical mode; using \leavevmode (and a possible negative vertical spacing), for example, solves the problem: \documentclass[12pt]{report} \usepackage{amsthm} \newtheoremstyle{multiple_remarks} {1.0em} {1.0em} {\normalfont} {0pt} {\bfseries} {:} {\newline} {} ...


0

It is my personal taste, you might not agree with me. Here is my rule of thumb. We know that the first line of all items of "list" (enumerate, itemize, etc) are left aligned. So if the item starts with a multi-line aligned equation, use aligned environment (plus t passed to its optional argument) rather than align*. See my the second item in my example ...


1

Edit There may well be a better way of doing this but here's a solution using tikz. It turns out be easier to anchor the nodes at the south west corner. \documentclass{article} \usepackage{tikz} \usepackage{lipsum} \begin{document} \begin{tikzpicture}[scale=\textwidth/15.2cm, every node/.style={anchor=south west, rectangle,rounded ...


3

Apart from reminding about the verse environment (and the package with the same name that provides some enhancements), I want to suggest using a special environment for this: the advantage is greater flexibility. In the example I show that by just modifying the definition of \poet you get a different effect without acting on all poems. ...


5

To answer your question, in an array or tabular environment, line spacing is done by placing a strut in every row of height and depth given by \arraystretch times the height and depth of the strut produced by an ordinary \strut commmand. Thus, you can get the desired value (under normal circumstances) with something like \newlength\mylen ...


4

Use t (top alignment) for the optional argument of tabularx: \documentclass[12pt]{report} \usepackage{amsmath, amssymb, amsthm} \usepackage{tikz} \usetikzlibrary{shadows} \newcommand*\squared[1]{\tikz[baseline=(char.base)]{\node[shape=rectangle, draw, inner color = white, drop shadow = {opaque, black}, inner sep=3pt, text justified] (char) {#1};}} ...


14

This is because Word has no descenders, while A long word and Another long word both have a descender (g). Here are some options: \documentclass{article} \usepackage{amsmath} \begin{document} $\underbrace{\text{A long word}}_{=a}$, $\underbrace{\text{Another long word}}_{=b}$, $\underbrace{\text{Word}}_{=c}$ $\underbrace{\text{A long word}}_{=a}$, ...


3

Here's a solution that uses only arrays to align the three parts. The outermost array, which is set up to have three columns, serves to "house" the three horizontal parts. Each horizontal part consists of four rows, but some of the cells in the left-hand and right-hand parts -- which are constructed as nested arrays, each consisting of a single column -- are ...


4

This is a job for \valign! Although I don't think this will help readers much. \documentclass{article} \begin{document} \valign{#\cr \vbox{\hbox{% Equivalent if $A$ $\left\{\vphantom{\begin{tabular}{c} A\\B\\C\end{tabular}}\right.$% }} \vfill\cr \hbox{\begin{tabular}{@{}c@{}} Condition (1) \\ Condition (2) \\ Condition (3) \\ ...


2

\documentclass{article} \usepackage{amsmath} \usepackage{stackengine} \setstackEOL{\#} \setstackgap{L}{.7\baselineskip} \begin{document} \begin{equation*} \begin{aligned} &condition (1) &\\ equivalent\ if\ B - \smash{\left\{\Centerstack{\#\#\#}\right.} \, &condition (2) &\\ &condition (3) ...


2

Here's a mildly more complicated solution: the picture, with possible options, is given as a trailing optional argument to \chapter. It would be possible to use the standard \chapter syntax and define a \chapterfigure command that needs to be placed just before \chapter. \documentclass[a4paper]{book} \usepackage{xparse,graphicx,xpatch} ...


3

The 22pt was found by trial and error. It should represent the height of the font used for the title plus 1/2 the gap. For some reason \chapter didn't like \raisebox, hence the \savebox. \documentclass{book} \usepackage{graphicx} \usepackage{mwe} \newsavebox{\tempbox} \begin{document} ...


6

You have to measure the bigger picture. \documentclass[10pt, a4paper]{amsart} \usepackage{graphicx, subfig} \usepackage{graphics} \usepackage{tikz} \usepackage[all]{xy} \usetikzlibrary{arrows,automata} \usetikzlibrary{shapes,snakes} \usetikzlibrary{positioning} \newsavebox{\bigpicture} \newcommand{\adapttobigpicture}{% \vrule height\ht\bigpicture ...


2

Another alternative is use of package adjustbox and add valign=t (vertically align top) into the \includegraphic option. Remove [demo] from the graphicx package for true image Code \documentclass[12pt,twoside,openright,a4paper,oldfontcommands]{memoir} \usepackage{tabularx} \usepackage[pdftex,demo]{graphicx} % remove demo for true image ...


3

use \raisebox{\dimexpr-\height+2ex}{% \includegraphics[width=\marginparwidth]% {structureIconArtifactsProxyWorkload.pdf}}


0

As \raisetag doesn't seem to work properly here the align environment looks like a decent solution: \documentclass{article} \usepackage{mathtools} \begin{document} \begin{align} A = &\left( B \right. \notag \\ &\phantom{(} \left. + C \right) \end{align} \end{document}


1

I'd do something like this \documentclass{article} \usepackage{amsmath} \begin{document} \begin{align} A &= \Bigl( B \notag \\ &\phantom{= \Bigl(} + C \Bigr) \end{align} \end{document} or using split \documentclass{article} \usepackage{amsmath} \begin{document} \begin{equation} \begin{split} A &= \Bigl( B \\ ...


3

This space is controlled by arraystretch (not a length, but a multiplier which defaults to 1) times the depth of \strutbox. Observe that setting arraystretch to zero, \renewcommand*{\arraystretch}{0} removes the spacing. \number\dp\strutbox gives 285084 scaled points, and 285084/65536 is approximately 4.35 pt. Note also that the array package used by ...


4

The names ‘lim’ and ‘max’ should be at the same level as ‘f’; also the absolute value bars should be as high as necessary to cover the material inside them; what's before the opening bar is irrelevant as far as the absolute value is concerned. This is a case where \left and \right are plainly wrong, because they produce too large delimiters. I don't think ...


1

\documentclass{article} \usepackage{amsmath} \begin{document} You have: \[ \lim_{d \rightarrow \infty} \left [ \underset{a\leq x\leq b}{\mathrm{max}_p} \left | f(x) - m(x) \right | \right ] = 0 \] You say, that it is produced: \[ \lim_{d \rightarrow \infty} \left [ \max_{a\leq x\leq b} \left | f(x) - m(x) \right | \right ] = 0 \] You want: \[ \lim_{d ...


1

As egreg mentioned in comment, it does look wrong what you are trying to do (refering to the raised functions). The functions should stay vertically centered. But here is, how it is done: % arara: pdflatex \documentclass{article} \usepackage{mathtools} \begin{document} \[ \raisebox{.25\baselineskip}{$\displaystyle\lim_{d \rightarrow \infty}$} \Biggl[ ...


3

The following suggestions only work if you center both pictures. You can use the option trim axis left (or maybe trim axis right) for both tikzpictures: \begin{tikzpicture}[trim axis left] Code: \documentclass{scrartcl} \usepackage{pgfplots} \pgfplotsset{width=8cm,height=6cm} \begin{document} \begin{center} \begin{tikzpicture}[trim axis left] ...


3

Here's a solution that uses a TikZ picture instead of a tabular environment: \documentclass[border=4pt]{standalone} \usepackage{tikz} \usetikzlibrary{positioning} \makeatletter \def\aerow{0} \def\aehu{0.45cm*}%% horizontal unit for placement of circled nodes \newcommand\ae@parse@current@skill[2]{%% \xdef\aerow{\number\numexpr\aerow+1}%% ...


3

You have to use [t] for setting the vertical alignment; however, your tabular will be too wide. \documentclass[draft]{scrbook} \usepackage[pass,showframe]{geometry} % just to show the margins \usepackage{tabularx,calc} \usepackage[ruled,longend,german,algochapter]{algorithm2e} \usepackage{lipsum} \newenvironment{algotabularx} ...


4

\documentclass{scrbook} \usepackage{tabularx} \usepackage[ruled,longend,german,algochapter]{algorithm2e} \usepackage{lipsum} \begin{document} \begin{algorithm}[tbp] \SetKwInOut{Input}{Input} \SetKwInOut{Output}{Output} \LinesNumbered \caption[Description]{Description} ...


1

The command \smash does work, as long as it is within math mode, How would it operate in the formula, which in turn is within an itemize list, without overwriting the lines above it, unless it's within such environment. So, the comment above, by Menke, is partially correct, and I said partially, because its implementation to resolve the problem in your ...


4

Would this be close to wha you seek? This solution proposes keep your code with minor changes shown by % here and add a raisebox scheme to lower the text \raisebox{-1.5ex}[0ex][0ex]{\tiny\uppercase{#1}\hspace{-14ex}} Code %!TEX program = xelatex \documentclass[border=10pt]{standalone}%[a4paper]{article} \RequirePackage{pgffor} ...


5

I'd do something like this (also you had a lot of % where they were not needed \else% and a lot of % missing where they were needed (everywhere else:-) \documentclass[a4paper]{article} \RequirePackage{wasysym} \RequirePackage{graphicx} \newcommand{\dotrating}{% \ifnum\count0<\count2 % \newmoon \else \fullmoon ...


1

As usual, in my ignorant opinion, the dots are ugly and making the matrix unreadable even when you have the most basic companion structure in the state matrix. Here is something that is more appealing to my taste which emphasizes the shift operation; \documentclass{article} \begin{document} \[ \underbrace{\left( \begin{array}{c|ccc} \\0 ...


4

Curious. It turns out \ddots is slightly higher than other characters. I suggest \smash ing them in the first matrix: \documentclass[11pt]{article} \usepackage{mathtools} \begin{document} \begin{equation*} C \coloneqq \begin{pmatrix} 0 & 1 & 0 & \cdots & 0 \\ 0 & 0 & 1 & \cdots ...


2

The easiest way would be to replace the \ddots in row 4 by \cdots. I think, this makes more sense but maybe you need it this way. The problem is that the \ddots are higher than the expressions in row 4 of the second and third term. If you increase the height of these expressions as shown in my MWE below, the alignment will be fixed again. If you want to ...


8

You can use a \mathstrut to give the both subscripts the same height and depth: \documentclass{article} \begin{document} \begin{displaymath} \sum_{\mathstrut j=1}^m \sum_{\mathstrut \langle i,j \rangle} \end{displaymath} \end{document} A \strut is a vertical rule of zero width, so invisible, defined by latex each time a font is set, however these ...


5

It seems like LaTeX tries to keep a minimum distance between the summation symbol and the top of the lower limit symbol. Therefore you should correct the left side, as the right side is using bigger symbols in the limit. I just took the vertical size of the right side and added it to the left side. % arara: pdflatex \documentclass{article} ...


2

Here's a LaTeX solution: \documentclass{article} \usepackage{array,multirow} \newcommand*\blah{blah blah blah blah } \newcolumntype{z}[1]{>{\centering\arraybackslash}m{#1}}% a centered m-type column \renewcommand*\multirowsetup{\centering}% default is \raggedright \begin{document} \begin{tabular}{|z{2cm}|z{2cm}|m{.3\linewidth}|} \firsthline ...


2

You must count not the number of rows, but the number of lines in case of multiline cells, plus an adjustement corresponding to the number of \addlinespace commands and to the thickness of \midrules. However this is only theoretical. For instance, I chose not to put "granulate" in the middle of its multirow cell, but aligned with "Selective laser melting" ...


1

use \only<3>{Block 3a}% no following empty line! \onslide<4>{Block 3b} instead of \only. Then the vertical space of the invisible overlays is taken into account. An alternative is Block 2 \pause Block 3\only<3>{a}\only<4>{b}


0

The overlayarea-environment might do the trick \documentclass{beamer} \begin{document} \begin{frame} \onslide<1->{1} \onslide<2->{2} \begin{overlayarea}{\textwidth}{0.2\textheight} \only<3>{3a} \only<4>{3b} \end{overlayarea} \end{frame} \end{document}


5

Most asymmetric two column layouts are best handled by a list environment. This allows page breaking to occur naturally in the main flow without having to guess where to vsplit it. Although if there is a possibility of a page break happening in the first few rows you should need to work a bit harder to prevent that or the hanging parbox will overprint the ...


7

Using tcolorbox. This is breakable across pages and all the benefits of tikz and tcolorbox like borders, background colour etc can be exploited. \documentclass{article} \usepackage{xcolor} \usepackage{kantlipsum} \usepackage[many]{tcolorbox} %% splitbox--- \tcbuselibrary{skins,breakable} \newtcolorbox{splitbox}[1][]{ colback=white, left=0.5ex, ...


5

Is this something similar to what you'd like to get? \documentclass{article} \usepackage{microtype} \usepackage{kantlipsum} \begin{document} \kant[1] \newbox\mylongbox \setbox\mylongbox=\vbox{ \hsize=0.7\textwidth \kant[2-4] } \noindent\parbox[t]{0.2\textwidth}{% Blah blah blah, blah blah blah blah blah blah blah, Blah blah blah blah, }% ...


0

I think I got to a workaround; all that needs to be changed in the above MWE is that this code: \setbox\myvtopboxB=% \vtop{\hsize=0.7\textwidth \copy\myspltbox} % ... needs to be changed to this: \setbox\myvtopboxB=% \vtop{ \hsize=0.7\textwidth \hrule height 0pt width 0pt \copy\myspltbox } Basically, those rules are used since I ...


3

The problem is that [t] aligns to the first baseline ([b] to the last baseline) of the included paragraph, not the top of the content. The baseline of images lies on there lower edge, so [t] has basically no effect with two images. Lower the images to include the baseline on top or add an empty line above them (using e.g. \vskip 0pt) to make it work. ...


3

The listings way is to use aboveskip and belowskip which are initially set to \medskipamount: \begin{lstlisting}[aboveskip=-1.4\medskipamount] Code: \documentclass{article} \tracingonline1 \tracingoutput1 \tracingparagraphs1 \usepackage{lua-visual-debug} \usepackage{listings} \usepackage{unravel} \makeatletter % \def\rst{\gdef\everypar={\setbox \z@ ...


1

Well, I got to a manual workaround, which is to use \vspace{-1.2\baselineskip} right after the second {minipage} starts; the output is then: ... which, I guess, is what the [t] + [t] would have been expected to do. I used the unravel package to step through the critical sections, and compare those logs in meld; the problem seems to reduce to \everypar ...



Top 50 recent answers are included