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.

Consider the following minimal working example:

\documentclass[reqno]{article}
\usepackage{amsfonts, amsmath, amssymb, amsthm}
\usepackage[T1]{fontenc}

\renewcommand{\sfdefault}{cmbr}

\begin{document}

\begin{flushleft}
Author \\ \vspace{0.5em}
\hrule \vspace{1.5em}
\large{\sffamily{\itshape{Subtitle:}}} \\
\LARGE{\sffamily{\itshape{Title}}} \\
\end{flushleft} \vspace{10em}

Content.

\end{document}

I want to put a large number, say 1.01, next to the title block (title and subtitle). It should be the same height as the title block, in cmbright font, and have an adjustable amount of space between the number and the title block. Also, I just noticed that the title and subtitle aren't all the way flush left. Is there any way to fix this? Thanks a lot!

EDIT: The number should be to the LEFT of the title block... Sorry I forgot to mention that from the outset.

share|improve this question
    
Those sorts of things are specific to the document class. First, make sure there isn't already a document class that does what you want. If not, you can usually change anything by replacing one or more commands from the .cls file. –  John Kormylo Apr 18 at 13:44
1  
not really relevant to the question, but ... size commands like \Large don't take arguments, but affect everything that follows, and not all environments "clear" such commands at the end. in fact, all three commands affecting the font can be requested within the same group: {\LARGE \sffamily \itshape Title}. –  barbara beeton Apr 19 at 5:30

3 Answers 3

up vote 6 down vote accepted

I'd make a new command for this:

\documentclass{article}
\usepackage{graphicx}
\usepackage[T1]{fontenc}

\renewcommand{\sfdefault}{cmbr}

\newsavebox{\titleblockbox}
\newcommand{\titleblock}[5][2cm]{%
  % #1 = space, #2 = author, #3 = pretitle, #4 = title, #5 = number
  \begin{flushleft}
  \sffamily
  #2\\[0.5em]
  \hrule
  \vspace{1.5em}
  \sbox{\titleblockbox}{%
    \slshape\large
    \begin{tabular}[b]{@{}l@{}}
    #3\\[1ex]
    \LARGE#4
    \end{tabular}%
  }%
  \usebox{\titleblockbox}\hspace{#1}%
  \resizebox{!}{\ht\titleblockbox}{\huge#5}%
  \end{flushleft}
  \vspace{10em}
}
\begin{document}

\titleblock
  {Author}
  {Subtitle}
  {\negthinspace Title}
  {10.1}

Content.

\end{document}

The default spacing is 2cm, but it can be changed with an optional argument:

\titleblock[1cm]
  {Author}
  {Subtitle}
  {\negthinspace Title}
  {10.1}

would use only 1cm.

enter image description here

If you want to set the number to the left of the title block, here's how:

\documentclass{article}
\usepackage{graphicx}
\usepackage[T1]{fontenc}

\renewcommand{\sfdefault}{cmbr}

\newsavebox{\titleblockbox}
\newcommand{\titleblock}[5][2cm]{%
  % #1 = space, #2 = author, #3 = pretitle, #4 = title, #5 = number
  \begin{flushleft}
  \sffamily
  #2\\[0.5em]
  \hrule
  \vspace{1.5em}
  \sbox{\titleblockbox}{%
    \slshape\large
    \begin{tabular}[b]{@{}l@{}}
    #3\\[1ex]
    \LARGE#4
    \end{tabular}%
  }%
  \resizebox{!}{\ht\titleblockbox}{\huge#5}%
  \hspace{#1}%
  \usebox{\titleblockbox}%
  \end{flushleft}
  \vspace{10em}
}
\begin{document}

\titleblock
  {Author}
  {Subtitle}
  {\negthinspace Title}
  {10.1}

Content.

\end{document}

enter image description here

share|improve this answer
    
I'm not sure how to modify this code to put the title number on the left-hand side. I'll accept the answer if you change that. Thanks! –  fctaylor25 Apr 28 at 19:31
    
@fctaylor25 It's easy: just switch position of the two objects. Added, anyway. –  egreg Apr 28 at 21:30

The simplest way would be to resize the number using graphicx's \resizebox{<height>}{!}{<number>} to suit your needs (we \smash it to avoid any impact on the vertical alignment):

enter image description here

\documentclass{article}
\usepackage{graphicx}
\usepackage[T1]{fontenc}

\renewcommand{\sfdefault}{cmbr}

\begin{document}

\begin{flushleft}
Author \\ \vspace{0.5em}
\hrule \vspace{1.5em}
\large{\sffamily{\itshape{Subtitle:}}} \\
\LARGE{\sffamily{\itshape{Title}}} \hspace{5em} \smash{\resizebox{4\baselineskip}{!}{10.1}} \\
\end{flushleft} \vspace{10em}

Content.

\end{document}

The horizontal alignment of Title is correct according to the font. If you wish to adjust this ever-so-slightly, you could precede it with \hspace*{-0.2em}, say.


For the reverse:

enter image description here

\documentclass{article}
\usepackage{graphicx}
\usepackage[T1]{fontenc}

\renewcommand{\sfdefault}{cmbr}

\begin{document}

\begin{flushleft}
Author \\ \vspace{0.5em}
\hrule \vspace{1.5em}
\raisebox{.5\dimexpr\baselineskip-\height}[0pt]{\resizebox{7\baselineskip}{!}{10.1}} \hspace*{5em}
\begin{tabular}{@{}l}
  \large\sffamily\itshape{Subtitle:}\strut \\
  \LARGE\sffamily\itshape{Title}\strut
\end{tabular}
\end{flushleft} \vspace{10em}

Content.

\end{document}
share|improve this answer

enter image description here

\documentclass[margin=5mm]{standalone}
\usepackage{amsmath, amssymb}
\usepackage{tikz}

%===========
\begin{document}
%===========
%\MyHead   
\newcommand{\MyHead}[3]{\mathord{
\begin{tikzpicture}[baseline=0ex, font=\normalsize]
\node[scale=1, align=left] at (0,0) {Title: #1 \\  Subtitle: #2};
\node[scale=4.5, align=left] at (5,0) {#3};
\end{tikzpicture}
}}

$\MyHead{This is my Title}{This is my Subtitle}{10.1}$

%Optionally not in the math-mode, so without \mathord{} and $-signs

%===========
\end{document}
%===========
share|improve this answer

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.