Hot answers tagged

5

See edited answer at the end, with a cleaner and adaptative solution Quick, dirty, and very explicit, but it works : \documentclass{article} \usepackage{fourier} \usepackage{graphicx} \begin{document} \raisebox{0.325ex}{\resizebox{!}{1.2ex}{\danger}} dasdfcsdasda \end{document} of course, it need to be adapted according to the font you ...


5

Yes, the syntax is \begin{tabularx}{<width>}[<pos>]{<col spec>} % tabular content \end{tabularx} Here is you example: \documentclass{article} \usepackage{tabularx} \newenvironment{cheeselist} {\begin{enumerate}} {\end{enumerate}} \newenvironment{cheese} {\item \tabularx{\linewidth}[t]{l X}} {\endtabularx} \newcommand{\...


4

Beware that for resized X cells, the coefficients are like barycentric coordinates and their sum has to be equal to the columns number. Also, I managed horizontal rules meet vertical rules, and set all rules (vertical as well as horizontal rules but one) to have the width of \midrules, and I simplified your code. \documentclass[12pt]{article} \usepackage{...


4

Here's a solution that use an array environment, no TikZ. \documentclass{article} \usepackage{amsmath,graphicx,array} \begin{document} \begin{equation}\label{eqn:designRule} \renewcommand\arraystretch{1.33} \begin{array}{@{}c@{\hspace{\arraycolsep}}c|c@{}} & \text{$N$ Vars} & G \\[0.5ex] \rotatebox[origin=c]{90}{$M$ Rules} & \begin{...


4

Here a solution with tikz matrix library Code \documentclass{article} \usepackage{tikz} \usetikzlibrary{matrix,calc} \begin{document} \begin{equation} \begin{tikzpicture}[baseline=(current bounding box.center)] \matrix(M) [matrix of math nodes,left delimiter={[},right delimiter={]},nodes={minimum width=1cm}] { a_{11} & a_{12} & \cdots & a_{...


3

Solution of the strange text positioning via zref-savepos. Three LaTeX runs are needed, because the positions are recorded via the .aux file mechanism. \documentclass{article} \usepackage{lipsum} \usepackage{geometry} \geometry{hmargin=30.5mm, vmargin=26.5mm} \usepackage{zref-savepos} \newcommand*{\SpaceX}{30mm} \newcommand*{\SpaceY}{.5\paperheight} \...


3

A quick solution based on the package documentation for algorithm2e \documentclass{standalone} \usepackage{algorithm2e} \begin{document} \begin{algorithm}[H] \SetStartEndCondition{ }{}{}% \SetKwProg{Fn}{def}{\string:}{} \SetKwIF{If}{ElseIf}{Else}{if}{:}{elif}{else:}{}% \SetKwFunction{FnFoo}{foo} \DontPrintSemicolon \SetAlgoLined \Fn{\FnFoo{}}...


3

Here is a minimal example which compares your approach (the vertical fills, which are ok IMHO) with the approach I proposed in a comment (to put it all inside a tikz node which is drawn at the absolute center of the page). \documentclass{article} %\usepackage[showframe]{geometry} % uncomment to see the margins \usepackage{mwe} \usepackage{float} \usepackage{...


2

Perhaps something like this? \documentclass{article} \usepackage{multirow, rotating, graphicx} \usepackage{siunitx, makecell, bigstrut} \begin{document} \begin{center} \sisetup{table-format=2.2, output-decimal-marker={,}} \setcellgapes{2pt}\makegapedcells \begin{tabular}{r|c|r|r|l|c|l|S|l} \multicolumn{1}{c|}{$i$} & class & \multicolumn{1}{c|}{$...


2

Could any of you tell me ... why is it that I’m not seeing vertical column dividers in the first row except before "classes"? It's because of the \multicolumn{1}{c}{...} "wrappers"; if you want a vertical divider at the end of the column, write \multicolumn{1}{c|}{...}. For what it's worth, I would get rid of all vertical dividers. They aren't needed, and ...


2

Try \documentclass[12pt]{article} \usepackage{booktabs,tabularx} \renewcommand\tabularxcolumn[1]{m{#1}} \newcolumntype{Z}[0]{>{\centering\arraybackslash}X}% \newcolumntype{s}[0]{>{\hsize=.4\hsize}Z}% \newcolumntype{n}[0]{>{\hsize=.8\hsize}Z}% \begin{document} \begin{table} \begin{tabularx}{7cm}{s|Z|s|n} & really really really long ...


2

Uses my answer at pseudo code with vertical line, modified to make rules gray in color. \documentclass{article} \usepackage{xcolor} \def\lindent{.5ex} \def\rindent{2ex} \def\rthk{1.5pt} \newcommand\block[3]{\unskip% \noindent\parbox[b]{\textwidth}{\strut\ignorespaces#1\strut}\\ \setbox0=\hbox{\parbox[b]{\textwidth}{\strut\ignorespaces#2\strut}}% \...


2

AsI said in my comment,it is no clear wha you use \makecell{...}. Top left align is easy to achieve without it. If you still persist to use it, than you need to add option [tl] for top align and ragged text an right side: \makecell[tl]{...} MWE, which show result without use of makecell{..} (in the first row) and with it (second row) is: \documentclass{...


2

You want to use p (or b) columns for such a table not m as m loses baseline alignment. Also your specified widths made the table wider than the text width, so I reduced them a bit. \documentclass[a4paper,12pt,numbers=endperiod]{scrartcl} \usepackage[left=2.5cm,right=2.5cm,top=2.5cm,bottom=2cm,footskip=1cm]{geometry} \usepackage{graphicx} \usepackage{...


2

Instead of specifying a per-row spacing adjustment using \\[<len>], we can add a strut to each entry of a particular column. The strut could stretch vertically below and above the baseline in order to stretch the line spacing exactly as needed: \documentclass{article} \usepackage{array} \newcolumntype{M}[1]{>{\centering\arraybackslash}m{#1}} \...


2

Simpler, for some definition of simple. \documentclass{article} \usepackage{amsmath} \usepackage{graphicx} \usepackage{blkarray} \usepackage{lipsum} % just for the example \begin{document} \lipsum*[2] \[ \begin{blockarray}{ccccc|c} \smash{\makebox(0,0){\rotatebox{90}{$M$ Rules\hspace{6em}}}} & \BAmulticolumn{4}{c|}{N \text{ Vars}} & G \\ \begin{...


1

With version 3.93, you can use halign title to avoid \begin{center}...\end{center}, width= to avoid minipage and box align=top to force top box alignment: \documentclass[letterpaper,12pt]{article} \usepackage{tcolorbox} \pagestyle{empty} % \setlength{\topmargin}{0cm} \setlength{\textheight}{23.5cm} \setlength{\textwidth}{18.8cm} \setlength{\oddsidemargin}{...


1

The hyperref package puts the anchor above the list, hence the extra vertical space. If no anchor is needed, you can wrap the first \item in the list or the entire enumerate or the minipage environments in a NoHyper environment. The following MWE is with the enumerate wrapped in NoHyper: \documentclass{article} \usepackage{amsthm} \usepackage{fouriernc} \...


1

I think the problem is because hyperref packages redefines the macro and puts anchor for cross referencing. I would prefer the following code: \documentclass{article} \usepackage{amsthm} \usepackage{fouriernc} \usepackage[utf8]{vietnam} \usepackage{amsmath} \theoremstyle{definition} \newtheorem{thm}{}[section] \usepackage[unicode,bookmarksnumbered]{hyperref}...


1

Here is a solution. New command \chapalign with \newcommand{\chapalign}{\centering} is used \titleformat{\chapter}[display]% NEW {\fontfamily{ptm}\Large\bfseries\chapalign}{\chaptertitlename\ \thechapter}{20pt}{\huge}% NEW This command is redefined localy before table of contents \documentclass[10pt,a4paper,twoside]{book} \usepackage{mwe} \...


1

Desired vertical align of A,B,C,D and E with top of plots can be achieved with determine baseline of plots around top of their bounding box: In the code of MWE below \documentclass[]{article} \usepackage[margin=0.5in]{geometry} \usepackage{pgfplots} \usetikzlibrary{calc}% <-- new \tikzset{plotalign/.style = {baseline={([yshift=-1em] current bounding ...


1

You should drop the tikzpictures by their \height (or raise them by -\height) as well as a correction for the baseline skip which, under array, is stored in \normalbaselineskip. Since the tikzpicture has a little more whitespace around its border, we can increase this \normalbaselineskip to 1.5\normalbaselineskip: \documentclass{article} \usepackage[...


1

See, if the following solution satisfy your expectation: For above image I use \rule{0pt}{<height>} where the rule height calculation consider \textheight, height of both rows with images, height of text in caption and estimated vertical distance to which contribute row separation in tabularx, \abovecaptionskip and \belowcaptionskip (altogether ~3\...


1

To answer your question about badness, the macro \pagebreak[3] uses (effectively) \ifvmode \penalty -\@highpenalty% \else \@bsphack \vadjust{\penalty -\@highpenalty}% \@esphack \fi where \@highpenalty is a count register. A quick test run showed \the\csname @highpenalty\endcsname as 301.


1

The reason for this behaviour is that graphic files a laid on the base line of the row, hence they're bottom-aligned. To have them top-aligned with the row, use \raisebox{-\height}{\includegraphics[height=3.75cm]{03_Figures/05_fuzzy_distance_near.eps}} and similarly for all figures. To have them vertically centred, use \raisebox{-\height}{\...


1

You could typeset the whole table with S column specifier provided by siunitx and specify the format for the numbers in the optional argument with table-format. \documentclass{article} \usepackage{siunitx,booktabs} \begin{document} \begin{center} \sisetup{table-number-alignment = center , output-decimal-marker = {,}} \begin{tabular}{% @{}S[...


1

Using dcolumn also you can adjust the alignment. Now you are using siunitx package. See below code: \documentclass{article} \usepackage{dcolumn} \newcolumntype{d}[1]{D{.}{.}{#1}} \begin{document} \begin{center} \begin{tabular}{cccd{3.0}} \multicolumn{1}{c}{$C$} & \multicolumn{1}{c}{$M_i$} & \multicolumn{1}{c}{$m$} & \multicolumn{1}{c}...


1

Just replace the S in your tabular definition with r to align the contents of this column to the right. \documentclass{article} \begin{document} \begin{center} \begin{tabular}{cccr} \multicolumn{1}{c}{$C$} & \multicolumn{1}{c}{$M_i$} & \multicolumn{1}{c}{$m$} & \multicolumn{1}{c}{$G'_i$} \\ \hline 28,2 & 2 & 21 & 80 ...


1

You can use dcolumn package: \documentclass{article} \usepackage{dcolumn} \newcolumntype{d}[1]{D{,}{,}{#1}} \begin{document} \begin{tabular}{r|c|r|r|l|l|l|d{2,2}|l} \multicolumn{1}{c}{$i$} & classes & \multicolumn{1}{c}{$x_i$} & \multicolumn{1}{c}{$f_i$} & \multicolumn{1}{c}{$f_{ri}$} & \multicolumn{1}{c}{$\sum f_{ri}$} & \...


1

The basic error is that the \headheight length is too small, this leads to an overlapping at the top of the page header and the regular text. fancyhdr will issue a warning and some recommendation about correct values on the console and in the log file. Use \setlength{\headheight}{2cm} (or whatever appropiate value is reported by fancyhdr) or use \...



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