Tag Info

New answers tagged

1

The main problem is that changing line spacing insert vertical space (\vskip) for correction, which in most case is required, but in this specific case as not desirable space. The solution is to "compensate" this space. For example \ledrightnote{\singlespacing \vskip-2.1666\baselineskip\scriptsize I would like this sidenote to begin on the same line as ...


3

Define the first column to be a m column like \newcolumntype{O}{>{\small}m{1.6cm}} BTW, why you are using longtabu when just longtable would do the job? Also, there is no support to tabu package as claimed by its author. \documentclass[12pt,a4paper,BCOR5mm]{scrbook} \usepackage{booktabs} \usepackage{multirow} \usepackage{longtable} \usepackage{tabu} ...


3

The additional space forced between the lines seems problematic. It works better if you change \arraystretch instead. However, this causes the text in the left-most column to be overwritten by the colour of the next row. This can be avoided by setting the text in the next row with the number of rows passed to \multirow given as a negative, rather than ...


10

You can pass the [t] option to the class like \documentclass[t]{beamer} so that all frames are top aligned. If any frame needs to be center aligned then use \begin{frame}[c] (or [b] for bottom alignment) to that single frame. \documentclass[t]{beamer} \begin{document} \begin{frame} Some text \end{frame} \begin{frame} Again some more ...


0

As of LyX 2.1.0, put the cursor at the beginning of the frame (so your layout should say "Frame"), then go to Insert > Frame Options and put in 't'. For more information, please read the LyX Beamer guide under Help > Specific Manuals > Beamer Presentations.


1

pdfTeX in PDF mode provide \pdfsavepos, which stores the current position that can be written to the .aux file and used the next TeX run. Also XeTeX and LuaTeX provide this features. There are some limitations: XeTeX's right to left mode is somewhat broken. Graphics state changes, that do not use the pdfTeX interfaces (\pdfsetmatrix, \pdfsave, \pdfrestore) ...


5

Completely new update: % arara: pdflatex \documentclass{article} \usepackage{mathtools} \AtBeginDocument{\providecommand*\colonequiv{\vcentcolon\mspace{-1.2mu}\equiv}} \begin{document} \[A\colonequiv B\] %\[A\coloneqq B\] % for prove of consistency %\[A\coloneq B\] \end{document} Old version (I believe, misunderstood): Super hacky, but it works: ...


2

Note that in the following comparisons, I have filtered out perfect matches i.e. I only show lines where my output differs from yours. My results for the MWE case with TL 2015: report.cls 2014/09/29 v1.4h Standard LaTeX document class size10.clo 2014/09/29 v1.4h Standard LaTeX file (size option) multicol.sty 2015/03/31 v1.8m multicolumn ...


0

By nesting tables I can do essentially what I had in mind. Here is the code I came up with (simplified somewhat from the above) : \documentclass[11pt]{article} \usepackage{array} \newcolumntype{L}[1]{>{\raggedright\arraybackslash}m{#1}} \newcolumntype{C}[1]{>{\centering\arraybackslash}m{#1}} ...


2

Try to use: \newcommand{\especialidade}[1]{\tikzstyle{block} = [rectangle, fill=black, text width=0.2\columnwidth, text depth=0mm, text centered, text height=0.30cm, rounded corners] \begin{tikzpicture}[baseline=(init.base)] \node [block] (init) {\textcolor{white}{\textbf{#1}}}; \end{tikzpicture}} instead of your newcomand. Edit: The ...


1

The array package provides a m{} column specifier which is just like p{} except that, whereas p{} puts the cell contents in a top-aligned \parbox[t]{}{}, \m{} puts it in a centre-aligned \parbox[c]{}{}. For example: \documentclass{article} \usepackage{array} \begin{document} \begin{tabular}{p{.25\linewidth}cm{.25\linewidth}} this is a very long line ...


2

The math mode command \vcenter centers its material around the math axis: \documentclass{article} \usepackage{tikz} \begin{document} \listoffigures \begin{figure} \caption{% (% $\vcenter{\hbox{% \protect\tikz \protect\node [circle,draw=black,minimum width=1em]{};% }}$% )% } \end{figure} \end{document} The additional \hbox ...


0

I use this code: % on preamble \def\sign{\includegraphics[scale=.8]{fig-here}\\[-4ex]} % set up the value \def\myname{Euclides} \def\LocalData{City, \today} \begin{document} \begin{flushright}\LocalData\par\bigskip \begin{minipage}{6cm}\centering \sign\hrulefill\\\myname \end{minipage} \end{flushright} \end{document}


7

Give the node some (invisible) content and a name and use the base (or any other desired) anchor for baseline; you can also pass explicit lengths to baseline for finer control. The following example shows both options (I also set inner sep=0pt for the second example): \documentclass{article} \usepackage{tikz} \begin{document} \begin{figure} \caption{% ...


2

\documentclass[a4paper,twoside]{article} \usepackage{hhline} \begin{document} \begin{tabular}{|c||c|c|c|c|} \hhline{~----} \multicolumn{1}{c|}{} & 1 & 2 & 3 & 4\\ \hhline{-====} A & B & C & D & E\\ \hline \end{tabular} \end{document}


0

An alternative (a bit more complicated) solution: \documentclass[border=3mm, preview]{standalone} \usepackage{amsmath,amssymb} \usepackage{makecell,multirow}% added \begin{document} \begin{table} \begin{tabular}{ |p{2cm}|p{9cm}|} \hline \textbf{Heading 1} & \textbf{Heading 2} \\ \hline Foo & ...


1

Package multirow provides \multirow, which can be used to center/move material vertically. Here, it is a little overkill and the number of lines must be added manually, see the answer of Przemysław Scherwentk for a shorter solution using \vfil. \documentclass{article} \usepackage{multirow} \usepackage{pifont} \providecommand*{\checkmark}{\ding{51}} ...


1

\documentclass{article} \begin{document} \begin{table} \begin{tabular}{ | p{2cm} | p{9cm} |} \hline \textbf{Heading 1} & \textbf{Heading 2} \\ \hline Foo & Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et ...


2

Instead of manual spacing, one easy way to align the boxes is to use a tabular; the inter-column space can be controlled with \tabcolsep (default=6pt); another option is to use \phantom, as in the second example code below. You can use the optional argument for \\ as in \\[1cm] to increase the vertical separation between boxes. The code: ...


3

By adding a \strut to your definition, as noted in my comment, I think it takes care of things (at least for this MWE). \documentclass{article} \usepackage{amsmath,mathtools} \newcommand{\underin}[2]{ \ensuremath{\underset{\substack{ \rotatebox{90}{$\in$} \\ \mathclap{#1} }}{#2}} } \newcommand{\dunderin}[2]{ ...


4

The normal \tabcolsep is replaced between most columns by \@{...}. This is added to the right of the column and needs to be repeated in \multicolumn. Thus, the definition for \mc should be: \newcommand*\mc[1]{\multicolumn{3}{@{}c@{\mlrA}}{#1}} And \mc is used with one argument only. The last column ends with the normal \tabcolsep and \mc cannot be used, ...


3

If you want to increase the height of the rows, you should go via \renewcommand{\arraystretch}{<someFactor>}. % arara: xelatex \documentclass[12pt]{article} \usepackage[letterpaper, left=19mm, right=19mm, top=3.52cm, bottom=2.84cm, headheight=38.7pt]{geometry} \usepackage{setspace} \setstretch{1.15} \usepackage{booktabs} \usepackage{array} ...


0

Do you like to have something like this: I didn't measure height of the first row (it should be approximately 1cm), for other rows I understand that they haven't request for minimal height of 1cm. In code I use thead from the makecell package. With renewcommad I select boldface fonts for them, boldface fonts in the first column is determined by option of ...


2

You almost reach your goal :-). for centering blue colored cell you just need to use \multicolumn{2}{M{0.3\textwidth}}{....}. I allow myself to remove unnecessary code in your table. Also not use ``hhline˙package (I haven't installed it), anyway to my taste is nicer to use rules as defined in booktab package. \documentclass{article} ...


2

For me, M seems to work in \multicolumn or did I understand something wrong? % arara: pdflatex \documentclass{article} \usepackage{hhline} \usepackage{array,booktabs} \newcolumntype{M}[1]{>{\centering\arraybackslash}m{#1}} \usepackage[table]{xcolor} \usepackage{caption} % better spacing around the caption \begin{document} \setcounter{table}{1} ...


0

Just to summarize what was mentioned in the comments above and provide some comparison and comments on accuracy and simplicity. Additionally, I suggest a fourth approach with \parboxes with high accuracy. All the approaches below use only LaTeX macros, but other primitive methods can be used. \documentclass{article} \setlength{\parindent}{0in} ...


1

All you have to do is to add t (top alignment) for the \parbox: The code (I also used the >{...} syntax to simplify a little the code, but this is optional): \documentclass[12pt,a4paper]{article} \usepackage{tabularx} \usepackage{booktabs} \usepackage{enumitem} \usepackage{ragged2e} \usepackage[utf8]{inputenc} \newlist{myQuoteEnumerate}{enumerate}{1} ...


1

Do you want something like this? This uses the baseline key with the value (current bounding box.center) to align the centres of the pictures with the current baseline. \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture}[ tlabel/.style={pos=0.4,right=-1pt}, baseline=(current bounding box.center) ] ...


0

changed the jpeg to png images.. thanks @yo'


3

I don't think that you are doing anything wrong; the positioning of text in fitting nodes requires special care. The following variation on your code shows that, for fitting nodes, the text is not vertically placed in the center anchor of the node: \documentclass[10pt]{article} \usepackage{tikz} \usetikzlibrary{fit} \begin{document} \begin{tikzpicture} ...


0

You can totally get rid of the figure environment and have full control, but you will be also totally responsible for the final output. Here is an implementation with the \captionof command from the caption package that will enable you of using the largest possible space horizontally and vertically. tabularx will still be very useful. ...


1

Another possibilities is to put pictures in table instead use minipages: \documentclass{article} \usepackage{graphicx} \usepackage{showframe} % just for demo \usepackage{tabularx} % added package \usepackage{caption} \begin{document} \begin{figure}[p] \setlength{\tabcolsep}{2pt}% reduce space between columns in table ...


2

As your minipages are bigger than half of the page, they will need some more place on both sides of the text. Just put every two minipages in a \makebox for this. (Not my recommendation. Try to fit everything in your margins as this will look more consistent over your whole report.) For vertical centring, just use the [p] specifier of your figure. If you ...


1

This answer is a long time coming, but the solution is simple: there is a patched version of cgloss4e (which is the glossing macros part of gb4e) written by Alexis Dimitriadis, and available on his website (not on CTAN, unfortunately). It is called and can be used as a drop-in replacement. It also has some other niceties. You can get it here. I use it in all ...


0

It seems I can solve my problem in a satisfying way by putting in the preamble: \AtBeginDocument { \setlength\abovedisplayskip{.4\baselineskip} \setlength\abovedisplayshortskip{.4\baselineskip} \setlength\belowdisplayskip{.3\baselineskip} \setlength\belowdisplayshortskip{.3\baselineskip} } \raggedbottom Of course the actual sizes are just a matter of ...


0

Use only m-type columns and remove unnecessary blank lines. Mixing the m and p column types can give inconsistent results. \documentclass{article} \usepackage{longtable} \usepackage{array} \usepackage{hyperref} \begin{document} \begin{Form} \begin{longtable}{|>{\raggedright}m{5cm} >{\centering}m{2.5cm} >{\raggedright\arraybackslash}m{5cm}|} ...


1

Two 'equivalent' ways, effectively \documentclass[12pt]{article} \usepackage{mathtools} \begin{document} \begin{alignat*}{3} a &= b + 1 &{}= c + 2 &= d + 3 \\ \shortintertext{The quick brown fox jumps over the lazy dogs.} a &= b \end{alignat*} \begin{align*} a &= b + 1 = c + 2 = d + 3 \\ \shortintertext{The quick ...


3

A trial solution, since I don't know the first column should be aligned really: \documentclass[a4paper,10pt]{article} \usepackage[top=2cm,bottom=2cm,right=2cm,left=3cm]{geometry} \geometry{a4paper} \usepackage{array} \usepackage{tabularx} \usepackage{ragged2e} \usepackage{multirow} \usepackage{makecell} \newcolumntype{R}[1]{>{\RaggedLeft}p{#1}} ...


0

Add the adjustbox package to your preamble with the export option, and use \includegraphics[valign=c,..]{...} Here's a minimal example: \documentclass{article} \usepackage{subfig} \usepackage[export]{adjustbox} \newcommand{\includegraphicsmaybe}[2]{% \IfFileExists{#2} {\includegraphics[valign=c,width=#1]{#2}} ...


4

Also possible with tabulars: \documentclass[12pt]{article} \usepackage{array,enumitem,pgf,bbding} \begin{document} \begin{tabular}{m{.4\linewidth}m{.4\linewidth}} \begin{itemize}[label=\Square] \item 1 \item 2 \item 3 \item 4 \item 5 \item 6 \end{itemize} & \begin{pgfpicture} ...


7

You can use two side-by-side minipages: \documentclass{article} \usepackage{pgf} \usepackage{bbding} \usepackage{enumitem} \begin{document} \noindent \begin{minipage}{.5\textwidth} \begin{itemize}[label=\Square] \item 1 \item 2 \item 3 \item 4 \item 5 \item 6 \end{itemize} \end{minipage}% \begin{minipage}{.5\textwidth} \centering \begin{pgfpicture} ...


3

You can also anchor nodes on its baseline: \documentclass{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture}[every node/.style={above=2mm, anchor=base}] \draw[color=red](0,3)--(11,3); \draw (0.5,2.5)--(0.5,3) node {For Example:}; \draw (3,2.5)--(2.5,3) node {this looks}; \draw (5,2.5)--(5.5,3) node {not nice vertically aligned}; ...


0

It is due to the package enumitem. If you disable \usepackage{enumitem}, then the extra line disappears as it works in template.tex of moderncv.


2

Obvious your picture is to wide to be fit in text width. See comparison: As you can see, figures b and c overlap. What to do: 1. enlarge (locally text width for example with help of package changepage. With \adjustwidth}{<leftmargin>}{<rightmargin>} <your figures> \end{adjustwidth} redesign your second and third figures so, that ...



Top 50 recent answers are included