# Tag Info

19

With version 2.5 of the microtype package, available on CTAN since 13 March 2013, the simple answer to my question is "use microtype". Thanks, Herbert and Joseph, for telling me that this can be done with the microtype package. I did know that microtype can do margin kerning, but I had always thought that this is only about punctuation. In reality, one ...

18

This could be related to a bug with negative protrusion values that I reported a year ago and which is obviously still open. Which luatex version are you using?

17

microtype has an optional argument that you can allow to shift the characters more to the right, e.g. [factor=1300] \documentclass{article} \usepackage[T1]{fontenc} \usepackage{lmodern,picture} \usepackage{microtype} \textwidth=3.85cm \begin{document} \itshape\noindent\makebox(0,0){\put(\textwidth,-2cm){\line(0,-1){80}}}% This is a small text. If jam is ...

16

Your analysis is correct. A couple of years ago, the pdftex team has been discussing whether pdftex should indeed try harder. No clear conclusion transpired except that it would probably be too difficult to get it right in all cases, hence the issue was postponed for later consideration ... maybe too late for pdftex now, and to be passed on to luatex. ...

15

I'd regard this as a bug in csquotes. You can solve it by putting the following code into your preamble, but I can't say if this breaks other things. \makeatletter \def\csq@qclose@ii#1{% \ifdim\lastkern=\csq@omitmarker #1\csq@eqgroup \else \csq@addkern@close \ifodd\csq@qlevel \csq@thequote@oclose \let\csq@kernchar@i\csq@thequote@...

15

I don't think it is reasonable to expect a full list to be created and maintained here. I think it is better to explain how to figure out whether fonts have this support so that users can determine the current answer for a specific font for themselves. If nothing else, this will enable people to check whether an answer here is still correct. Thérèse is ...

12

You can change the default factor like this (5 is not a sensible value but shows the effect quite good: \documentclass[a4paper, 12pt, oneside, article]{memoir} \usepackage{fontspec} \defaultfontfeatures{Ligatures=TeX} \newfontfeature{Microtype}{protrusion=default;expansion=default;} \directlua{fonts.protrusions.setups.default.factor=5} \setmainfont[...

11

It is my understanding that margin kerning does work but that font expansion doesn't. This is one of the reasons why I'm currently using pdflatex and not XeLaTeX: OpenType support in XeTeX is very good because of the fontspec package, but XeTeX is not fully compatible with microtype. You don't explain why you need XeTeX, so I'll explain some possible ...

10

Personally, I think using the Latin Modern fonts with microtype seems to be a better approach \documentclass{article} \usepackage[T1]{fontenc} \usepackage{lmodern,microtype} \textwidth=3.85cm \begin{document} \it\noindent This is a small text. If jam is what you like, two fingers up, or whatever. Under certain conditions you see that the left and right ...

10

First, let us make it work with hyperref. hyperref redefines \@footnotemark itself, so instead of overwriting it, we just patch it with the etoolbox package. \usepackage{etoolbox} ... \makeatletter \newcommand*\new@makefnmark{\hbox{\@textsuperscript{\normalfont \microtypecontext{protrusion=footnote}\@thefnmark}}} \patchcmd{\@footnotemark} {\@...

10

This is indeed (as @yun suspected in his/her first comment to the question) again the bug in luatex with negative protrusion values. The relevant difference between version 2.4 and 2.5 of microtype is not in the package itself but in the configuration file for Latin Modern Roman, which now specifies also negative values for the italics font (which was ...

10

The definition of \thinspace is % latex.ltx, line 1315: \def\thinspace{\kern .16667em } so it's a kern; since it's not followed by glue it's not a feasible line break point. You probably want \hspace{.16667em} instead of it; then \allowbreak is not needed. On the other hand, \ignorespaces does nothing at all where you place it, because its only action ...

9

This is how you can extend or alter existing settings: Make sure that the settings you want to change are already loaded; in the preamble, this isn't guaranteed to be the case, so you need \LoadMicrotypeFile. Create new settings that load the default settings by way of the load key. If you want set protrusion for any glyph to zero, you explicitly have to ...

9

Let me first expand on the possible ways of how to specify characters in microtype's settings: For pdftex, the following input methods are allowed: a character (like A) within the (7-bit) ASCII range you may also use 8-bit (eg., Ä), and UTF-8 characters (eg., …), if the glyph is defined in the input encoding. to remain portable, you may use text ...

8

As @Thorsten mentioned, the problem is that microtype is unable to associate your protrusion settings properly with the footnote. This is because you only specify the font type via the incorrect size - \footnotesize in this case. The warning produced by pdfTeX is Package microtype Warning: I cannot find a protrusion list for font (microtype) ...

7

The point of hanging punctuation is not that you notice it, but rather that you don't notice it (as with most aspects of typography), i.e., the idea is to get the margin more uniform not to have letters stick out into the margin. As an example of use inthe TeX world: The LaTeX Companion makes use of it and you can examine a sample chapter at http://latex-...

7

The example in the TeXbook is obsolete since all current engines support margin kerning without any tricks. For plain XeTeX: \XeTeXprotrudechars=2 \font\rm="TeX Gyre Pagella"\relax \rm \rpcode\font\XeTeXcharglyph\hyphenchar\font=250 \hsize=20mm a a a a a a a a a abbabbabb aabbabbabb abbabb \bye \XeTeXprotrudechars=2 activates protrusion, the \rpcode line ...

7

You can try installing the current beta of the microtype package. Its support of XeTeX is incomplete but protrusion (and hence hanging hyphenation) already works and despite its beta status I haven’t (so far) experienced any difficulties with it.

7

This is indeed, as @egreg has said in the comments, by design (margin kerning is lost after \unhboxing or \unhcopying). But there are two commands that come as remedy: \leftmarginkern and \rightmarginkern allow access to the the respective kerns of an hbox. So to adapt your sample code, the following will reinsert margin kerning: \showboxdepth=20 \...

7

You can define a command that prints an emdash after a small kern (zero is not sufficient, but 1sp is the least nonzero length in TeX and goes unnoticed): \documentclass{article} \usepackage{etoolbox,microtype,showframe} \setlength{\textwidth}{7cm} \newrobustcmd{\npemdash}{% \mbox{\kern1sp ---}% } \begin{document} Let's push the emdash to the next ...

6

This is for lualatex: \documentclass{article} \usepackage{fontspec} \setmainfont[RawFeature={protrusion=default}]{TeX Gyre Pagella} \pdfprotrudechars2 % 1 if you don't want to change line breaking \begin{document} \input{knuth} \end{document}

6

This seems to be fixed in the current 0.80 release This is LuaTeX, Version beta-0.80.0 (TeX Live 2015) (rev 5238) restricted \write18 enabled. (./gg384.tex---- looking at table char 50 table: 0x60106f270 depth = 0 used = false width = 327681 expansion_factor = 333 ...

6

The sticking into the left margin of the second line comes from the character protrusion feature. Very likely package microtype is loaded. The protrusion of the first line is prevented by \begin{flushleft}, which adds an invisible empty box at the very beginning of the paragraph. This can be seen by \showlists with \showboxbreadth=\maxdimen\showboxdepth=\...

6

It is possible to temporarily disable microtype, here an example: \documentclass[12pt,oneside]{report} \usepackage{lmodern} \usepackage[T1]{fontenc} \usepackage[showframe]{geometry} \usepackage[activate,verbose=true]{microtype} \begin{document} \begingroup \microtypesetup{activate=false}% \noindent Disable protrusion from microtype for just one word ...

5

The inner code of \section prevents that the protrusion can work (it inserts a box with a skip and a \noindent). The \protrudeleft command from the question you linked to imho can't work here, as it implicitly assumes that it is used in vertical mode. You can get the protrusion with the following code. Attention This is not a "general" code. It assumes ...

5

I fiddled.... I have no idea what I am doing. If this breaks your document horribly, you get to keep all the itsy-bitsy pieces for yourself. I accept no responsibility if the code collaborates with your cat to order courier delivery of new tin-openers or dials out for pizza when bored. Caveat emptor... The basic problem, I think, is the definition of the ...

4

My bad, punctuation is not hanged at the beginning of a paragraph with an indentation, and this is normal. MWE : \documentclass{article} \usepackage{geometry} % Only for convinency, to show the margin. \geometry{a5paper,showframe} % Small paper, we show the frames. \usepackage{csquotes} % For the command \enquote, automatically in ...

4

I presently load microtype with protrusion adjustments as follows. Perhaps someone is interested in using my values, especially for Times (ptm), which imho has too much protrusion. Please note that my selection of adjustments is not an attempt at being exhaustive. \usepackage[verbose=silent]{microtype} \LoadMicrotypeFile{ptm} \SetProtrusion [ ...

4

See this question. The protrusion is only disabled for the first character of the paragraph, due to the \item (which is hidden in the case of quote and adjustwidth). The answers to that question give some possible solutions, or for simply increasing the margins you can use TeX primitives: {\leftskip 1em\rightskip 1em% `So'' the quotes to the left in this ...

4

I use LuaTeX for the most part, but fall back on XeTeX if a document requires bidi. Use TLContrib (see latex-alive.tumblr.com/post/1303450459 for concise instructions) to get the latest version of microtype. It supports protrusion in XeTeX, though not the other microtypographic features. Protrusion is already enough to fix the worst eyesores. And if you ...

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