Skip to content

Instantly share code, notes, and snippets.

@htr3n
Last active January 19, 2018 08:42
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 htr3n/1965f09a6093ae4f69179f2f1dedcede to your computer and use it in GitHub Desktop.
Save htr3n/1965f09a6093ae4f69179f2f1dedcede to your computer and use it in GitHub Desktop.

(La)TeX Dev Notes

Converting PDF file to a certain compatibility level

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.10 -dNOPAUSE -dQUIET -dBATCH -sOutputFile=new_file.pdf old_file.pdf
@htr3n
Copy link
Author

htr3n commented Jan 19, 2018

TeXShop

Specifying the TeX engines

%!TEX TS-program = [xelatex | pdflatex | pdflatexmk | xelatexmk ]

 
Or

% !TEX program
%!TEX encoding = UTF-8 Unicode

 
The setting of the XeTeX front-end engine of TeXShop can be found under the folder /Library/TeXShop/Engines/XeTeX.engine.

A new engine can also be created. For instance, for using XeTeX with the  --shellescape option, we can duplicate the original XeLaTeX.engine to create a new file under the aforementioned folder, namely XeLaTeX-shellescape.engine.

Then in the .tex file we can indicate the new engine using the following directive:

% !TEX TS-program = XeLaTeX-shellescape.

  
In TeXShop 3.21, the BibTeX engine can be selected on a file-by-file basis using the syntax

% !BIB TS-program = 

or

% !BIB program = 

 
The item after the equal sign gives the name of the program (for instance "biber") and any required flags.

@htr3n
Copy link
Author

htr3n commented Jan 19, 2018

TeXLive

Update

tlmgr update --self  
tlmgr update -- list 
tlmgr update --all --dry-run --no-auto-remove --no-auto-install --no-depends --no-depends-at-all --force 

 

Show configuration

tlmgr conf [texmf | tlmgr] 
tlmgr info pkg
tlmgr install pkg [--file file ] --dry-run --force
tlmgr reinstall ...
tlmgr remove -- no-depends --no-depends-at-all --force --dry-run
tlmgr list --only-installed

Uninstalls the entire TeX Live installation

tlmgr uninstall [--force]

 

Set paper size

tlmgr paper [a4|letter]

 

Platform

tlmgr platform list|add|remove|set [platform] # repositories
tlmgr repository list path|tag
tlmgr repository add|remove|set path [tag]
tlmgr repository add http://tlcontrib.metatex.org/2013 tlcontrib
tlmgr option repository http://sunsite.informatik.rwth-aachen.de /ftp/pub/mirror/ctan/systems/texlive/tlnet

 

Search

tlmgr search --global --word --list --taxonomy --keyword --all

@htr3n
Copy link
Author

htr3n commented Jan 19, 2018

Useful Commands

Spaces

Page

  • \columnsep -- the gap between columns
  • \topmargin -- the gap above header
  • \topskip -- the gap between header and text
  • \textheight -- the height of the main text
  • \textwidth -- the width of the text
  • \oddsidemargin -- odd page left margin
  • \evensidemargin

Paragraphs

  • \parindent -- the indentation of paragraphs
  • \parskip -- the gap between paragraphs

Floats

  • \floatsep -- the space left between floats. (multi column layout => \dblfloatsepinsted)
  • \textfloatsep -- the space between last top float or first bottom float and the text ( use \dbltextfloatsep if it is a multi column layout).
  • \intextsep -- space left on top and bottom of an in-text float.
  • \abovecaptionskip -- master the space above caption
  • \belowcaptionskip

Math

  • \abovedisplayskip -- the space before maths
  • \belowdisplayskip -- the space after maths
  • \arraycolsep -- gap between columns of an array

Lists

  • \topsep -- space between first item and preceding paragraph
  • \partopsep -- extra space added to \topsep when environment starts a new paragraph
  • \itemsep -- control the space between successive items – I use this one offen

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