Tag Info

Hot answers tagged

78

By general request (or something of the like at least), I made it an answer. The C++ FAQ mentions this specific problem: http://www.parashift.com/c++-faq-lite/misc-environmental-issues.html#faq-40.2. The two things they wish to provide are a better typesetting and prevention of line breaks, two possibilities are given: ...


31

Edit - using the new package: With the package fnpct now available just use \usepackage{fnpct} and make sure the punctuation marks follow the footnotes: \documentclass{article} % for demonstration purposes only: make the page small! \usepackage[ paperwidth=.5\textwidth, paperheight=15\baselineskip, margin=5pt, bottom=1.5cm]{geometry} ...


28

Adjusting font kerning If you need to adjust the kerning within a font, the short answers are: No, not from within TeX. Yes, if you're willing to create a virtual font. Yes, if you're able to edit the font with fontforge (OpenType fonts only, for use in XeTeX or LuaTeX). Yes, if you're using LuaTeX and OpenType fonts; see §11 of the fontspec manual: ...


25

A solution is to load MinionPro with the option loosequotes \usepackage[loosequotes]{MinionPro} MWE: \documentclass{book} \usepackage[OT1,T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[loosequotes]{MinionPro} \usepackage[british]{babel} \usepackage{microtype} \begin{document} Linné's naming scheme. {Linné'}s naming scheme. {{Linné}'}s naming ...


24

Personally, I like the look of C\texttt{++} the best. It's also very simple!


21

Here is a SVG path extracted from your picture by inkscape. The code: \documentclass[tikz]{standalone} \usetikzlibrary{svg.path,backgrounds} \begin{document} \begin{tikzpicture} \fill[red!30!black] svg[scale=.3pt] { m 322.4,45.2 c -0.8,0.8 -1.6,2.3 -1.6,3.3 0,0.9 -0.5,1.7 -1.1,1.7 -0.6,0 -1.9,1.8 -2.8,4 -0.9,2.2 -2.1,4 -2.6,4 -0.5,0 -1.6,1.6 ...


19

If you want to maintain the kern but still keep your math expressions logically pure of sentence punctuation, and practically available for use in a document class that uses different text and math fonts, you could add a hand correction after the math, but in practice I'm not sure you'd want to do this: \documentclass{article} ...


19

With LuaTeX, you can patch fonts on the fly in arbitrary ways: \documentclass{minimal} \usepackage{fontspec} \usepackage{luacode} \begin{luacode*} local function add_exclam_kern(fontdata) if fontdata then local chars = fontdata.characters if chars then local ch = chars[33] if ch then if not ch.kerns then ch.kerns = ...


19

There is a long article about the challenges and tradeoffs involved in rendering crisp fonts at low resolution for screen: The raster tragedy. It seems that dvipng does not do subpixel positioning (which is an advantage because it means the individual glyphs can be made sharper, by careful hinting as done by freetype if your version of dvipng has this ...


18

For Classic TeX using tfm files the kerning and ligature information is in the ligtable in the tfm file. That is a binary file but there is a human readable version of it "property list" format, and a tftopl utility to convert the file: On the command line (texlive version, other implementations may vary slightly) tftopl cmr10.tfm Produces a long list of ...


18

(Obligatory Bringhurst reference warning) Bringhurst has a few challenging comments about footnotes, including a mild "don't do that", but the relevant one for this question is (The Elements of Typographic Style, v3.2, pp68-69): 4.3.2 Check the weight and spacing of superscripts. ... "Superscripts frequently come at the ends of phrases or sentences. If ...


18

You can use microtype: \documentclass{article} \usepackage[kerning=true]{microtype} \SetExtraKerning {encoding = {OT1,T1,T2A,LY1,OT4,QX,T5,TS1,EU1,EU2}} % all text { \textemdash = {167,167} % thinspace = 1/6 em } \begin{document} Single hyphen in text mode: text-text, and in math mode: $a-b$. Double hyphen in text mode: text--text, ...


15

It is probably overkill, but I usually use siunitx. Here is an example \documentclass{article} \usepackage{siunitx} \sisetup{ group-four-digits = true, group-separator = {,} } \begin{document} I looked in my bank account and saw \SI{15}[\$]{M}! But then I woke up, and there was only \SI{457.34}[\$]{}. I cried a little, but then I got paid and there ...


14

TeX does not kern between two different fonts. The bold and plain variants are from a different font (cmr10, cmb10). LuaTeX kerns across { and }, so {why}, gets its kerning, but not (see point 1) {\bf why},. PDFTeX (and older) behave as Knuth's TeX which does not kern across groups.


14

A little guide to feature files With feature files you can define two types of operation in lookups: substitute (sub) glyphs by others and position (pos) glyphs. What is impossible, is to modify the letterforms or add missing glyphs. Also, wrong encoding can’t be corrected by feature files. The only thing one can do in this case is to a glyph by another ...


14

One way to shift your numerators in an italic context would be {\hss\tiny\kern\fontdimen\@ne\font#2\/\kern-\fontdimen\@ne\font\hss}\cr% Emit numerator [#2] as for safe ways of looking ahead and adding space or not, you might want to look at latex's definition of \DeclareTextFontCommand which defines \textit and friends to add italic correction at ...


14

The way that units are typeset in siunitx means that they are 'hidden' from any kerning: they are inside a box, which then has various math mode switches. That's required in order to be sure you can control the font weight (bold is tricky to deal with). As a result, you will have to kern such cases by hand. (As an aside, it's arguable that the units are ...


13

Define a special behavior for the slash: \documentclass{article} \usepackage{url} \makeatletter \def\Url@twoslashes{\mathchar`\/\@ifnextchar/{\kern-.2em}{}} \g@addto@macro\UrlSpecials{\do\/{\Url@twoslashes}} \makeatother \begin{document} \urlstyle{sf}\url{http://tex.stackexchange.com/4427} \bigskip \urlstyle{rm}\url{http://tex.stackexchange.com} ...


13

Whether the font is packaged as TTC or not is irrelevant to the issue here. Most (all?) Latin fonts shipped by Apple use AAT layout tables, not OpenType. Older versions of LuaTeX partially supported AAT rather accidentally; as egreg pointed out in his comment above, FontForge that is used as base for the LuaTeX font loader maps some AAT features to ...


13

EDITED to replace the "R" with a mirrored C and a manipulated mirrored integral sign. REEDITED to make the "V" a reflection of an \rmfamily "V". FINAL EDIT to make the top of the "T" a more accurate rendition. (3RD ATTEMPT) \documentclass{article} \usepackage{stackengine,graphicx,wasysym} \newsavebox\foobox \newcommand{\slantbox}[2][.5]{\mbox{% ...


13

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 ...


13

It's a bad bug indeed in the metrics for TeX Gyre Termes. Note that the same happens with the OpenType version. And also with newtxtext (that uses a different clone of Times New Roman) You can at least obviate to the problem by redefining \labelitemii: \documentclass{article} \usepackage{tgtermes} \renewcommand{\labelenumii}{(\theenumii\/)} % add the ...


13

The problem has a long history. It was brought up in 2011, as far as I know, with a message to the TeX Live mailing list; the thread went on also in the LuaTeX list. The problem is that LuaTeX doesn't add the italic correction in math mode after characters having category code 11. Indeed, in TeX Live 2011, the output from your code would be the same as you ...


13

The definitions from source2e (the listing of the LaTeX kernel): % the TeX logo \def\TeX{T\kern-.1667em\lower.5ex\hbox{E}\kern-.125emX\@} % the LaTeX logo \DeclareRobustCommand{\LaTeX}{L\kern-.36em% {\sbox\z@ T% \vbox to\ht\z@{\hbox{\check@mathfonts \fontsize\sf@size\z@ \math@fontsfalse\selectfont A}% \vss}% }% \kern-.15em% \TeX} % the LaTeX2e logo ...


13

\kern is a TeX primitive which awaits a dimension expression, while \widthof is a calc package function which only works in \setlength and friends. It requires internal box assignments, which are not allowed in a normal dimension expression. You can't therefore use \widthof and other things like this at positions where TeX dimension expressions are awaited. ...


13

At \scriptscriptstyle the output is not satisfying, but I don't think you need it. \documentclass{article} \usepackage{amsmath} \makeatletter \def\mov@rlay#1#2{\leavevmode\vtop{% \baselineskip\z@skip \lineskiplimit-\maxdimen \ialign{\hfil$\m@th#1##$\hfil\cr#2\crcr}}} \newcommand{\charfusion}[3][\mathord]{ #1{\ifx#1\mathop\vphantom{#2}\fi ...


12

It looks better with \lstset{flexiblecolumns=true}


12

kerning is not a "true-false" option. Its purpose is to add some kerning independently of the adjacent letters, for example to set the French semicolon that needs a space before it. However it's not working well: for example, the colon requires a normal interword space before and after it, and this space should stretch or shrink along with the other spaces ...


12

Three suggestions: See Why is \[ … \] preferable to $$? Define a macro/command if you're using something multiple times. It promotes consistency and would make your life much easier if you decide to change things later on, even just a little bit. For example, \itemmul{<mat1>}{<mat2>}. As reference, see Consistent typography. You can modify the ...


12

Microtype's kerning option is intended to set additional kerning around individual characters. You have to specify those characters and kerning amounts with a \SetExtraKerning command. It is not done automatically and there is no optical kerning (except in your own eyes when you make such a setting). The configuration file microtype.cfg does this for a few ...



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