Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

How can i make a new command that increases the space in between the letters. I do not want to use the already existing commands like \textsc, \Large or \footnotesize; and if it's possible I prefer a command with an argument ...

\documentclass[a4paper]{memoir}

\usepackage[italian]{babel}

\usepackage[T1]{fontenc}

\usepackage[babel=true,tracking=true]{microtype}

\SetTracking{ encoding = *}{ 400 }

\begin{document}

\textls{this is a test}

\end{document}

Is it possible recreate this setting in microtype with the new command? LetterSpace=40 WordSpace=2


Look at my answer and tell me if the commnet are rigth please. Thanks. whith this configuration i have the default letter spacing in all text and command, so no influence on any part of the document right?

\documentclass[a4paper]{memoir}

\usepackage[tracking=true]{microtype}

\newcommand{\textlsLarge}[1]{{\Large\textls[400]{#1}}}

\begin{document}

\textlsLarge{this is a test} % new spacing command that use the space specified in newcommand (400)

{\Large this is a test} % no influence on the large command 

\end{document}
share|improve this question
3  
Anthing wrong with microtypes \textls{<Some text>}? –  lockstep Aug 9 '12 at 17:04
    
@lockstep no but i want different command that make different spacing. LetterSpace=40 is equal to 400 in microtype? is possible to set also WordSpace= in microtype? –  FormlessCloud Aug 9 '12 at 17:13

1 Answer 1

up vote 7 down vote accepted

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 that letterspace to a smaller extent than the default setting, and also commands like \textlsLarge. Note that font size switching within paragraphs may lead to improper line spacing.

\documentclass[a4paper]{memoir}

\usepackage[tracking=true]{microtype}

\SetTracking[no ligatures = f]{encoding = *,shape = sc}{120}

\newcommand*{\textsomels}[1]{\textls[40]{#1}}

\newcommand{\textlsfootnotesize}[1]{{\footnotesize\textls[800]{#1}}}% Note additional group!

\newcommand{\textlsLarge}[1]{{\Large\textls[-100]{#1}}}% Note additional group!

\begin{document}

\textsc{this is a test}% uses letterspacing as specified in \SetTracking above (120)

\textls{this is a test}% uses default letterspacing of 100

\textsomels{this is a test} 

\textlsfootnotesize{this is a test}

\textlsLarge{this is a test}

\end{document}

enter image description here

share|improve this answer
    
Good ! how i can not influence the \textsc command but only the \textls command. For examples i have use the \textsc command in a part of document but i want in that case the default letter spacing... Thanks ! –  FormlessCloud Aug 9 '12 at 17:36
1  
\newcommand{\textlssc}[1]{\textls[120]{\textsc{#1}}} –  lockstep Aug 9 '12 at 17:50

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.