# Tag Info

25

It's important to remember that TeX doesn't build a page line by line, but paragraph by paragraph; this is a very importance difference from the behavior of most word processing programs. TeX applies various rules -- resulting in penalties or demerits if they're not satisfied -- to come up with an "overall best" appearance. TeX assigns penalties not only to ...

8

Avoiding line breaks in inline formulae For the first problem, it maybe requires a little rearranging/rephrasing. You can for example rephrase the previous sentence so it is a little longer and the formula (along with its introducing "Let") gets pushed into the next line. Another option, as suggested in the comments, is to turn the formula into a ...

6

A c column never linebreaks, changing it to p solves most of the cases but some lines are overfull if you use English hyphenation, so this inserts some extra hyphenation points. \documentclass[a4paper]{article} \usepackage[english]{babel} \usepackage[utf8]{inputenc} \usepackage{hhline} \makeatletter \def\x#1{\-#1\x} \def\xx{% \raggedright ...

6

Your question isn't very clear and lacks an example document, but this shows four different setting of teh text, standard justified, sloppy, ragged right and RaggedRight from the ragged2e package. As the text is so short it doesn't really show the differences well so I repeat the settings with a longer paragraph with the text repeated. It still doesn't ...

6

Add the following to your preamble: \emergencystretch=1em This allows for an additional line-breaking pass with the amount of "tolerable" white space per line increased by 1em. Alternatively, and as suggested by Ulrike Fischer, load the microtype package with the final package option to ensure that the microtypographic features are activated even when ...

5

I can't really explain the technical reason I think, but add a \par after the title. You also want to set the width of the minipage to \dimexpr\textwidth-2\fboxsep. This is because \fbox inserts some space between the frame and content. And finally, you need some % at the end of some lines, to avoid spurious spaces, see e.g. What is the use of percent signs ...

5

The whole TeX linebreaking mechanism is driven by minimising badness (demerits, which are penalties squared, more or less) over the paragraph. So at one level it is natural to be able to inject penalties of different strengths so that for example you can emulate the behaviour in math where a linebreak can happen at a relation with penalty by default 500 ...

4

To elaborate on Argos suggestion. In this case I'd use \begin{gather*} I = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}, \quad X = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}, \quad Y = \begin{pmatrix} 0 & \imath \\ -\imath & 0 \end{pmatrix}, \\ Z = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}, \quad H = ...

4

Adding \leavevmode also has the desired effect and looks reasonably clean. \documentclass{article} \begin{document} \begin{description} \item[Animals:]\leavevmode \begin{itemize} \item Dog \item Cat \item Fish \end{itemize} \item[Colors:]\leavevmode \begin{itemize} \item Red \item Green \item Blue \end{itemize} \end{description} ...

4

From TeX by Topic (section 19.1.4 The number of lines of a paragraph, p 178): Deviations from the optimal number of lines, that is, the number of lines stemming from the optimal way of breaking a paragraph into lines, can be forced by the user by means of the \looseness parameter. This parameter, which is reset every time the shape parameters are ...

4

use the ngerman shorthands, then you can use "" to define a break point without a hyphen: \documentclass[ngerman,english]{article} \usepackage{babel} \useshorthands{"} \addto\extrasenglish{\languageshorthands{ngerman}} \begin{document} I have a name (blabla\_rest) that contains \_ sign. What is the correct way to break it? blabla\_""(new line)rest ...

3

The insertion of an empty item seems to give a better vertical spacing. One can define a myitemize environment that includes this empty item; that will prevent typing it for each description item: \documentclass{article} \usepackage{enumitem} \newenvironment{myitemize}% {\begin{itemize}\item[]} {\end{itemize}} \begin{document} \begin{description}[style ...

3

\\ is used by the tabbing environment to break lines. Since you've issued it inside the environment foo, the environment is not ended before the linebreak and tabbing gets confused. That's the reason of the error forgotten \endgroup. If you let foo end before the linebreak, you don't get the error, as in following MWE: ...

3

You have several questions: Prevent line breaking between CJK characters. There is a \CJKglue between any two CJK characters, which is initially defined to be \hskip 0pt plus 0.08\baselineskip\relax to enable wrapping. You can redefine \CJKglue to be a empty macro to prevent wrapping. (Sorry again for Chinese document of xeCJK only.) Prevent line breaking ...

3

In my opinion, the best strategy is still marking the parts in English as such. However, if your English words are just a few, there are alternative approaches. With ucharclasses Define transitions to and from Latin characters. \documentclass[12pt]{article} \usepackage{polyglossia} \usepackage{ucharclasses} \usepackage{microtype} % better management of ...

3

If you load the babel package with the [ngerman] option -- I'm taking a wild guess here that your document's language is German... -- LaTeX should have no problem hyphenating the word "universeller". See the MWE (minimum working example) below, which uses the LuaLaTeX format just to be able to use the nifty showhyphens package to indicate all hyphenation ...

3

I have never seen any rules on this, but both of your examples are quite hard to read. I will just point out some thoughts about readability: a minus followed by a minus could be understood as a plus. When reading the whole formula (and not being used to such repetition like in Russia, as pointed out be egreg), I would read j sin z minus minus j sin z ...

3

\documentclass{standalone} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage[ngerman]{babel} \usepackage{multirow} \usepackage{booktabs} \begin{document} \small \begin{tabular}{lp{4cm}p{1.2cm}p{3.5cm}} \toprule \multirow{2}{*} & \multicolumn{3}{c}{Disability} \\ \cmidrule(r){2-4} & Regulatory Framework & ...

2

The file scrlttr2.cls defines the letter environment in the following way: \newenvironment{letter}[2][]{% \newpage \if@twoside\ifodd\c@page\else\thispagestyle{empty}\null\newpage\fi\fi \setcounter{page}{\@ne}% \setcounter{footnote}{0}% \interlinepenalty=200\@processto{#2}% \KOMAoptions{#1}% \@beginletterhook }{% ...

2

It isn't directly related to tables other than that is a large unbreakable box. The extra white space on page 2 is not inter-line space but inter-paragraph space. In the book class that is 0 but slightly stretchy. book class defaults to \flushbottom so it tries to bring the last line to the bottom of the page, and on that page the only stretch glue is the ...

2

Since you've noted in a comment that the semicolons are there to denote an "if ..." relationship, I would suggest that you display the material in two separate columns, with ; replaced with if at the start of the second column. Furthermore, since the same, fairly complicated expression occurs five times between the curly braces, I suggest you define it ...

2

At the end of a paragraph TeX removes white space via \unskip (usually a space by the last line end) and adds \parfillskip, usually 0.0pt plus 1fil, that fills the last line if necessary. Because you do not want to fill the last line, the following example sets \parfillskip to 0pt. I have replaced \hfill by two \hspace: The first \hspace{2em plus 1fill} ...

2

The empheqpackage (which loads mathtools and amsmath) lets put whatever you want on the left or on the right of a group of equations. So here is another solution, with the gather*environment: \documentclass[12pt,a4paper,bothsides]{article} \usepackage[utf8]{inputenc} \usepackage[showframe, nomarginpar]{geometry} \usepackage[overload]{empheq} ...

1

Another solution: \documentclass{article} \usepackage{geometry} \usepackage{mathtools} \DeclarePairedDelimiter{\abs}{\lvert}{\rvert} \begin{document} \begin{equation*} V_{i,j} = \begin{Bmatrix} \displaystyle (Q_{1}D_{i}^{d} + Q_{2}D_{i}^{o})W_{j}\ln{\mkern -7mu}\left(1 + \frac{G_{i,j}\abs{h_{i,j}}^{2}P_{i,j}}{\sigma_{i,j}^{2}}\right){\mkern ...

1

The url's in the bibliography are typeset with \harvardurl which is defined as \newcommand\harvardurl[1]{\textbf{URL:} \textit{#1}} As far as I can tell these are always preceeded by a \newline too. So one redefinition would be to box this up as a raggedright paragraph. I prefer to use the \RaggedRight command from the ragged2e package for this: ...

1

As the solution --- being explicit about the paper size --- suggests, it is likely there is a disconnect somewhere regarding the actual paper size ('letterpaper' vs 'a4paper'). The package geometry usually guesses well, but if it can't figure it out, it defaults to the dvips driver, which may have different defaults from what you are actually using. Adding ...

1

You can try and redefine the delimiter between the letters to allow a break. Unfortunately, that particular delimiter is not accessible via a macro, but hard-coded into the cite bibmacro. By default, biblatex does a \setunit{\addcomma}, but we can insert a \setunit{\addcomma\allowbreak}. The following is a copy of authoryear-comp.cbx's definition of cite ...

1

You could make the _ character active and define it to be \textunderscore in text mode, with a possible line break point after it, while keeping it to be the subscript character in math mode: \documentclass{article} \begingroup\lccode~=_ \lowercase{\endgroup \protected\def~{% \ifmmode \sb \else \nolinebreak\hspace{0pt}% allow ...

1

I don't think there is an absolulte answer to that. There are several options you could tweak, and there is no obvious limit in how much you could tweak for instace interword space before it would be ridiculous. That said, you can directly tell TeX that you would like a particular paragraph to be one line shorter with \looseness=-1 before the paragraph: ...

1

The other answer shows how to get the output you need so I'll just answer your question about \hyphenation An instruction such as \hyphenation{uni-ver-sel-ler} Never typesets anything, it is a declaration (normally in the document preamble) that tells TeX how to hyphenate that word, so that when you use universeller in the document hyphenation and line ...

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