Hot answers tagged

11

I think you are just not taking account of sidebearings of the characters so the actual character widths used for centering include some white space. TeX has no information about the glyph shape, it can not tell what parts of a specified character width are black. \documentclass{article} \usepackage{stackengine} \begin{document} ...


6

This example should lift any doubt about what to measure; note that in the first two cases the hairlines are perfectly superimposed to each other, showing that there's no issue with \Shortstack. On the other hand, the difference you measured is less than 0.4pt, too small to be really noticeable: it depends on the bounding boxes of the characters. ...


5

Here is one suggestion with pmatrix. \documentclass{article} \usepackage{amsmath} \begin{document} \begin{equation} D_{i,t} = \begin{pmatrix} \ln(\text{Deal value}) \\ \text{Loan Maturity} \\ \text{Loan Type} \\ \text{Credit Rating of the Loan} \\ \text{Coupon Rate} \end{pmatrix} \end{equation} \end{document} If one wants to avoid the use of \text in ...


4

You should use amsmath and its align* environment. Please, note also other fixes: punctuation should be outside inline math formulas; the command \bf has been obsolete for several years and \mathbf should be preferred; \left. <terms> \right] for evaluation of integrals is better done with \Bigr] (or other size); with the \diff command, differentials ...


3

It is almost easier to construct the section title with the aid of titlesec's explicit option. This allows you to use #1 as the <title> of \section{<title>}: \documentclass{article} \usepackage{tikz} \usepackage[nobottomtitles*,explicit]{titlesec} \usepackage{lipsum} \titleformat{\section}[block] {\Large\bfseries} {} {0pt} ...


3

Why not just this? \documentclass{article} \newcommand{\listOfYears}[3]{% \begin{minipage}{0.08\textwidth} #1 \end{minipage}% \begin{minipage}{0.30\textwidth} #2 \end{minipage} \par \hspace*{.08\textwidth}% \begin{minipage}{0.30\textwidth} \textit{#3} \end{minipage} } \begin{document} \listOfYears{765}{235}{3098} \end{document} ...


3

If you know the longest entry, a solution may be as follows: \documentclass{article} \usepackage{amsmath} \begin{document} \newlength{\myjjj} \begin{equation*} \settowidth{\myjjj}{$jjjjjjjjj,$} %longest entry \begin{aligned} & a=\begin{cases} \makebox[\myjjj][l]{$bbbb,$}\ &\text{if}\ c\,;\\ dd,\ &\text{if}\ e\,;\\ fffff,\ ...


3

There is also filll, stronger than fill from \hfill: \documentclass[10pt]{beamer} \usepackage[utf8]{inputenc} \usepackage[T2A]{fontenc} \begin{document} \begin{frame} %\frametitle{Title \hfill\hfill\insertframenumber} \frametitle{Title \hspace{0pt plus 1filll}\insertframenumber} \end{frame} \end{document}


2

Since the environment myItem effectively starts with the center environment, anything written after \begin{myItem} deliberately is centered (unless shifted additionally). I suggest to use an (optional) argument for the description text, this way the description text will be given to \item #1 first and then the centering occurs. ...


1

The following myItem environment redefines \includegraphics to place the image centred. As such, you can place content before or after the image and they will be justified as set previously. \documentclass[twoside,openright,12pt]{report} \usepackage{graphicx} \newenvironment{myItem}{% \item% \let\oldincludegraphics\includegraphics ...



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