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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to automate this:

enter image description here

I found this tip which provides the small caps (cool!) but not the bold first letter. The "bold first letter" answers I found were too convoluted for me to use them with what I already found. Can someone help me out?

\documentclass{article}
\providecommand\newthought[1]{%
   \addvspace{1.0\baselineskip plus 0.5ex minus 0.2ex}%
   \noindent\textsc{#1} % small caps text out
}
    \begin{document}

\newthought{\textbf{W}hat you see here} a new thought.

\end{document}
share|improve this question
    
The capital letter of a small cap font is the same as capital letter in normal font so the W is the same within sc or outside it. – Sigur Jan 19 at 23:52
up vote 7 down vote accepted

Or this? This allows you to pass a single argument rather than two. Unlike my original code, this makes an approximate adjustment for the loss of kerning when switching fonts (bold -> small-caps), based on David's suggestion.

\documentclass{article}% don't use minimal for examples
\newlength\ltempa
\newlength\ltempb
\newcommand\newthought[1]{%
   \addvspace{1.0\baselineskip plus 0.5ex minus 0.2ex}%
   \noindent\expandafter\formatnewthought#1\relax}
\def\formatnewthought#1#2\relax{%
  \settowidth\ltempa{\textsc{#1#2}}%
  \settowidth\ltempb{\textsc{#1\mbox{}#2}}%
  \addtolength\ltempa{-\ltempb}%
  \textbf{#1}\kern\ltempa\textsc{#2}%
}
\begin{document}

\newthought{What you see here} a new thought.

\end{document}

new thought in one

Here's a comparison of the current definition, with the kerning adjustment, and my original definition, which made no adjustment for kerning:

vacuum variations

share|improve this answer
    
I'm also not sure you want the \addvspace part. – cfr Jan 20 at 0:17
1  
yes , like that:-) – David Carlisle Jan 20 at 1:16

Is this what you want?

The command newthought now has 2 arguments and the 1st is the first letter to be typeset in bold.

\documentclass{minimal}
\providecommand\newthought[2]{%
   \addvspace{1.0\baselineskip plus 0.5ex minus 0.2ex}%
   \noindent\textbf{#1}\textsc{#2}% small caps text out
  %\noindent\textsc{\textbf{#1}#2}% prettier code
}
    \begin{document}

\newthought{W}{hat you see here} a new thought.

\end{document}

ps. I'm not sure you need the \addvspace part.

enter image description here

share|improve this answer
1  
Maybe worth noting that this loses kerning. (Inevitably.) – cfr Jan 20 at 0:02
1  
@cfr if you wanted to put the kerning back you could compare the width of \textsc{Wh} and \textsc{W\mbox{}h} and add a a kern of the difference (which ignores the difference between a bold and non-bold first letter, but still.) – David Carlisle Jan 20 at 0:37
    
@DavidCarlisle Thanks! You mean like this? (Below, not above, obviously.) – cfr Jan 20 at 1:10

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.