Tag Info

Hot answers tagged

8

The \hrule in the vertical material breaks the baselineskip-grid because it resets the internal \prevdepth register. But you can save the value of the register to a variable, print \hrule and restore this register. Then the baselineskip-grid can be kept. Normal behavior: Previous line \hrule % this rule is printed immediately below the line without ...


7

TeX inserts no interline glue before and after \hrule, so you have to teach it that you want to respect distances independently of ascenders and descenders. The simplest way is to use struts: \documentclass{article} \usepackage{enumitem} \newenvironment{category}[1] {\par\noindent\textbf{\strut#1\strut} \medskip % <-------- adjust here \hrule % ...


5

You can remove the descender-depth by using \raisebox. The following definition of \raisebox is contained in source2e.pdf: \raisebox{⟨distance⟩}[⟨height⟩][⟨depth⟩]{⟨box⟩} Raises ⟨box⟩ up by ⟨distance⟩ length (down if ⟨distance⟩ negative). Makes TeX think that the new box extends ⟨height⟩ above the line and ⟨depth⟩ below, for a total vertical length ...


4

It works if you add baseline=(current bounding box.north) to both tikzpicture environments. \documentclass{article} \usepackage{tikz} \usetikzlibrary{matrix} \usepackage{booktabs} \begin{document} \tikzset{align at top/.style={baseline=(current bounding box.north)}} \begin{figure} \centering \begin{tikzpicture}[baseline = (current bounding box.north)] ...


4

I am not sure if you are searching really for long side captions, but otherwise, this is a way using minipages for the main text and adjustbox package to have top aligned images: \documentclass[a4paper]{article} \usepackage[export]{adjustbox}% \usepackage{lipsum,graphicx} \parskip1em \def\capR#1#2{\includegraphics[width=.3\linewidth,valign=t]{#1}% ...


4

\documentclass[a4paper,10pt]{article} \usepackage[utf8]{inputenc} %%%%%% additional packages \usepackage{multicol,etoolbox} %%%%%% \setcounter{tocdepth}{2} %set depth of printed table of contets. \makeatletter \patchcmd{\l@section} {\hfil} {\leaders\hbox{\normalfont$\m@th\mkern \@dotsep mu\hbox{.}\mkern \@dotsep mu$}\hfill} {}{} ...


4

The first vertical space is smaller, equal or greater than the second depending where you measure. Adding \showoutput you see First is ....\glue 0.0 plus 1.0fill ....\glue 0.0 ....\glue(\parskip) 0.0 plus 1.0 ....\glue(\baselineskip) 6.05202 as the glue stretch order is fill this means that the second and third glue don't contribute so there is exactly ...


4

Use this definition for your abstract: \renewenvironment{abstract}{% \clearpage\small \null\vfil \begin{center}% {\bfseries \abstractname\vspace{-.5em}\vspace{0pt}}% \end{center}% \quotation } {\endquotation\vfil\null\clearpage} MWE: \documentclass[11pt,a4paper]{report} \renewenvironment{abstract}{% \clearpage\small ...


4

You are aligning the top line of the paragraph with the centre of the tabular. Use \begin{tabular}[t] so that the top line of the tabular is taken as the alignment point, which will then align with the top line of the paragraph in the first column.


4

You can do that with a simpler syntax if you use the makecellpackage, which allows for a common formatting, vertical/horizontal alignment and line breaks in cells introduced by the \makecell command. A small patch allows to have the vertical and horizontal alignment of the cell as an optional argument (default is cc – vertically and horizontally centred). In ...


3

Here's an approach using tabularx to get the full width table, which also shows how to combine several \multicolumns within a row. This addresses questions (1) and (3). \documentclass{article} \usepackage{array,booktabs,tabularx} \begin{document} \begin{table}[htp] \centering \footnotesize\setlength{\tabcolsep}{2.5pt} ...


3

You can make sure each display is in a box that is a multiple of \normalbaselineskp in vertical size, and ensure Tex doesn't add additional space around the box. \documentclass[12pt]{article} \usepackage[margin=0.25in]{geometry} \usepackage{array} \usepackage{calc} \usepackage{amsfonts,braket} \begin{document} \def\[#1\]{\endgraf {% ...


3

I would simply go the grid.sty way. Currently, It has three limitations (as per the package documentation): Enunciations (theorem, lemma etc) were not added in the package. Optional argument of floats (positioning of floats) are not currently supported. Footnotes are not aligned correctly But it still can give you much. Here is your example implemented ...


3

In this code I define a solutions environment, based on enumerate, but with the \item command patched with the help of the etoolbox package. I also changed some of the computation results, expressed in theinteger part fractionary part style with smaller fractions, either in the form, say, \tfrac{3}{4} or in the form \sfrac{3}{4} from the xfrac package: ...


3

Use adjustbox to get the right vertical alignment: \documentclass[12pt,a4paper]{article} \usepackage{amsmath,adjustbox} \newenvironment{Pbmatrix}[1][c] {\begin{adjustbox}{valign=#1}$\begin{bmatrix}} {\end{bmatrix}$\end{adjustbox}} \newcommand{\matt}[5]{ \begin{bmatrix} \begin{Pbmatrix}[b] 2+r & -1 \\ -1 & 2+r & -1 \\ & ...


3

You can use adjustbox package with export option. With this, you will get valin= as a key to \includegraphics. valign=c will do what you want. \documentclass{article} \usepackage[export]{adjustbox} \usepackage{array} \begin{document} \begin{table}[h] \centering \setlength{\extrarowheight}{1em} \begin{tabular}{c|l} \textbf{Verb} & \textbf{Example} ...


3

The rule is drawn at the baseline of text. Hence the lower line is at the baseline of the next line of text. So you have to lift the lower line by suitable amount. This may be done by \vspace or adding the depth to the \rule. \documentclass[12pt]{report} \begin{document} \rule{6cm}{0.4pt}Some\par \textbf{\large TITLE}\par%\vspace{-0.66\baselineskip} ...


3

With this, there is no space. But this is not the way to define a wrapper box. But since I don't know exactly what you want, I can't make it better. \documentclass[a4paper,twocolumn,12pt]{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[turkish]{babel} \usepackage[listings,skins,breakable]{tcolorbox} \usepackage[color]{changebar} ...


3

Here is an alternative view on the grouping, which might be of interest: \documentclass{article} \usepackage{mathtools,calc} \begin{document} \[ %\setlength{\jot}{.5\jot} Adjust to bring the equations closer vertically \begin{aligned} 1 + 1 + 1 &= 1 + \underbrace{1 + 1} \\ &= ...


3

As long as you are always grouping things on the right, you can make this work by making the right-hand side right-aligned (using an alignat environment), and then adding an appropriate amount of space on the right to get the alignment under the brace. This technique also works equally well for grouping on the left. \documentclass[a4paper]{article} ...


3

David is referring to the m-specifier in \newcolumntype{M}{>{\centering\arraybackslash}m{\dimexpr.096\linewidth-2\tabcolsep}} How about a layout like this: \documentclass[a4paper,10pt]{article} \usepackage{tabularx,booktabs,geometry} \geometry{textwidth=15cm} \begin{document} \noindent \footnotesize ...


3

I wouldn't use the m column type for this table. In its place, I would use a centered form of the X column provide (provided by the tabularx package), in part to let LaTeX handle the chores of determining column widths. Separately, I'd use the line-drawing macros of the booktabs package to get well-spaced horizontal lines; plus, I'd omit all vertical lines. ...


2

You can use array instead of aligned if this this what you require: \documentclass[a4paper]{article} \usepackage{amsmath} \begin{document} $$\begin{array}{rcc} 1 + 1 + 1 &= &1 + 1 + 1 \\ &= &\underbrace{1 + 2}\\ &=&3 \end{array}$$ \end{document}


2

As long as we add not too many one-cipher numbers, we can use the effect, that all ciphers have the same width. It gives a little bit more general solution, then the one of the predecessor. \documentclass[a4paper]{article} \usepackage{amsmath} \begin{document} \[ \begin{array}{r@{{}={}}c} 1 + 1 + 1 +1& 1 + 1+ \underbrace{1 + 1} \\ ...


2

You can following the same type of precedures discussed in Subcaption vertical alignment and Vertically align different size images in a figure* environment. That is, capture the size of the larger image, and use its height to adjust the vertical position of the smaller image. \documentclass{article} \usepackage{geometry,graphicx} ...


2

Here is a solution with some vertical padding. The cellspace package is done for that: it defines a minimal vertical spacing at the top and the bottom of cells in columns with a specifier prefixed with S. With the makecell package, you can have line breaks in cells, thus allowing for several aimges in a single cell: \documentclass{article} ...


2

Normally the figure is lower than the start of the text, although obviously the start of the document is an exception. So to align the top of the figure to the top of the text you will need to either raise the figure or lower the text by \baselineskip. One can force the wrapfigure to terminate using \WFclear, but you sill need to space down far enough to ...


2

Use ,baseline=(current bounding box.center) in the options of circuitikz \documentclass[11pt]{article} \usepackage[margin=1in]{geometry} \usepackage{graphicx} \usepackage[english]{babel} \usepackage{circuitikz} \usepackage{tikz} \usetikzlibrary{shapes.geometric, arrows} \begin{document} \begin{center} \begin{circuitikz}[american ...


2

The caption package -- at least if it's loaded with no other options than justification=centering (which is the default anyway) -- seems to be causing the penetration of the top margin by the first caption of the table* environment. A workable fix would appear to consist of loading the package with options skip=5pt and position=bottom as well (even though ...


2

I'd not vertically center the abstract: it appears to hang from nothing. However, here's a possible definition that leaves you a different choice: the optional argument to \begin{abstract} is a fraction for stating the relative distance from the top of the page. \documentclass[11pt,a4paper]{report} \renewenvironment{abstract}[1][1] {\clearpage ...



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