# Tag Info

62

After reading lockstep's and Lev's answers, here is my own take. It seems to me that there's 4 main factors that make a river bad: Its orientation: The straighter, the worse; Its width: the larger, the worse; The constancy of its width: the more constant, the worse; The length: the longer, the worse. From this, I guess I could try to improve the ...

54

Adding \usepackage{parskip} to the preamble of your document (the part between \documentclass{...} and \begin{document} will set the paragraphs to have no indentation and a bit of space between them. Note that this isn't a complete solution, because there may be elements in your document that you don't want this format to apply to (footnotes, for ...

47

I think to do it properly, you really need to take into account the shapes of the glyphs. Some glyphs, such as .,-' are very light. Others, such as ATVWvwLkbhdpq"lean" to the left or the right. I don't think the two rivers in this example could be spotted without taking into account glyph shapes: EDIT: To respond to Raphink's comment, here is the same ...

42

\par is a Tex primitive and is the same as a blank line (except in special environments such as verbatim where the usual rules don't apply). It ends horizontal mode, causes TeX to break the horizontal text into lines placed on the current vertical list, and exercises the page breaker which may possibly cause the next page to be shipped out. \\ is different ...

40

In addition to Werner's excellent answer I'd like to make some remarks. The indent after a section title (section is used here in a very broad sense, that is, anything with a title) is a question both of personal taste and of typographic tradition. Tschichold, for example, states that the first indent should be suppressed only after a centered title and ...

39

This is perhaps very subjective. The default for LaTeX is to have no indent after sectional headings, like \chapter and \section. The choice should be based on consistency. Do you want a paragraph indent after a sectional heading? Yes: Add \usepackage{indentfirst} to your document preamble. The minimalist indentfirst package sets the boolean ...

37

I have added a first version of an algorithm to detect rivers using Lua to the impnattypo package on github. To use it, simply use the rivers option: \usepackage[draft,rivers]{impnattypo} Here is an example result: Beware that there might still be some bugs ;-)

36

You can inhibit page breaks in the middle of paragraphs by saying in you preamble \widowpenalties 1 10000 \raggedbottom Without \raggedbottom (that the article class does automatically) the pages would be awful. The primitive \widowpenalties is an extension to the original TeX program, present in e-TeX based engines (pdftex, xetex and luatex). It ...

34

There are exactly 7 places in the TeX program where TeX executes the paragraph builder internally, i.e. turning a horizontal list (if there is one under construction) into a paragraph. This happens not by inserting a \par token into the input stream but by executing the procedure end_graf implemented in module §1096 in the TeX program. This procedure does ...

29

Here’s my attempt, using Xfig. I have simplified the shape a bit, to make it work better for shorter paragraphs. \def\coatpar#1{\shapepar{\coatshape}#1\par} \def\coatshape{% {25.1761}% {0.176056}b{0.176056}\\% {0.176056}t{0.176056}{50}\\% {1.05634}t{0.176056}{0.880282}st{1.05634}{49.1197}\\% {2.28873}t{0.176056}{0.352113}t{2.46479}{47.7113}\\% ...

26

Here's a list of other possible solutions A solution that admits page breaks using mdframed: \documentclass{article} \usepackage[framemethod=tikz]{mdframed} \usepackage{lipsum} \begin{document} \lipsum[4] \begin{mdframed}[hidealllines=true,backgroundcolor=blue!20] \lipsum[2] \end{mdframed} \lipsum[4] \end{document} The environments provided by the ...

25

The he-she package now does everything you need. (I have added a package option as the result of this question.) Let's first see how you would do this without automating (and why this is probably preferable.) Partial automation The he-she package implements two different sets of macros for pronouns: one set (\heshe, \himher, and \hisher) outputs a pronoun ...

25

You can avoid the paragraph indention for specific paragraphs with the \noindent macro. If you want to disable it globally you could use \setlength{\parindent}{0pt}. However, I would not recommend changing it globally in your case, because that's effectively changes the template, even if the actual file isn't modified.

24

It is correct behaviour and the reason is that you don't need to show with an indent that a paragraph starts here as everyone knows that after a section title a new paragraph starts. You can change this with indentfirst package.

23

Since you did not say which document class or bibliography packages you're using I will give you a general answer. A bibliography like this uses a numbered list. The paralist package provides such in-paragraph lists: you could use the inparaenum environment of paralist to get numbered items within a paragraph without linebreaks. For instance, with article ...

22

To expand a little on the answers already given: It is not merely a question of adding a new sort of penalty and having TeX magically optimize for the new penalty. The problem is that TeX's paragraph optimization algorithm utilizes the special structure of the problem given it: The problem is rephrased as a shortest path algorithm in a graph (whose nodes are ...

22

In addition to what Joseph said, No, it is not good style. If you want paragraphs without leading indentation, use the parskip package. You are better off in LaTeX marking up what things mean and letting the engine decide how they ought to look. So, in general, when you are tempted to stick in some fine-grained layout command, you ought have a second ...

22

You could use the adjustwidth environment from changepage package- a MWE follows. Note that adjustwidth environment deals with page breaks. The adjustwidth environment takes 2 arguments: the first is the indent from the left margin, and the second is the indent from the right margin. See the documentation for more details. \documentclass{report} ...

22

I suggest to assign a "badness" value to rivers according to the following definition/formula: A river occurs whenever two or more successive text lines feature white space that overlaps horizontally. (It seems that Raphink's detection algorithm adheres to this definition.) The "badness" of a river may be calculated as (overlap / word space ) * (no. of ...

20

The easiest method is to call \usepackage{indentfirst} in your preamble. This package is included in all LaTeX distributions. The standard setting of LaTeX is to suppress indentation in the first paragraph after a sectional title, which is standard usage in American typography. Some babel language settings do similarly to indentfirst, for instance the ...

20

According to The TeXbook, the rule for end-of-lines is as follows If TeX sees an end-of-line character (category 5), it throws away any other information that might remain on the current line. Then if TeX is in state N (new line), the end-of-line character is converted to the control sequence token \par (end of paragraph); if TeX is in state M ...

20

\newline does not start a new paragraph, it just forces a new line. So the result is very different: use two blank lines (or \par) for a paragraph, and \newline (or \\) when you want a new line. The later is rare but of course does happen (particularly in titles and so forth).

20

I would approach the answer to the question a bit differently (though it is essentially equiv to what David said): \par in LaTeX is equivalent to an empty line in the user document! Whatever the LaTeX gives as meaning to the "empty line" in a certain context is what \par would result to. Example given by David: in a tabular empty lines are ignored. But ...

19

Neither an empty line nor a \par token indicate the beginning of a new paragraph; they end an active paragraph and switch to unrestricted vertical mode (if the processor has been in unrestricted horizontal mode so far). To begin a new paragraph, either \indent, \noindent or a horizontal command has to be used—i.e., a command that forces TeX to switch to ...

18

Disclaimer: I am standing on the shoulders of giants (Werner and egreg), and probably interfering in their conversation... Bringhurst, in The Elements of Typographic Style, v2.3, pp39-40, dedicates over a page to this, with the usual insights one has come to expect. But he, like Tschichold and the Imprimerie Nationale, tends to be a bit prescriptive. The ...

18

I ran your code. (By the way, your not-so-minimal example doesn't compile unless the natbib and pagenote packages are loaded as well.) At least in the example you provide, there's indeed a problem of "overstretched inter-paragraph glue", confirming @Marco's guess. I can think of three solutions to this problem: You could issue the following command in your ...

18

If the routines are to be integrated with TeX or a TeX-like system optimization should preferably be done at the paragraph level to enable faster execution. Consider the text below given by Bishop in his post. The characteristics of the 'rivers' is an advancing front. If the x,y positions of the endings of words is known a line (not necessarily straight ...

18

David did beat me by a couple of minutes, but this version here does indentation as requested and is not producing overfull lines (within reason): \documentclass{article} \makeatletter % this defines myverbatim environment. to change name replace "myverbatim" in all places below (strctly speaing it is only necessary in some but ... :-) ...

17

LaTeX uses \everypar itself all over the place, to manage indentation (or not) after section headings, to preserve the paragraph shape of indented list structures, it is also reset in minipages and parboxes and tabular p columns so setting \everypar is tricky. Apart from the fact that the value can get over-written at any time section headings (as most ...

17

It depends whether the commands you are defining are ever going to be executed at a place where \par doesn't mean \endgraf. For example latex.ltx has \let\tabularnewline\\% \let\par\@empty so if you might want to be evaluated in the scope of those definitions you have to decide whether you want the current definition of \par or of \endgraf.

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