Skip to content

Instantly share code, notes, and snippets.

@Opiprog
Last active December 17, 2015 22:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Opiprog/5685296 to your computer and use it in GitHub Desktop.
Save Opiprog/5685296 to your computer and use it in GitHub Desktop.
Useful LaTex codes
%%%%%%% (1) ADDING HQ IMAGES TO LatexPDF %%%%%%
% The best ways I have found are through PDF or EPS formats (i.e. vector formats)
% Avoid bitmaps.
% NEVER WORK IN MS POWERPOINT! Can't export .EPS formats, only horrible bitmaps. Use OPEN OFFICE instead.
\usepackage{epstopdf}
%%%%%%% (2) SUBSCRIPT AND SUPERSCRIPT TOGETHER %%%%%%%
\documentclass{article}
\usepackage{fixltx2e}
\usepackage{xcolor}
\def\SPSB#1#2{\rlap{\textsuperscript{\textcolor{red}{#1}}}\SB{#2}}
\def\SP#1{\textsuperscript{\textcolor{red}{#1}}}
\def\SB#1{\textsubscript{\textcolor{blue}{#1}}}
\begin{document}
\huge
sometext\SPSB{1}{2} more text
sometext\SP{1} more\SB{2} text\SP{1}
\end{document}
%%%%%%%%% MARGINS ADJUSTMENT CHEAT %%%%%%%%%
% ref. http://marasingha.blogspot.co.uk/2006/02/simple-margin-adjustment-in-latex.html
\addtolength{\textwidth}{ain}
\addtolength{\hoffset}{-bin}
\addtolength{\textheight}{cin}
\addtolength{\voffset}{-cin}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment