47

You can use the microtype package with it's letterspace=<value> option. Legal values are between -1000 and 1000, specified in thousandths of an em, with the value 0 keeping the text as it would normally appear. microtype provides the command \textls{<letterspaced text>} and the switch \lsstyle: \documentclass{scrartcl} \usepackage[letterspace=...


24

If you are using XeTeX or LuaTeX you can change the spacing with fontspec: \documentclass{article} \usepackage{fontspec} \defaultfontfeatures{LetterSpace=50} \setmainfont{Latin Modern Roman} \usepackage{lipsum} \begin{document} \lipsum[1] \end{document} But I’m really not sure if it’s a good idea to increase the letter spacing from a typographic and ...


23

I assume you are referring to the spacing between words (or inter-word spacing) when you reference "a line text". If the number of characters will always fit on the line, then the optional s-parameter for \makebox alignment inserts enough inter-word spacing stretch to fill the box. If the text is greater than the box width, an overfull \hbox warning is ...


22

The problem is that the digits are usually set with the same width, thus alignments in tables look nicer this way. However, the digit 1 is rather slim, thus it has large side bearings: \documentclass[12pt]{article} \pagestyle{empty} \setlength{\parindent}{0pt} \setlength{\fboxsep}{0pt} \setlength{\fboxrule}{.1pt} \begin{document} \Huge \fbox{1}\\ \...


18

(I rewrote this answer rather significantly after discussions with OP and after receiving very significant coding help from @EgorSkriptunoff) Here's a solution that doesn't pre-specify a list of all abbreviations for which thinspace should be inserted after interior periods (aka "full stops"). Instead, it sets up a pattern matching function to capture u.a., ...


16

You should look up what "optical sizing" of fonts entails. (Computer Modern is an example of a font family with optically sized letters at various font sizes.) Letters that are sized optically for \tiny are not ordinary letters reduced linearly by 50%, and they are not simply horizontally stretched either. Instead, they are individually re-drawn, with ...


15

You would have to modify the length registers that allow for stretch/shrink around math operators/relations, namely \medmuskip and \thickmuskip. Their defaults are 4.0mu plus 2.0mu minus 4.0mu and 5.0mu plus 5.0mu. So adding \setlength{\medmuskip}{1\medmuskip}% Formerly 4.0mu plus 2.0mu minus 4.0mu -> 4.0mu \setlength{\thickmuskip}{1\thickmuskip}% ...


15

Yes, that's a bug in microtype. Until the package is updated, a temporary fix would be to add \makeatletter\let\glb@currsize\@empty\makeatother after the \lsstyle and math inside a group, which forces the math fonts to be set up anew. EDIT: This has been fixed in microtype v2.6.


15

If you add \typeout{\the\font} \typeout{\the\fontdimen2\font} %space \typeout{\the\fontdimen3\font} %stretch \typeout{\the\fontdimen4\font} % shrink \typeout{\the\fontdimen7\font} % punct after \begin{document} then you will find pdftex \OT1/LinuxLibertineT-TLF/m/n/12 3.0pt 1.5pt 0.99959pt 0.5004pt xetex \TU/LinLibertine(0)/m/n/12 3.0pt 1.5pt 1.0pt ...


14

Quoting section 7 of the microtype manual: By default, each character will be spaced out by 100/1000em=0.1 em; this amount may be altered in the optional argument to \textls, using the \SetTracking command, or globally with the letterspace package option, with decreasing significance in this order. Based on \textls, you may define custom commands ...


14

spread as a command to a box instruction is built into tex (texbook, p.77): \documentclass{article} \begin{document} \hbox spread \linewidth{Here is some text.} \end{document}


14

Based on example 44 from the fontspec documentation: \documentclass{article} \usepackage{fontspec} \usepackage{libertine} \begin{document} \addfontfeature{LetterSpace=0.0} USE TRACKING FOR DISPLAY CAPS TEXT \addfontfeature{LetterSpace=2.0} USE TRACKING FOR DISPLAY CAPS TEXT \end{document} The documentation remarks: This functionality should not ...


13

if the text that you want to be "narrow" is just short phrases, and they don't need to be broken into lines, you can cheat, and use \scalebox from the graphicx package. for example: the narrowed portion was produced with \scalebox{.7}[1.0]{This text is narrowed.} you do need the optional [1.0] height, since you want to change the aspect ratio. it's not ...


13

As of March 2015, to my knowledge there's no reason not to use LetterSpace=... provided by fontspec. However, there's a couple of reasons to prefer the functional equivalent provided by microtype (\textls and \lsstyle). microtype's feature has been around for some 10 years now; it's tried and tested, and its benefits and limitations seem well documented. ...


13

Sure: \documentclass{article} \usepackage{lipsum} \newenvironment{stretchpars} {\par\setlength{\parfillskip}{0pt}} {\par} \begin{document} \lipsum[2] \begin{stretchpars} \lipsum[2] \end{stretchpars} \end{document}


13

Here's a simple solution to the problem. It uses the Lua callback process_input_buffer to scan each input line for one of the given abbreviations and insert a small space in there. For that action you only need to specify the abbreviation (table key) you want to replace with a spaced version (table value). That mechanism can, of course, be used to simply ...


11

try this: \documentclass{article} \begin{document} $\mathrm{A}' \quad \mathrm{X}' \quad \mathrm{A}\!' \quad \mathrm{A}\mkern-2mu' $ \end{document} the large gap between the A and the prime is because of the shape of the A. if you have\mathrm{X}' the spacing is much nicer. so "backing up" the prime is what is needed. a negative thinspace, \!, is too much, ...


10

If you're willing to insert a "hook" of sorts, the you can certainly pick up whether a period is followed by a number 1: \documentclass[12pt]{article} \makeatletter \def~{\nobreakspace\@ifnextchar1{\kern-.2em}{}} \makeatother \begin{document} \noindent The article appears in vol.~16 of the encyclopedia. \\ The article appears in vol.~26 of the encyclopedia. ...


10

If you use version 2.5 of the microtype package -- still in "late beta", but available online at http://tlcontrib.metatex.org/cgi-bin/package.cgi/action=view/id=608 -- you can use the letterspacing and tracking features of the package -- but not (yet) the kerning features; the latter are available only if the package is used with pdflatex. % !TEX TS-program ...


10

why don't you define a command for acronyms that puts the \@ in automatically? \newcommand{\acro}[1]{#1\@} this does, of course, assume that you don't want \frenchspacing to get rid of end-of-sentence spaces entirely. (the tugboat macros have a rather more elaborate definition that uses "large small caps" for acronyms. these are just regular caps stepped ...


10

It is better to use an enumerate list to do what you're doing. If you want to reproduce exactly the same output, load enumitem and use the following settings leftmargin=0pt,align=left,labelsep=10pt,itemindent=*,label={\bfseries\alph*.} MWE: \documentclass[a4 paper,11pt]{article} \usepackage{amsmath, amsfonts, amssymb, parskip, dsfont, amsthm, wasysym, ...


10

\documentclass{article} \usepackage{microtype} \begin{document} \noindent This is a rather short sentence that will not fill a line. {\raggedright \spaceskip 2\fontdimen2 \font This is a rather short sentence that will not fill a line. \spaceskip 1em \relax This is a rather short sentence that will not fill a line. } % Or from microtype: \noindent\...


10

You can adjust the way the end-of-line character ^^M is handled. We first make it active (change its category code to 13) and then define it to be \ignorespaces: \documentclass{article} \catcode`\^^M=\active\relax% Make end-of-line character active \let^^M\ignorespaces \begin{document} a b \end{document}


10

Here's an example that includes a file with the .eps extension for greater image quality. It's placed within a figure environment that allows us to properly place it and also add a caption (if needed). The space for the word oggetto is achieved with the description environment. Of course, you'll need to replace image_name with the name of your logo (in ....


9

By default, microtype will enable tracking for the fonts defined in the smallcaps set (see microtype.cfg), which includes all sc shape fonts, but not si, that is italic smallcaps. You should get what you want if you add the following to the preamble: \DeclareMicrotypeSet*{smallcapsi} { encoding = {OT1,T1,T2A,LY1,OT4,QX,T5,TS1,EU1,EU2}, shape = {...


9

It isn't clear from your question what effect you need other than setting \parindent and \parfillskip to zero to remove the white space at the start and end. I borrowed Stephen's text to make comparison easier, each version of the text is set 4 times, justified as normal, then again with no parfillskip and then trying again to be one line longer or shorter. ...


8

Using the soul package \documentclass{article} \usepackage{soul} \sodef\ugg{}{.4em plus 1fill}{1em plus 2 fill}{2em plus 2fill minus.1em} \begin{document} \noindent\ugg{one two three\\four five six} \end{document}


8

If you set columns=flexible then spaces are not stretched as much. Also you should allow breaking of lines, but only at whitespaces. Finally, it is best to tell listings that the language being set is Java: \documentclass{article} % source code listing \usepackage{listings} \usepackage{color} \usepackage{xcolor} \usepackage{caption} % citation style \...


8

Yes, @Robert beat me to it by a few seconds. Here is the version I had come up with in the mean time. Note, even if you use @Robert's answer, you still also need to modify your \SetTracking line as I've shown here to disable ligatures for shape si. \documentclass{scrbook} \usepackage{fontspec} \setmainfont[SmallCapsFeatures={Renderer=Basic}]{Minion Pro} \...


8

with Alegreya small caps are a family and not a shape and so the default settings of microtype don't affect them. You must activate tracking yourself: \documentclass{article} \usepackage[tracking = true, letterspace = 500]{microtype} \usepackage{Alegreya} % <- tracking does not work with small caps \DeclareMicrotypeSet*[tracking]{alegreyasc} { font = ...


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