Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
LaTeX stuff

Installing LaTeX + TeXstudio

  1. Grab MiKTeX 2.9 and install. It doesn't really matter whether you get the complete or basic system, as the basic system will download packages as needed.
  2. Grab TeXstudio and install.
  3. Fire up TeXstudio and hit Options -> Configure TexStudio.
  4. Under "Commands", change "Bibtex" from "bibtex %" to "bibtex8 %" (bibtex8 is later and greater and is needed for biblatex, which is better than bibtex for reference handling).
  5. Under "Quick Build", check "PdfLaTeX + Ldf Viewer". Not all LaTeX compilers were created equal, and Pdf is likely the format you'll want.
  6. If you're feeling adventurous, go to "Editor" and change the font family to "Consolas" :)

TeXstudio (and its parent TeXmaker) operate on the principle that you don't need any fancy project files getting in the way. Instead, it works on the concept of a 'master document'.

If you have no master document selected, TeXstudio will attempt to compile the current file when you hit any of the compilation buttons ("Quick Build", etc). This often isn't useful. Instead, right-click on your master file in the left-hand "structure" pane (the one that contains your \documentclass definition, etc) and set it as the master document. TeXstudio will now compile that file when you hit compile.

% == Bibs ==
% Only so texmakerx gives us auto-completion -- trick texmakerx into thinking that we're using bibtex, when we're not
\renewcommand{\bibliography}[1]{}
\bibliography{bibs.bib}
% Actual bibs stuff (biblatex)
\usepackage[sorting=none,backend=bibtex8]{biblatex}
\addbibresource{bibs.bib}
% Then at the bottom
%\addcontentsline{toc}{section}{References}
%\printbibliography
% == Page appearance ==
% Change paragraph style to no indent, spacing
\usepackage{parskip}
% Decent-sizes margins
\usepackage[a4paper]{geometry}
% == Extra environments ==
% For align
\usepackage{dsfont}
% == Extra characters ==
\usepackage{amsmath}
\usepackage{gensymb}
\usepackage{textcomp}
\usepackage{fixltx2e}
% == Hyperlinks ==
% Add hyperlinks to references, but make them black and un-bordered
\usepackage[colorlinks,citecolor=black,linkcolor=black,urlcolor=black,linktoc=all]{hyperref}
% Fixes a problem with hyperref pointing to floats
\usepackage[all]{hypcap} %MUST come after hyperref
% == Figures ==
% For graphics
\usepackage{graphicx}
% For sidewaysfigure, etc
\usepackage{rotfloat}
% Create H (HERE) specifier for floats
\usepackage{float}
\restylefloat{figure}
% Number figures as chapter.section.figurecount
\numberwithin{figure}{section}
% == Headers ==
% Set up the headers
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\lhead{Antony Male}
\chead{Revision x}
\rhead{\today}
\cfoot{\thepage}
% == Code Listings ==
\usepackage{listings}
\lstset{language=Matlab, breaklines=true, basicstyle=\footnotesize, frame=single, tabsize=3}
% == Misc ==
% For \todo, \missingfigure and \listoftodos
\usepackage{todonotes}

LaTeX Style Guide

Files and folders

  1. Each section should be placed inside its own file.
  2. Each chapter should be placed inside its own file, and should contain nothing but \chapter{}, and \includes for the sections.
  3. All figures for a chapter should be inside a figures/ folder

Writing

  1. Every sentence should be on its own line.
  2. Paragraphs should be separated by a single blank line.

Ignores

Please tell you CVS to ignore:

*.pdf *.aux *.bbl *.blg *.dvi *.synctex.gz *.log *.run.xml *.toc *-blx.bib *.bib.bak *.ps *.tdo *.tof *.out

Note that PDFs SHOULD NOT be committed.

We'll all have the capacity to generate them on demand, and they'll just mean lots and lots of conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment