Page LayoutSeeking very simple, small, title

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
Singularity
Posts: 156
Joined: Sat Jan 22, 2011 9:55 pm

Seeking very simple, small, title

Post by Singularity »

I want a title on my document to say "Quiz 1", but I don't want a big fancy title. I tried reading about package titling and titlesec, but that was overly complicated, overkill, and didn't seem like it did what I want. How can I make a simple, centered, small vertical space title (maybe with the date of the quiz), which says "Quiz 1" above a few enumerated items? Attached is a maximum working environment (it's pretty small, so long as my students don't frequent this site). Note: I also tried \section, but that numbered the title.

Code: Select all

\documentclass[fleqn,reqno]{article}

\usepackage{titling}

\setlength{\parindent}{0pt}
\setlength{\parskip}{\baselineskip}

\title{Quiz 1}
\author{\vspace{-5ex}}
\date{\vspace{-5ex}}
\everymath{\displaystyle}

\begin{document}
\maketitle
\begin{enumerate}
	\item Translate the verbal phrase into an algebraic expression
	\begin{enumerate}
		\item Fifteen less than four times a number.
		\item Twenty-five percent of a restaurant bill.
		\item The amount of pennies in $d$ dollars.
		\item The average rate of speed when traveling $320$ miles in $t$ hours.
		\item The total bill for a meal that cost $C$ dollars if you plan on leaving a $15\%$ tip.
		\item The total hourly wage for an employee earning $\$11.65$ per hour plus $80$ cents for each unit produced.
	\end{enumerate}
	
	\item Solve the following percent equations
	\begin{enumerate}
		\item What is $300\%$ of $16$?
		\item $18$ is $2.4\%$ of what number?
		\item $900$ is what percent of $500$?
		\item $500$ is what percent of $900$?
	\end{enumerate}
	
	\item Write ``$45$ minutes to $2$ hours'' as a ratio.
\end{enumerate}

\end{document}
Also, can I add a little space between \items so my students can write big enough for me to read?

P.S. I realize this is a short quiz and vertical space is not a big deal, but there will be longer quizzes (I hope my students see that comment!).

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Seeking very simple, small, title

Post by Johannes_B »

Hi, here is an idea using exsheets by Clymens Niederberger. Have a look at it, it can do really fancy stuff. The exam-class could also be of interest to you.

Code: Select all

\documentclass[fleqn,reqno]{article}

\usepackage{exsheets}
\usepackage{enumitem}%adds fancy labels for lists
\usepackage{siunitx}% typesets units
\newcommand{\dollar}[1]{\SI{#1}[\$]{}}% short helper macro
\usepackage{etoolbox}
\apptocmd{\item}{\examspace{2em}}{}{}% appends the space to items
%\setlength{\parindent}{0pt}
%\setlength{\parskip}{\baselineskip}%You shouldn't do this, use
%the parskip-package instead
\usepackage{parskip} 

\everymath{\displaystyle}%This doesn't seem to be a good idea

\begin{document}
\begin{center} 
	\Large A short test
\end{center} 
\vspace{3em}
\begin{question}{7}
	Translate the verbal phrase into an algebraic expression
	\begin{enumerate}[label=\alph*)]
		\item Fifteen less than four times a number.
		\item Twenty-five percent of a restaurant bill.  
		\item The amount of pennies in $d$ dollars.  
		\item The average rate of speed when traveling $320$ 
			miles in $t$ hours.  
		\item The total bill for a meal that cost $C$ dollars if you
			plan on leaving a \SI{15}{\percent} tip.  
		\item The total hourly wage for an employee earning
			\SI[per-mode=symbol]{11.65}[\$]{\per\hour} plus $80$ cents for each unit produced.
		\item Earning \dollar{5} a day is not much. 
	\end{enumerate}
\end{question}
\begin{question}
Solve the following percent equations 
	\begin{enumerate}
		\item What is \SI{300}{\percent} of $16$?  
\item $18$ is $2.4 \%$ of what number?  
	%Please note the difference in spacing of the
	%percent-sign
\item $900$ is what percent of $500$?  
\item $500$ is what percent of $900$?
	\end{enumerate}
\end{question}
\begin{question}
	Write ``$45$ minutes to $2$ hours'' as a ratio.
\end{question}
	\end{document}
I am using some additional packages, for example siunitx to typeset units and etoolbox to append the vertical spacing to every item. Somehow this doesn't work on the last item of a list. I don't know the internal, maybe a more experienced user can give a hint.

Best regards
Johannes
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Seeking very simple, small, title

Post by localghost »

If you want a very compact title, there are several solutions which could replace the \maketitle command.
  • A simple {center} environment which has already been shown.
  • A box by \makebox with centered content.

    Code: Select all

    \noindent\makebox[\textwidth][c]{\Large\bfseries Quiz 1}
  • A centered line by the \centerline macro (not recommended).

    Code: Select all

    \centerline{\Large\bfseries Quiz 1}

Thorsten
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Seeking very simple, small, title

Post by cgnieder »

Johannes_B wrote:

Code: Select all

\usepackage{enumitem}%adds fancy labels for lists
...
\usepackage{etoolbox}
\apptocmd{\item}{\examspace{2em}}{}{}% appends the space to items
...
\begin{enumerate}[label=\alph*)]
...
\end{enumerate}
You can have this even easier with exsheets' subpackage tasks and its {tasks} environment:

Code: Select all

\documentclass[fleqn,reqno]{article}

\usepackage{exsheets}
\settasks{after-item-skip=2cm}

\usepackage{siunitx}% typesets units
\newcommand{\dollar}[1]{\SI{#1}[\$]{}}% short helper macro

\begin{document}

\begin{center}
  \Large A short test
\end{center}
\vspace{3em}

\begin{question}{7}
  Translate the verbal phrase into an algebraic expression
  \begin{tasks}
    \task Fifteen less than four times a number.
    \task Twenty-five percent of a restaurant bill.  
    \task The amount of pennies in $d$ dollars.  
    \task The average rate of speed when traveling $320$
      miles in $t$ hours.  
    \task The total bill for a meal that cost $C$ dollars if you
      plan on leaving a \SI{15}{\percent} tip.  
    \task The total hourly wage for an employee earning
      \SI[per-mode=symbol]{11.65}[\$]{\per\hour} plus $80$ cents for each unit
      produced.
    \task Earning \dollar{5} a day is not much.
  \end{tasks}
\end{question}

\begin{question}
  Solve the following percent equations
  \begin{tasks}
    \task What is \SI{300}{\percent} of $16$?
    \task $18$ is \SI{2.4}{\percent} of what number? 
    \task $900$ is what percent of $500$?  
    \task $500$ is what percent of $900$?
  \end{tasks}
\end{question}
\end{document}
Regards
site moderator & package author
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Seeking very simple, small, title

Post by Johannes_B »

I knew there had to be something there to do that.

Do you get a gap after the last task?

Code: Select all

    \documentclass[fleqn,reqno]{article}

    \usepackage{exsheets}
    \settasks{after-item-skip=2cm}

    \begin{document}

    \begin{question}{7}
    Translate the verbal phrase into an algebraic expression
    \begin{tasks}
    \task The total hourly wage for an employee earning
     plus $80$ cents for each unit
    produced.
    \task Earning  a day is not much.
    \end{tasks}
    \end{question}

    \begin{question}
    Solve the following percent equations
    \end{question}
    \end{document}
Btw: Your document is misseing the end ;- )

Best Regards
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Seeking very simple, small, title

Post by cgnieder »

Johannes_B wrote:Do you get a gap after the last task?
Oh, right... I'm not sure if it's a bug or a feature... I think I intended this behavior. Easy to solve, though:

Code: Select all

\documentclass[fleqn,reqno]{article}

\usepackage{exsheets}
\settasks{after-item-skip=2cm,after-skip=2cm}

\begin{document}

\begin{question}{7}
  Translate the verbal phrase into an algebraic expression
\begin{tasks}
  \task The total hourly wage for an employee earning
     plus $80$ cents for each unit produced.
  \task Earning  a day is not much.
\end{tasks}
\end{question}

\begin{question}
  Solve the following percent equations
\end{question}
\end{document}
Johannes_B wrote:Btw: Your document is misseing the end ;- )
Copy & Paste error... corrected, thanks.
site moderator & package author
Singularity
Posts: 156
Joined: Sat Jan 22, 2011 9:55 pm

Seeking very simple, small, title

Post by Singularity »

Thanks for all the suggestions. This is a lot to absorb all at once (and I had been getting some errors on some of the code). I have not read all the referenced documentation yet. A few questions:

1. Why can't I use the "\dollar" macro that was created in the "\SI per-mode=symbol"? I tried changing it to

Code: Select all

\item The total hourly wage for an employee earning \SI[per-mode=symbol]{\dollar{11.65}}{\per\hour} plus $80$ cents for each unit produced.
but was told that "TeX capacity exceeded.

2. Isn't "hour" abbreviated as "hr"? the "\SI{per-mode=symbol]" is using "h" for hour.

3. I also need to create simple drawings (e.g. squares, circles, boxes, cylinders, etc.) without taking me a lot of time. Where can I get that?

4. I would like to create number lines, with shading (for you math teachers, that is, solutions to linear inequalities), and will eventually want to create 2-d coordinate planes (aka xy-axes). Is there a library with that in it?

Thanks.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Seeking very simple, small, title

Post by localghost »

Questions 3 and 4 clearly go beyond the scope of this thread. Please open a new topic for each of them. After too much time without feedback (few days), the questions will be edited out.
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Seeking very simple, small, title

Post by Johannes_B »

Thorsten is right. Please read about minimal working examples. They make a problem understandable and one can easily test the solutions.

I created the \dollar-macro just for conveniece. It just can typeset what you saw, this is pretty "hard-coded". Have a look at the siunitx-manual for further information.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply