Skip to content

Instantly share code, notes, and snippets.

@t-makaro
Created August 14, 2018 00:18
Show Gist options
  • Save t-makaro/395f5adb688b45b6089d6d5c69c159b6 to your computer and use it in GitHub Desktop.
Save t-makaro/395f5adb688b45b6089d6d5c69c159b6 to your computer and use it in GitHub Desktop.
My template for physics lab reports
\documentclass[twocolumn, letterpaper, 10pt, twoside, draft]{article}
%\usepackage[english]{babel} % English language/hyphenation
\usepackage{amsmath,amsfonts,amsthm} % Math packages
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{pdfpages}
\usepackage{url}
\usepackage[hmarginratio=1:1,top=32mm,left=18mm,columnsep=20pt]{geometry} % Document margins
\usepackage{titlesec}
\usepackage{abstract}
\usepackage{booktabs} % Horizontal rules in tables
\usepackage{float} % Required for tables and figures in the multi-column environment - they need to be placed in specific locations with the [H] (e.g. \begin{table}[H])
\usepackage{paralist} % Used for the compactitem environment which makes bullet points with less space between them
\usepackage{enumitem} % \begin{itemize}[noitemsep]
\newcommand{\horrule}[1]{\rule{\linewidth}{#1}} % Create horizontal rule command with 1 argument of height
\usepackage{fancyhdr} % Headers and footers
\pagestyle{fancy} % All pages have headers and footers
\fancyhead{} % Blank out the default header
%\fancyfoot{} % Blank out the default footer
\titleformat{\section}{\large\normalfont\itshape}{\thesection}{}{}
\titlespacing{\section}{0pt}{4pt}{0pt}
\titleformat{\subsection}{\small\normalfont\bf}{\thesubsection}{}{}
\titleformat{\subsubsection}{\small\normalfont\bf}{\thesubsection}{}{}
\renewcommand{\abstractname}{} % clear the title
\renewcommand{\absnamepos}{empty} % originally center, stops loss of space
%----------------------------------------------------------------------------------------
% My Commands
%----------------------------------------------------------------------------------------
%\renewcommand{\arraystretch}{1.2}
\makeatletter
\g@addto@macro\@floatboxreset\centering
\makeatother
%----------------------------------------------------------------------------------------
% Blinds
%----------------------------------------------------------------------------------------
\usepackage{blindtext}
\usepackage{lipsum}
\newcommand{\abstractlipsum}{\lipsum[66]}
\newcommand{\blindtable}{
\begin{table}[H]
\caption{Experiment Conditions}
\begin{tabular}{lc} \toprule
Constant & Value \\ \midrule
number of segments & 10 \\
Resistance from series inductors & $25.5\Omega \pm 2\%$ \\
Inductance per segment & $1mH \pm 2\%$ \\
Capacitance per segment & $2.4\mu F \pm 2\%$ \\
$R_G$ & $163.4\Omega \pm 3.5\%$ \\ \bottomrule
\end{tabular}
\end{table}
}
%----------------------------------------------------------------------------------------
% Globals
%----------------------------------------------------------------------------------------
\newcommand{\coursenum}{num}
\newcommand{\thetitle}{Title}
\newcommand{\theday}{\today}
%----------------------------------------------------------------------------------------
\fancyhead[C]{University of University $\bullet$ \date{\theday} $\bullet$ Phys \coursenum} % Custom header text
%\fancyfoot[LE,RO]{\thepage} % Custom footer text
%----------------------------------------------------------------------------------------
% TITLE SECTION
%----------------------------------------------------------------------------------------
\title{\vspace{-10mm}\fontsize{25pt}{10pt}\selectfont\textbf{\thetitle}\vspace{-3mm}} % Article title
\author{
\large
{\textsc{Author}}\\[2mm]
}
\date{}
%----------------------------------------------------------------------------------------
\begin{document}
\twocolumn[
\begin{@twocolumnfalse}
\maketitle
\thispagestyle{fancy} % All pages have headers and footers
\vspace{-7mm}
\begin{abstract}
\abstractlipsum
\end{abstract}
\end{@twocolumnfalse}
]
\section*{Introduction}
\lipsum[7]
\section*{Theory}
\blindmathpaper
\section*{Apparatus}
The apparatus for this experiment consisted of:
\blindlist{compactitem}[5]
\begin{figure}[H]
\caption{Apparatus}
%\includegraphics[width=.5\textwidth]{images/apparatus.png}
\label{fig:Apparatus}
\end{figure}
\section*{Procedure}
The following steps were done in this lab.
\blindlist{compactenum}[10]
\section*{Data}
\blindtable
\section*{Results}
\lipsum[6]
\section*{Discussion}
\lipsum[40-43]
\begin{thebibliography}{1}
\bibitem{manual}
Physics \coursenum~Laboratory Manual,
Department of Physics and Astronomy, University of University, 2018.
\end{thebibliography}
% \newpage
% \onecolumn
% \includepdf[pages=-]{data/analysis.pdf}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment