Tag Info

New answers tagged

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


2

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


3

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


3

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


6

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


1

Another alternative is use of package adjustbox with export option. Here valign=t,c,b can go with the minipage location specifiers t,c,b Code \documentclass[10pt,mathserif,smaller,fleqn]{beamer} \usepackage{tikz} \usepackage[export]{adjustbox} \usepackage{multicol} \usepackage[utf8]{inputenc} \usetheme{Antibes} \setbeamertemplate{navigation symbols}{} ...


1

If the second column should be vertically centered to the picture you can use two m columns \begin{tabular}{>{\centering}m{0.5\textwidth}|m{0.4\textwidth}} Code: \documentclass[10pt,mathserif,smaller,fleqn]{beamer} \usepackage{tikz} \usepackage{multicol} \usepackage[utf8]{inputenc} \usetheme{Antibes} \setbeamertemplate{navigation symbols}{} ...


3

The adjustbox package is your friend; not only it allows to shift the images down, but it allows pad them so they won't touch the rules. \documentclass[12pt,a4paper,x11names,landscape]{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[spanish]{babel} \usepackage{caption} \usepackage{incgraph,graphicx,subcaption} ...


1

\documentclass[0.10pt,a4paper]{book} \usepackage[utf8x]{inputenc} \usepackage[a4paper]{geometry} \geometry{verbose} \setcounter{secnumdepth}{3} \setcounter{tocdepth}{3} \usepackage{amsmath} \usepackage{amssymb} \usepackage{shadow} \usepackage{tikz} \renewcommand{\baselinestretch}{1.0} % To make the linespacing in the document 1.5cm ...


4

I'll present two possible solutions. Don't close the center environment “Abuse” the gather* environment At the top is the rendering with your input. Note that I removed underlining, which is frowned upon by typographers. Instead of \textbf you can also use \textit. \documentclass{article} \usepackage{amsmath} \begin{document} ...


2

You can load the nccmath package. I tried, thinking of using its \useshortskip command and discovered that just loading it works. Note that it loads amsmath, so that you can load it instead of amsmath. It doesn't load mathtools (recommended extension of amsmath), though: \documentclass{article} \usepackage{mathtools} \usepackage{nccmath} \begin{document} ...


1

It's the center environment not playing well with gather*: \documentclass{article} \usepackage{amsmath} \begin{document} \begin{center} \underline{First set of identities.} \[x+x = x\] \end{center}% \begin{center} \underline{Second set.} \begin{gather*} 0+x = x, \quad x+0 = 0 \\ (x+y)+z = x+(y+z) \end{gather*} ...


4

\documentclass{article} \usepackage[labelfont=bf]{caption} \usepackage[demo]{graphicx} \begin{document} \begin{minipage}[b]{.4\linewidth} \centering \includegraphics[width=140pt]{test} \captionof{figure}{First image with very very very very very very very very long caption} \end{minipage} \hfill \begin{minipage}[b]{.5\linewidth} \centering ...


3

Adding a \leavevmode helps here: \documentclass{article} \usepackage{xcolor} \usepackage{listings} % fancy code listings \usepackage{caption} % fancy chapters for fancy code listings \captionsetup[lstlisting]{singlelinecheck=false, margin=0pt, font={sf,sl,footnotesize}} \lstset{% language=[ISO]C++, basicstyle=\ttfamily\footnotesize, ...


2

It seems sufficient to raise the header entries by .5\normalbaselineskip as both components of \diagbox is set using tabular. \documentclass{article} \usepackage{diagbox} \newcommand*\mc[1]{\multicolumn{1}{c}{#1}} \newcommand{\raisehdr}[1][.5\normalbaselineskip]{\raisebox{#1}} \begin{document} \begin{table} \centering \begin{tabular}{l | *{8}{c}} ...


10

You are perfectly correct in saying that eqnarray is not the right tool here. The amsmath package provides several environments for displayed equations with correct spacing. (Extra features are available from the mathtools package.) In your example align* is the relevant construct to use (remove the * if you want equation numbers): ...


2

\vspace{0pt} works in a p column because it's set in a \parbox. For an r column you can use adjustbox: \documentclass{article} \usepackage{adjustbox} \usepackage{pst-barcode} \usepackage[crop=off]{auto-pst-pdf} \begin{document} \begin{tabular*}{\textwidth}{@{}l @{\extracolsep{\fill}} r@{}} Title Text & \begin{adjustbox}{valign=t} ...


0

The vertical centering in the cells gets much better with help of the package booktabs. If you really need that many horizontal lines, you may uncomment the line commands after each line. If you want the text in the first column vertically centered, please rephrase your question. This wasn't that clear. The minus sign for numbers has to be typeset using ...


8

Package fancyhdr puts the elements of the footer into a \parbox[t]. At the beginning You are using \color{...}. It does not start a new paragraph, thus the first top element of the \parbox[t] is the color whatsit (\special). It is aligned with the base line of the other entries. A then goes below the color whatsit. Solution: The color whatsit should go into ...


2

I found a solution that works for both tex4ht and pdflatex to vertically align an image in a table cell. For pdf, I'll use m since it works with little extra effort. For tex4ht I had to resort to using \Css configuration after much trial and error. Then in the latex file, I check if I am running tex4ht or pdflatex and set things accordingly. Here is the ...


1

Here are two solutions – at least to produce a pdf. The first one uses the \makecell and \thead commands from the makecell package, the second one uses the \raisebox command and requires manual adjustment: \documentclass[11pt]{article} \usepackage{mwe} \usepackage{longtable} \usepackage{array, mathtools} \usepackage{multirow} ...


2

You can measure the items and then set the condition and rule name parts pretending they have no width: \documentclass{article} \usepackage{proof,environ,array} \newcommand\centerinfer[4]{% % #1=condition, #2=rule name, #3=lower, #4=upper \ifcenterinfermeasure $#1\ \vcenter{\infer{#3}{#4}}\ #2$% \else \llap{$#1$\ }\vcenter{\infer{#3}{#4}}\rlap{\ ...


1

Alignment without the proof package is possible with some "box manipulation" (phantoms and overlapping): \documentclass{article} \usepackage{amsmath} \begin{document} \[ \begin{array}{c} \phantom{\text{conditions}}\ \dfrac{\text{topA}}{\text{bottomA}}\ \rlap{\text{rule nameA}}\phantom{\text{rule name rule B}} \\ \\ \text{conditions}\ ...



Top 50 recent answers are included