Tag Info

New answers tagged

2

When you add figure to adjustbox options, you are declaring it as floating figure, then LaTeX places it as a floating object above text. If you want an image with a caption can use \captionof command form caption package. A possible solution could look like: \documentclass{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{float} ...


0

Maybe it is feasable for you to use a wrapfigure instead. Code taken from here: % arara: pdflatex \documentclass{article} \usepackage[ngerman]{babel} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage{microtype} \usepackage[demo]{graphicx} \usepackage{wrapfig} \usepackage{lipsum} \begin{document} \begin{itemize} \item ...


6

The problem you're experiencing is due to glue above/below a math display. If you remove the glue, the display is set consistently: \documentclass[a4paper, 11pt]{report} \pagestyle{empty} \usepackage[left = 2cm, right = 2cm, top = 3cm, bottom = 3cm]{geometry} \AtBeginDocument{% \setlength{\abovedisplayskip}{\dimexpr\abovedisplayskip} ...


2

Remove the \null\hfill that forms part of the printing of \@title. If my "arrange the first name and the family name among each other" you mean swap them around, then you should swap around the placement of \@firstname and \@familyname in the code. \documentclass[11pt,a4paper]{moderncv} \usepackage[utf8]{inputenc} \moderncvstyle{casual} ...


3

You could use cases environment for piecewise functions ... \documentclass{article} \usepackage{amsmath} \begin{document} \begin{align} M(x)& = \begin{cases} 2(2x),& x < 0.5,\\ 2(2 - 2x),& x > 0.5 \end{cases} \\ & = \begin{cases} 4x,& x < 0.5,\\ 4 - 4x,& x > 0.5 ...


2

Use the landscape package. Landscape mode will make you portrait. The headers will remain in their usual positions. Like this: \documentclass{article} \usepackage[a4paper,margin=1in,landscape]{geometry} \usepackage{pdflscape} \begin{document} Test (landscape page) \begin{landscape} Test (this is a portrait page) \end{landscape} \end{document}


1

A small proposition, in lack of more features. It will break the appearances of \section etc. in the ToC however. The date itself is used instead of a section number, but this date is not aligned so far. \documentclass{article} \usepackage{tocloft} \usepackage{xstring} \usepackage{xpatch} \addtolength{\cftsecnumwidth}{70pt} \makeatletter ...


3

I'm not sure why the flalign environment seems to have become very fashionable. Here are two solutions, based on the alignedat inner environment. Inside the equation* or flalign* environment (if you really want left alignment) I define a local abbreviation for the labels. If you have several of these constructions, move the command in the preamble, so ...


2

This gets (like some other answers) the proper math spacing and (unlike the other answers), gets the proper (right) alignment on the numbers, using tabular stacks. \documentclass{article} \usepackage{tabstackengine} \stackMath \setstacktabulargap{0pt} \begin{document} \[ \tabularCenterstack{rrcr}{ \textit{Angle}: & -45^{\circ} \le& \theta ...


1

Note the fl in flalign is for full length, not flush left. the fleqn option is intended to flush left math layouts: \documentclass[fleqn]{article} \usepackage{amsmath} \setlength\mathindent{0pt} \begin{document} left aligned equation: \begin{align*} {\begin{array}{c} \text{Something long}\\ {[\text{Something}_{\text{else}}]} \end{array}} &= ...


0

Just use a tabular: \documentclass{article} \usepackage{amsmath} \begin{document} \begin{equation*} \begin{tabular}{@{}r@{}} This is the first part\\ of a longer text \end{tabular} = \dfrac{\text{One rather long Thing}}{\text{Other Thing}} \end{equation*} \end{document}


2

This is the stackengine (by our fellow user Steven B. Segletes) version of linebreaking There are some macros, but for this purpose, \Centerstack seems to be quite useful. The optional argument contains the alignment character, r is used for right justified stacking. There is a \Vectorstack command for math content too. The vertical spacing between the ...


11

I would use alignat for multiple alignments. \documentclass{article} \usepackage{amsmath} \begin{document} \begin{alignat*}{2} \textit{Angle}: &\ & -45^{\circ} &\le \theta \le +45^{\circ} \\ \textit{Bins}: &\ & -135^{\circ} &< \theta < -45^{\circ} \\ \textit{Slant}: &\ & +45^{\circ} ...


4

You could use tabular or array instead of flalign*: \documentclass{article} \usepackage{array,amsmath} \begin{document} \begin{tabular}{r>{$}r<{$}*{4}{>{$}l<{$}}} \textit{Angle}: & -45^{\circ} & \le & \theta & \le & +45^{\circ} \\ \textit{Bins}: & -135^{\circ} & < & \theta & < & ...


3

You can enclose it in a \parbox. \documentclass{article} \usepackage{amsmath} \begin{document} \begin{flalign*} \text{\parbox{3cm}{This is the first part of a longer text}} = \dfrac{\text{One rather long Thing}}{\text{Other Thing}} \\ \end{flalign*} \end{document}


4

Try: \begin{flalign*} \textit{Angle}: && -45^{\circ} &\le \theta \le +45^{\circ} \\ \textit{Bins}: && -135^{\circ} &< \theta < -45^{\circ} \\ \textit{Slant}: && +45^{\circ} &< \theta < +135^{\circ} \\ \textit{Tilt}: && -180^{\circ} &\le \theta \le -135^{\circ} \ or\ ...


1

If I understand well what you need, then this is something like this: First of all you must decide the main macro design. You need a table (or \halign in my example) only because of first column can include texts with different width. The second column can include page numbers, there is no need of the third column. The second column is only specially ...


1

\documentclass[twoside]{scrbook} \usepackage{xtab} \usepackage{array} \newcommand\z[1]{\hspace*{\fill}{\rlap{\hspace{2\tabcolsep}#1}}} \begin{document} \begin{xtabular}{r p{10em} b{5em}} 11 may & Long multiline text. Long multiline text. Long multiline text. Long multiline text. Long multiline text.\z{10}&\mbox{} \\ \end{xtabular} ...


1

An alternative possibility with tikz-cd: \documentclass{article} \usepackage{amsmath,amssymb} \usepackage{tikz-cd} \newcommand{\numberset}[1]{\mathbb{#1}} \newcommand{\R}{\numberset{R}} \DeclareMathOperator{\im}{Im} % \Im is preempted \DeclareMathOperator{\su}{\mathfrak{su}} \DeclareMathOperator{\so}{\mathfrak{so}} \begin{document} \begin{equation} ...


3

How about using an array: \documentclass{article} \usepackage{amsmath,amsfonts} \begin{document} \[ \begin{array}{r*{7}{c}l} (\text{Im} H, [,]) & \rightarrow & \mathfrak{su}(2) & \rightarrow & \mathfrak{so}(3) & \rightarrow & \mathbb{R}^3 & \rightarrow & (\text{Im} H, \cdot) \\ i & \mapsto & ...


1

I think I may have found a solution: (based on this question and answer) % !TEX TS-program = xelatex \documentclass[showtrims]{memoir} \usepackage{tikz} \setstocksize{11in}{8.5in} \settrimmedsize{8.5in}{5.5in}{*} \settrims{1in}{1in} \setulmarginsandblock{1in}{1in}{*} \setlrmarginsandblock{1in}{.75in}{*} \checkandfixthelayout \newcounter{headeronpage} ...


2

If you add \fbox{This is the top line of text and I want it to go on a bit.} at the start of the first column, you can see that the image is perfectly aligned: So some adjustments are needed to make things 'look right': \documentclass{article} \usepackage[export]{adjustbox} \usepackage{multicol} \usepackage{lipsum} \begin{document} \hrule ...


0

A variant using makecell to have vertically centred cells with line breaks, and cellspace to have less tight vertical spacing between rows: \documentclass{article} \usepackage{array,booktabs} \usepackage{tabularx} \usepackage{ragged2e} \usepackage{hhline} \newcolumntype{x}[1] {>{\raggedright}m{#1}} \newcolumntype{z}[1] {>{\centering}m{#1}} ...


2

\Centering tries to be kind and avoids redefining \\ so \\ is safe to use in the first column but not the second. this just tells \Centering not to worry about the tabular version of \\. Unrelated, but don't use [h!]. \documentclass{article} \usepackage{array,booktabs} \usepackage{tabularx} \usepackage{ragged2e} \usepackage{hhline} \newcolumntype{x}[1] ...


1

If you \smash the image object, then you don't have to worry about it's height: \documentclass{article} \usepackage{todonotes} \begin{document} \centering \vspace*{\fill} Here is some vertically centered text \vspace*{\fill} \vspace*{-4cm} \missingfigure[figwidth=6cm,figheight=4cm]{Testing a long text string} \newpage \vspace*{\fill} Here is some ...


1

This is a variant of Ignasi's answer. It uses an experimental package based on forest. The advantage is that the lines are automatically numbered, the justifications are added as annotations with their nodes using the key just (no need for a separate tree) and the vertical spacing between lines which should be grouped together (as when listing assumptions) ...


1

Here is one way using the positioning library. It requires setting the offset explicitly. You might find using a \matrix as another viable approach. \documentclass[border=5pt]{standalone} \usepackage{tikz} \usetikzlibrary{positioning} \begin{document} \begin{tikzpicture} \draw [thick] (0,0) grid (5,5); \begin{scope}[node distance=4.1cm] ...


5

The \tempheight and \tempwidth went all wrong. With some fine tuning, we get this: \documentclass{report} \usepackage{mwe,subfig,calc} \newlength{\tempheight} \newlength{\tempwidth} \newcommand{\rowname}[1]% #1 = text {\rotatebox{90}{\makebox[\tempheight][c]{#1}}} \newcommand{\columnname}[1]% #1 = text {\makebox[\tempwidth][c]{#1}}% \begin{document} ...


0

Here's a demonstration of how the standard vertical alignment options work: \documentclass{article} \usepackage{tikz} \begin{document} \newcommand\demobox[1]{% \fbox{% \begin{minipage}[#1]{.25\textwidth} \tikz[baseline=(n.base)]{% \node (n) [inner sep=0pt, outer sep=0pt, text width=\linewidth] {Top}; \draw [red] (n.west |- ...


1

You should use split inside equation for this: \documentclass{article} \usepackage{amsmath} \begin{document} \begin{equation} \begin{split} \pi^{(1)}_{i j} ={}& -\frac{1}{4}\eta^{\lambda \sigma} ( \eta^{\mu \alpha}\eta^{\nu \beta} + \eta^{\mu \beta}\eta^{\nu \alpha} ) \biggl\{ \frac{1}{2}\delta_{\lambda 0}( \delta_{\mu i}\delta_{\nu j} + \delta_{\mu ...


1

You can add few {} and \phatoms to align. \documentclass{article} \usepackage{amsmath} \allowdisplaybreaks \begin{document} \begin{align} \pi^{(1)}_{i j} & = {}-\frac{1}{4}\eta^{\lambda \sigma} \left( \eta^{\mu \alpha}\eta^{\nu \beta} + \eta^{\mu \beta}\eta^{\nu \alpha} \right) \biggl\{ \frac{1}{2}\delta_{\lambda 0}( \delta_{\mu i}\delta_{\nu j} ...


0

The code with makecell package, is very simple: it allows for line breaks in the \makecell and thead commands. Note thdefault alignment is vertically and horizontally aligned. \documentclass{article} \usepackage{tabularx} \usepackage{makecell} \renewcommand\cellalign{lc} \begin{document} \begin{table}[h] \begin{tabularx}{\linewidth}{ m{4cm} X} ...


0

I wouldn't use \newline the way you did to create the larger cell to center in. I'd use three separate rows with multirow: \documentclass{article} \usepackage{tabularx} \usepackage{multirow} \begin{document} \begin{table}[h] \begin{tabularx}{\textwidth}{ m{4cm} X } & Derivations \\ \multirow{3}{4cm}{$v=v_0+at$} ...


0

One solution is to use \hfil to both sides of the equation \documentclass{article} \usepackage{tabularx} \begin{document} \begin{table}[h] \begin{tabularx}{\textwidth}{ m{4cm} X } & Derivations \\ \hfil$v=v_0+at$\hfil & test \newline test \newline test \\ \hfil$x=x_0+v_0t+┬Żat^2$\hfil & a\\ ...


0

Here is a solution. I'm using \quad to insert some space left and right of the names in the table. Without them, the table would align with the text borders. This is just a matter of taste. The \hfill pushes the tables to the left and right such that you don't have to specify an explicit width for the white space in the middle. \documentclass{article} ...


1

Use tabular \documentclass{article} \usepackage{lipsum} \begin{document} {\centering\LARGE\bfseries Certificate \par} \lipsum[1-2] \vfill \begin{tabular}[t]{l} Name\\ Designation\\ Address\\ Address\\ Address \end{tabular} \hfill \begin{tabular}[t]{l} Name\\ Designation\\ Address\\ Address\\ Address \end{tabular} ...


1

This could very conveniently be handled by left-aligned under-stacks. \documentclass{scrreprt} \usepackage{stackengine,lipsum} \setstackEOL{\cr} \def\stackalignment{l} \begin{document} \lipsum[1] \bigskip \noindent\Longunderstack{ [Name]\cr [Designation]\cr Address Line 1.,\cr Address Line 2.,\cr Address Line 3. } \hfill \Longunderstack{ [Name]\cr ...


2

If the tabular and image has roughly the same height, then align them at their baselines. By default, \includegraphics is aligned at the base, but tabular is aligned at the vertical centre. Using \begin{tabular}[b] would suffice as it changes the vertical centre alignment to be aligned with the last line's baseline... Other options include adding ...


1

This seems to do what you want, without \multicol or \varwidth. \documentclass{article} \usepackage[paperwidth=10cm,paperheight=5cm,showframe]{geometry} \begin{document} \noindent LABORE ET DOLORE \vfill \noindent\begin{minipage}[b]{\linewidth} \raggedleft LOREM IPSUM LOREM IPSUM \end{minipage}\strut \noindent\begin{tabular}{@{}l@{}l@{}} ...


1

TeX automatically does the right thing if the baseline of the top box is on its bottom baseline and that of the bottom box is on its top baseline. \documentclass{article} \usepackage{varwidth} \begin{document} \noindent \begin{minipage}[b]{\textwidth} LOREM IPSUM LOREM IPSUM \end{minipage} \noindent \begin{varwidth}[t]{\textwidth} LOREM IPSUM LOREM ...


1

Use a minipage with a height of \textheight, add a \vfill before caption. \documentclass[twocolumn]{article} \usepackage{lipsum} % for the MWE \usepackage{caption,graphicx} \begin{document} \begin{figure}[!p] %\smallskip %%if needed \begin{minipage}[t][\textheight]{\columnwidth} \centering \rule{\columnwidth}{0.9\textheight} % for the ...


1

You could give floatrow a roll: \documentclass[12pt]{article} \usepackage{caption,floatrow} \DeclareCaptionSubType[alph]{figure} \captionsetup[figure]{labelsep=colon} \captionsetup[subfigure]{labelformat=brace,labelsep=space,labelfont=bf} \floatsetup[subfigure]{capposition=bottom,heightadjust=all,valign=t} \begin{document} \begin{figure}[htp] ...



Top 50 recent answers are included