Last active
January 2, 2016 23:39
-
-
Save paperdigits/8377394 to your computer and use it in GitHub Desktop.
TeX family notes & snippets.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass[12pt,letterpaper]{article} | |
\usepackage{helvet} | |
\usepackage{palatino} | |
\usepackage{sectsty} | |
\allsectionsfont{\normalfont \sffamily} | |
\usepackage{multicol} | |
%\usepackage[parfill]{parskip} | |
\usepackage{microtype} | |
%\usepackage[landscape]{geometry} | |
\usepackage{geometry} | |
%------------Page Demnsions------------% | |
\addtolength{\oddsidemargin}{-0.5in} %Sets the odd numbered page margins to 1 inch. | |
\addtolength{\evensidemargin}{-0.5in} %Sets the even numbered page margins to 1 inch. | |
\addtolength{\textwidth}{1in} %Widens the text so that flows from margin to margin. This number is double the values set above if odd & even side margins are the same. | |
\setlength\headheight{.25in} %Sets the height of the header to 1/4 of an inch. | |
\addtolength{\topmargin}{-.5in} %Sets the top margin to 3/4 of an inch. | |
\addtolength{\textheight}{1in} %Sets the length from the top margin for the text to start. | |
%------------Page Demnsions------------% | |
\usepackage{fancyhdr} | |
\pagestyle{fancy} %headers & footers | |
\fancyhead{} | |
\fancyfoot{} | |
\cfoot{} | |
\rfoot{} | |
\chead{\Large \sffamily Center Aligned Header Text } | |
\begin{document} | |
\setlength{\columnsep}{30pt} | |
\begin{multicols}{2} | |
...some text here... | |
\end{multicols} | |
\end{document} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LaTeX section mod | |
% Put this in your document preamble. | |
Add period after sectio header | latex | |
% Requires \documentclass{article} | |
% Gives: | |
% 1. Section One instead of 1 Section One | |
\renewcommand{\thesection}{\arabic{section}.} | |
\renewcommand{\thesubsection}{\thesection\arabic{subsection}} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FILENAME:latex crop marks.txt | |
%%Crop marks | |
\usepackage[cross, letter,center]{crop} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The \itemsep [value] as illustrated below controls the spacing between items in an ordered or unordered list. | |
# The \item[value] changes the standard bullet (in an unordered list) to [value]. This will also work for an ordered list, but needs a [value] that is a counter (such as \alph) | |
\begin{itemize} \itemsep -2pt % reduce space between items | |
\item[$\surd$] This is a check-mark | |
\item[$\gamma$] Math gamma | |
\item[$\bullet$] Bullet point | |
\end{itemize} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FILENAME:latex lulu.com crown quarto dimensions.txt | |
%% Lulu: Crown Quarto Color, Perfect Bound (18.91cm x 24.589cm) | |
\setlength{\paperwidth}{18.91cm} % set size for latex | |
\setlength{\paperheight}{24.589cm} | |
\special{papersize=7in,9in} % set size for ghostscript | |
\typearea[6mm]{1}%% 6 mm for spine |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FILENAME:latex memoir left-block poem title.txt | |
% When using the Memoir document class: makes the Poem Title flush left the poem body block with using the verse environment | |
% Example usage: | |
% \settowidth{\versewidth}{longest verse line} | |
% \PlainPoemTitle | |
% \PoemTitle{Poem Title} | |
% \begin{verse}[\versewidth] | |
% ... your poem ... | |
% \end{verse} | |
\renewcommand{\PoemTitlefont}{% | |
\normalfont\scshape\sffamily\flushleft% Remove centering from poem title | |
\hspace*{0.5\linewidth}\hspace*{-0.5\versewidth}}% Makes poem title flush left with body block. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\usepackage[final,expansion=true,protrusion=true,kerning]{microtype} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% It seems a bit weird, but we're in fact asking math mode to bring us in superscript mode, and then go back to text mode to write our text. | |
21$^{\textrm{\footnotesize st}}$ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\geometry{verbose,showframe} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% need \setcounter{secnumdepth}{7} in preamble. | |
%% Allows the use of \subsubsubsection{}, \subsubsubsubsection{}, etc. | |
\newcounter{subsubsubsection}[subsubsection] | |
\def\subsubsubsectionmark#1{} | |
\def\thesubsubsubsection {\thesubsubsection | |
.\arabic{subsubsubsection}} | |
\def\subsubsubsection{\@startsection | |
{subsubsubsection}{4}{\z@} {-3.25ex plus -1 | |
ex minus -.2ex}{1.5ex plus .2ex}{\normalsize\sf}} | |
% mj02r: original: | |
%\def\l@subsubsubsection{\@dottedtocline{4} | |
% {4.8em}{4.2em}} | |
% mj02r: for VCE reports: | |
%\def\l@subsubsubsection{\@dottedtocline{4} | |
% {7em}{3.8em}} | |
% mj02r, 29/12/2004: for thesis: | |
\def\l@subsubsubsection{\@dottedtocline{4} | |
{11.1em}{4.6em}} | |
\newcounter{subsubsubsubsection}[subsubsubsection] | |
\def\subsubsubsubsectionmark#1{} | |
\def\thesubsubsubsubsection {\thesubsubsubsection | |
.\arabic{subsubsubsubsection}} | |
\def\subsubsubsubsection{\@startsection | |
{subsubsubsubsection}{5} {\z@} {-3.25ex plus -1 | |
ex minus -.2ex}{1.5ex plus .2ex}{\normalsize\sf}} | |
% mj02r: original: | |
%\def\l@subsubsubsubsection{\@dottedtocline{5} | |
% {5.8em}{5.2em}} | |
% mj02r: for VCE reports: | |
\def\l@subsubsubsubsection{\@dottedtocline{5} | |
{10.7em}{4.5em}} | |
\newcounter{subsubsubsubsubsection}[subsubsubsubsection] | |
\def\subsubsubsubsubsectionmark#1{} | |
\def\thesubsubsubsubsubsection {\thesubsubsubsubsection | |
.\arabic{subsubsubsubsubsection}} | |
\def\subsubsubsubsubsection{\@startsection | |
{subsubsubsubsubsection}{6} {\z@} {-3.25ex plus -1 | |
ex minus -.2ex}{1.5ex plus .2ex}{\normalsize\sf}} | |
% mj02r: original: | |
%\def\l@subsubsubsubsubsection{\@dottedtocline{6} | |
% {5.8em}{5.2em}} | |
% mj02r: for VCE reports: | |
\def\l@subsubsubsubsubsection{\@dottedtocline{6} | |
{10.7em}{4.5em}} | |
\newcounter{subsubsubsubsubsubsection}[subsubsubsubsubsection] | |
\def\subsubsubsubsubsubsectionmark#1{} | |
\def\thesubsubsubsubsubsubsection {\thesubsubsubsubsubsection | |
.\arabic{subsubsubsubsubsubsection}} | |
\def\subsubsubsubsubsubsection{\@startsection | |
{subsubsubsubsubsubsection}{7} {\z@} {-3.25ex plus -1 | |
ex minus -.2ex}{1.5ex plus .2ex}{\normalsize\sf}} | |
% mj02r: original: | |
%\def\l@subsubsubsubsubsubsection{\@dottedtocline{7} | |
% {5.8em}{5.2em}} | |
% mj02r: for VCE reports: | |
\def\l@subsubsubsubsubsubsection{\@dottedtocline{7} | |
{10.7em}{4.5em}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass[10pt]{article} | |
\usepackage{tikz} | |
\definecolor{shade}{HTML}{884763} | |
\begin{document} | |
\begin{tikzpicture} | |
\node [fill=shade,rounded corners=5pt] | |
{ | |
\begin{minipage}{1\textwidth} | |
Text goes here. | |
\end{minipage} | |
}; | |
\end{tikzpicture} | |
\end{document} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Using XeLaTeX or XeTeX | |
1. Don't use inputenc or similar package. | |
2. Load xltxtra: it will load all other important packages like | |
fontspec, xunicode, ifxetex (and also graphicx). | |
3. Read the documentation of fontspec. If you want to use --- and ´´ in | |
your input you should use [Mapping=tex-text]. | |
4. You should have a recent version of the open type version of the | |
lm-fonts, and a recent version of the euenc-package. | |
5. You can load fontenc with option T1 and in certain cases in can be | |
useful. But I suggest that you leave it out for now. If you load | |
fontenc, load it before xltxtra (or fontspec). Also load all packages | |
that perhaps change the fontencoding (e.g. babel with option greek) | |
before xltxtra. | |
6. If your xetex is old (version < .997) you should use | |
xelatex --output-driver="xdvipdfmx" foo. | |
7. Delete all driver options like dvips, dvipdfmx, pdftex etc from your | |
document. Then check carefully in the log that your packages load the | |
correct drivers. A current hyperref should load hdvipdfm.def, graphicx | |
should load xetex.def. | |
8. geometry needs a recent xetex specific geometry.cfg (from march 2008) | |
to work properly. Then \usepackage[dvips]{geometry} should work fine | |
with pdflatex, xelatex and latex+dvips. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment