1

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}
  • 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 '16 at 23:52

2 Answers2

7

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

cfr
  • 198,882
2

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

Sigur
  • 37,330
  • 1
    Maybe worth noting that this loses kerning. (Inevitably.) – cfr Jan 20 '16 at 00: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 '16 at 00:37
  • @DavidCarlisle Thanks! You mean like this? (Below, not above, obviously.) – cfr Jan 20 '16 at 01:10