SlideShare a Scribd company logo
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
Lab meeting—technical talk
Topics in TEX and LATEX
Selected packages, programming, and Overleaf updates
Coby Viner
Hoffman Lab
Wednesday January 31, 2018
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
Overview
TEX Engines
Selected LATEX Packages
Microtypography: the microtype package
siunitx: SI units & number formatting
todonotes: Todo notes within your document
The xifthen and ifdraft packages
Selected programming tools and methods
Patching other packages or classes
ε-TEX programming: expandafter
ε-TEX programming: expandafter
ε-TEX programming: csname…endcsname
Overleaf
Overleaf compilation
Overleaf version 2
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
TEX Engines
TEX engines
TEX (dvi)
pdfTEX
XETEX
LuaTEX
ConTEXt
S. Kottwitz. (2015), Example: a diagram of tex engines,
http://www.texample.net/tikz/examples/smart-bubbles/.
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
Microtypography: the microtype package
H. T. Thành, “Micro-typographic extensions of pdfTEX in practice”, TUGboat, vol.
25, no. 1, pp. 35–38, 2004.
S. Khirevich. (2018), Tips on writing a thesis in latex,
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
Microtypography: the microtype package
H. T. Thành, “Micro-typographic extensions of pdfTEX in practice”, TUGboat, vol.
25, no. 1, pp. 35–38, 2004.
S. Khirevich. (2018), Tips on writing a thesis in latex,
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
Microtypography: the microtype package
H. T. Thành, “Micro-typographic extensions of pdfTEX in practice”, TUGboat, vol.
25, no. 1, pp. 35–38, 2004.
S. Khirevich. (2018), Tips on writing a thesis in latex,
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
siunitx: SI units & number formatting
Use for all quantities that have units: $SI{10}{gpermicrolitre}$
10g/µl
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
siunitx: SI units & number formatting
Use for all quantities that have units: $SI{10}{gpermicrolitre}$
10g/µl
Typeset units: $si{dalton} = si{grampermole}$ and
$si{angstrom} = SI{0.1}{nanometer}$ Da = gmol−1 and
Å = 0.1000nm
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
siunitx: SI units & number formatting
Use for all quantities that have units: $SI{10}{gpermicrolitre}$
10g/µl
Typeset units: $si{dalton} = si{grampermole}$ and
$si{angstrom} = SI{0.1}{nanometer}$ Da = gmol−1 and
Å = 0.1000nm
Typeset numbers, $num{2.718281828459045}$, $num{200000}$:
2.7183, 200000
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
siunitx: SI units & number formatting
Use for all quantities that have units: $SI{10}{gpermicrolitre}$
10g/µl
Typeset units: $si{dalton} = si{grampermole}$ and
$si{angstrom} = SI{0.1}{nanometer}$ Da = gmol−1 and
Å = 0.1000nm
Typeset numbers, $num{2.718281828459045}$, $num{200000}$:
2.7183, 200000
Define new units: DeclareSIUnit[number-unit-product = ;]
basepair{bp}
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
siunitx: SI units & number formatting
Use for all quantities that have units: $SI{10}{gpermicrolitre}$
10g/µl
Typeset units: $si{dalton} = si{grampermole}$ and
$si{angstrom} = SI{0.1}{nanometer}$ Da = gmol−1 and
Å = 0.1000nm
Typeset numbers, $num{2.718281828459045}$, $num{200000}$:
2.7183, 200000
Define new units: DeclareSIUnit[number-unit-product = ;]
basepair{bp}
Options: detect-all
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
siunitx: SI units & number formatting
Use for all quantities that have units: $SI{10}{gpermicrolitre}$
10g/µl
Typeset units: $si{dalton} = si{grampermole}$ and
$si{angstrom} = SI{0.1}{nanometer}$ Da = gmol−1 and
Å = 0.1000nm
Typeset numbers, $num{2.718281828459045}$, $num{200000}$:
2.7183, 200000
Define new units: DeclareSIUnit[number-unit-product = ;]
basepair{bp}
Options: detect-all
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
siunitx: SI units & number formatting
Use for all quantities that have units: $SI{10}{gpermicrolitre}$
10g/µl
Typeset units: $si{dalton} = si{grampermole}$ and
$si{angstrom} = SI{0.1}{nanometer}$ Da = gmol−1 and
Å = 0.1000nm
Typeset numbers, $num{2.718281828459045}$, $num{200000}$:
2.7183, 200000
Define new units: DeclareSIUnit[number-unit-product = ;]
basepair{bp}
Options: detect-all, binary-units
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
siunitx: SI units & number formatting
Use for all quantities that have units: $SI{10}{gpermicrolitre}$
10g/µl
Typeset units: $si{dalton} = si{grampermole}$ and
$si{angstrom} = SI{0.1}{nanometer}$ Da = gmol−1 and
Å = 0.1000nm
Typeset numbers, $num{2.718281828459045}$, $num{200000}$:
2.7183, 200000
Define new units: DeclareSIUnit[number-unit-product = ;]
basepair{bp}
Options: detect-all, binary-units, round-mode=places,round-precision=4
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
todonotes: Todo notes within your document
The todonotes package lets you mark items that you need to complete…
This note was created with todo[inline].
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
todonotes: Todo notes within your document
The todonotes package lets you mark items that you need to complete…
This note was created with todo[inline].
Mark missing figures: missingfigure[fig-
width=6cm,
figheight=4cm]
Missing
figure
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
todonotes: Todo notes within your document
The todonotes package lets you mark items that you need to complete…
This note was created with todo[inline].
Mark missing figures: missingfigure[fig-
width=6cm,
figheight=4cm]
Missing
figure
Lots of options…colour combos: blue!20!white
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
todonotes: Todo notes within your document
The todonotes package lets you mark items that you need to complete…
This note was created with todo[inline].
Mark missing figures: missingfigure[fig-
width=6cm,
figheight=4cm]
Missing
figure
Lots of options…colour combos: blue!20!white
Load with obeyFinal to remove all notes when passing final to your class.
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
The xifthen and ifdraft packages
Use xifthen to provide simple conditional syntax
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
The xifthen and ifdraft packages
Use xifthen to provide simple conditional syntax
newboolean{〈boolean〉}
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
The xifthen and ifdraft packages
Use xifthen to provide simple conditional syntax
newboolean{〈boolean〉}
setboolean{〈boolean〉}{〈true|false}
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
The xifthen and ifdraft packages
Use xifthen to provide simple conditional syntax
newboolean{〈boolean〉}
setboolean{〈boolean〉}{〈true|false}
ifthenelse{〈test expression〉}{〈true code〉}{〈false code〉}
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
The xifthen and ifdraft packages
Use xifthen to provide simple conditional syntax
newboolean{〈boolean〉}
setboolean{〈boolean〉}{〈true|false}
ifthenelse{〈test expression〉}{〈true code〉}{〈false code〉}
boolean{〈boolean〉}, 〈value1〉 = 〈value2〉,
equal{〈string1〉}{〈string2〉} AND
endswith{〈string2〉}{〈suffix〉}
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
The xifthen and ifdraft packages
Use xifthen to provide simple conditional syntax
newboolean{〈boolean〉}
setboolean{〈boolean〉}{〈true|false}
ifthenelse{〈test expression〉}{〈true code〉}{〈false code〉}
boolean{〈boolean〉}, 〈value1〉 = 〈value2〉,
equal{〈string1〉}{〈string2〉} AND
endswith{〈string2〉}{〈suffix〉}
With the setspace and ifdraft packages:
ifoptionfinal{}{doublespacing}
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
Patching other packages or classes
Often want to edit a macro in an external package or class
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
Patching other packages or classes
Often want to edit a macro in an external package or class
regexpatch provides advanced functionality to do so
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
Patching other packages or classes
Often want to edit a macro in an external package or class
regexpatch provides advanced functionality to do so
Some useful patches for the BioMed Central’s bmcart.cls:
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
Patching other packages or classes
Often want to edit a macro in an external package or class
regexpatch provides advanced functionality to do so
Some useful patches for the BioMed Central’s bmcart.cls:
Contains: defdoi@base{http://dx.doi.org/}
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
Patching other packages or classes
Often want to edit a macro in an external package or class
regexpatch provides advanced functionality to do so
Some useful patches for the BioMed Central’s bmcart.cls:
Contains: defdoi@base{http://dx.doi.org/}
patchcmd{doi@base}{http://dx.doi.org}
{https://doi.org}{}{}
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
Patching other packages or classes
appto{ figure@ setting s}{%
 i f @ f i g u r e s t a r
 captionsetup { . . . ,
s i n g l e l i n e c h e c k=f a l s e , j u s t i f i c a t i o n=RaggedRight}
 f i%
}
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
Patching other packages or classes
appto{ figure@ setting s}{%
 i f @ f i g u r e s t a r
 captionsetup { . . . ,
s i n g l e l i n e c h e c k=f a l s e , j u s t i f i c a t i o n=RaggedRight}
 f i%
}
 def  bmcart@hyperref@settings{%
. . .
 @ifundefined { hy@title }{}{ p d f s t r i n g d e f
 @pdftitle { hy@title }}
}
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
Patching other packages or classes
appto{ figure@ setting s}{%
 i f @ f i g u r e s t a r
 captionsetup { . . . ,
s i n g l e l i n e c h e c k=f a l s e , j u s t i f i c a t i o n=RaggedRight}
 f i%
}
 def  bmcart@hyperref@settings{%
. . .
 @ifundefined { hy@title }{}{ p d f s t r i n g d e f
 @pdftitle { hy@title }}
}
regexpatchcmd { bmcart@hyperref@settings }
{.* @title .*}{}{}{}
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
ε-TEX programming: expandafter
There are typesetting instructions and instructions with other effects
S. v. Bechtolsheim, “A tutorial on expandafter”, TUGboat, vol. 9, no. 1, pp. 57–61,
1988.
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
ε-TEX programming: expandafter
There are typesetting instructions and instructions with other effects
def is like a simpler version of newcommand*, in TEX and not LATEX
S. v. Bechtolsheim, “A tutorial on expandafter”, TUGboat, vol. 9, no. 1, pp. 57–61,
1988.
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
ε-TEX programming: expandafter
There are typesetting instructions and instructions with other effects
def is like a simpler version of newcommand*, in TEX and not LATEX
expandafter is a macro that influences the expansion of macros
S. v. Bechtolsheim, “A tutorial on expandafter”, TUGboat, vol. 9, no. 1, pp. 57–61,
1988.
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
ε-TEX programming: expandafter
There are typesetting instructions and instructions with other effects
def is like a simpler version of newcommand*, in TEX and not LATEX
expandafter is a macro that influences the expansion of macros
defxx{ABC}; replacement text and expansion of xx is ABC
S. v. Bechtolsheim, “A tutorial on expandafter”, TUGboat, vol. 9, no. 1, pp. 57–61,
1988.
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
ε-TEX programming: expandafter
expandafter〈tokene〉〈token1〉〈token2〉…〈tokenn〉
S. v. Bechtolsheim, “A tutorial on expandafter”, TUGboat, vol. 9, no. 1, pp. 57–61,
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
ε-TEX programming: expandafter
expandafter〈tokene〉〈token1〉〈token2〉…〈tokenn〉
tokene is saved without expansion
S. v. Bechtolsheim, “A tutorial on expandafter”, TUGboat, vol. 9, no. 1, pp. 57–61,
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
ε-TEX programming: expandafter
expandafter〈tokene〉〈token1〉〈token2〉…〈tokenn〉
tokene is saved without expansion
Process 〈token1〉
S. v. Bechtolsheim, “A tutorial on expandafter”, TUGboat, vol. 9, no. 1, pp. 57–61,
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
ε-TEX programming: expandafter
expandafter〈tokene〉〈token1〉〈token2〉…〈tokenn〉
tokene is saved without expansion
Process 〈token1〉
〈token1〉 is a macro: it gets expanded.
S. v. Bechtolsheim, “A tutorial on expandafter”, TUGboat, vol. 9, no. 1, pp. 57–61,
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
ε-TEX programming: expandafter
expandafter〈tokene〉〈token1〉〈token2〉…〈tokenn〉
tokene is saved without expansion
Process 〈token1〉
〈token1〉 is a macro: it gets expanded.
〈token1〉 is another expandafter: TEX continues performing expandafters
S. v. Bechtolsheim, “A tutorial on expandafter”, TUGboat, vol. 9, no. 1, pp. 57–61,
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
ε-TEX programming: expandafter
expandafter〈tokene〉〈token1〉〈token2〉…〈tokenn〉
tokene is saved without expansion
Process 〈token1〉
〈token1〉 is a macro: it gets expanded.
〈token1〉 is another expandafter: TEX continues performing expandafters
〈token1〉 is csname: TEX looks for the matching endcsname and expands
the resulting token
S. v. Bechtolsheim, “A tutorial on expandafter”, TUGboat, vol. 9, no. 1, pp. 57–61,
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
ε-TEX programming: expandafter
expandafter〈tokene〉〈token1〉〈token2〉…〈tokenn〉
tokene is saved without expansion
Process 〈token1〉
〈token1〉 is a macro: it gets expanded.
〈token1〉 is another expandafter: TEX continues performing expandafters
〈token1〉 is csname: TEX looks for the matching endcsname and expands
the resulting token
〈token1〉 is an opening curly brace: the opening brace is temporarily
suspended
S. v. Bechtolsheim, “A tutorial on expandafter”, TUGboat, vol. 9, no. 1, pp. 57–61,
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
ε-TEX programming: expandafter
expandafter〈tokene〉〈token1〉〈token2〉…〈tokenn〉
tokene is saved without expansion
Process 〈token1〉
〈token1〉 is a macro: it gets expanded.
〈token1〉 is another expandafter: TEX continues performing expandafters
〈token1〉 is csname: TEX looks for the matching endcsname and expands
the resulting token
〈token1〉 is an opening curly brace: the opening brace is temporarily
suspended
〈token1〉 is the: operation is performed, reading the token after it
S. v. Bechtolsheim, “A tutorial on expandafter”, TUGboat, vol. 9, no. 1, pp. 57–61,
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
ε-TEX programming: expandafter
expandafter〈tokene〉〈token1〉〈token2〉…〈tokenn〉
tokene is saved without expansion
Process 〈token1〉
〈token1〉 is a macro: it gets expanded.
〈token1〉 is another expandafter: TEX continues performing expandafters
〈token1〉 is csname: TEX looks for the matching endcsname and expands
the resulting token
〈token1〉 is an opening curly brace: the opening brace is temporarily
suspended
〈token1〉 is the: operation is performed, reading the token after it
〈token1〉 is any other primitive: nothing
S. v. Bechtolsheim, “A tutorial on expandafter”, TUGboat, vol. 9, no. 1, pp. 57–61,
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
ε-TEX programming: expandafter
tokene is placed back in front of the generated tokens and processing
continues
S. v. Bechtolsheim, “A tutorial on expandafter”, TUGboat, vol. 9, no. 1, pp. 57–61,
1988.
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
ε-TEX programming: expandafter
tokene is placed back in front of the generated tokens and processing
continues
expandafter reverses expansion, not execution
S. v. Bechtolsheim, “A tutorial on expandafter”, TUGboat, vol. 9, no. 1, pp. 57–61,
1988.
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
ε-TEX programming: expandafter
tokene is placed back in front of the generated tokens and processing
continues
expandafter reverses expansion, not execution
Common use case: calling a macro with the result of another
S. v. Bechtolsheim, “A tutorial on expandafter”, TUGboat, vol. 9, no. 1, pp. 57–61,
1988.
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
ε-TEX programming: expandafter
tokene is placed back in front of the generated tokens and processing
continues
expandafter reverses expansion, not execution
Common use case: calling a macro with the result of another
defxx[#1]{...} defyy{[ABC]}
S. v. Bechtolsheim, “A tutorial on expandafter”, TUGboat, vol. 9, no. 1, pp. 57–61,
1988.
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
ε-TEX programming: expandafter
tokene is placed back in front of the generated tokens and processing
continues
expandafter reverses expansion, not execution
Common use case: calling a macro with the result of another
defxx[#1]{...} defyy{[ABC]}
xxyy fails; expandafterxxyy works
S. v. Bechtolsheim, “A tutorial on expandafter”, TUGboat, vol. 9, no. 1, pp. 57–61,
1988.
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
ε-TEX programming: expandafter
tokene is placed back in front of the generated tokens and processing
continues
expandafter reverses expansion, not execution
Common use case: calling a macro with the result of another
defxx[#1]{...} defyy{[ABC]}
xxyy fails; expandafterxxyy works
defzz{yy}. expandafterxxzz fails, since expansion only occurs
once
S. v. Bechtolsheim, “A tutorial on expandafter”, TUGboat, vol. 9, no. 1, pp. 57–61,
1988.
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
ε-TEX programming: expandafter
tokene is placed back in front of the generated tokens and processing
continues
expandafter reverses expansion, not execution
Common use case: calling a macro with the result of another
defxx[#1]{...} defyy{[ABC]}
xxyy fails; expandafterxxyy works
defzz{yy}. expandafterxxzz fails, since expansion only occurs
once
Solved using edeftemp{noexpandxxzz}
S. v. Bechtolsheim, “A tutorial on expandafter”, TUGboat, vol. 9, no. 1, pp. 57–61,
1988.
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
ε-TEX programming: expandafter
Multiple expandafters: ex1ex1ex1aex4bc
S. v. Bechtolsheim, “A tutorial on expandafter”, TUGboat, vol. 9, no. 1, pp. 57–61,
1988.
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
ε-TEX programming: expandafter
Multiple expandafters: ex1ex1ex1aex4bc
ex1 is executed, saving ex2.
S. v. Bechtolsheim, “A tutorial on expandafter”, TUGboat, vol. 9, no. 1, pp. 57–61,
1988.
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
ε-TEX programming: expandafter
Multiple expandafters: ex1ex1ex1aex4bc
ex1 is executed, saving ex2.
ex3 is executed, saving a
S. v. Bechtolsheim, “A tutorial on expandafter”, TUGboat, vol. 9, no. 1, pp. 57–61,
1988.
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
ε-TEX programming: expandafter
Multiple expandafters: ex1ex1ex1aex4bc
ex1 is executed, saving ex2.
ex3 is executed, saving a
Saved token list: ex2· a
S. v. Bechtolsheim, “A tutorial on expandafter”, TUGboat, vol. 9, no. 1, pp. 57–61,
1988.
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
ε-TEX programming: expandafter
Multiple expandafters: ex1ex1ex1aex4bc
ex1 is executed, saving ex2.
ex3 is executed, saving a
Saved token list: ex2· a
ex4 is executed, saving b and expanding c
S. v. Bechtolsheim, “A tutorial on expandafter”, TUGboat, vol. 9, no. 1, pp. 57–61,
1988.
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
ε-TEX programming: expandafter
Multiple expandafters: ex1ex1ex1aex4bc
ex1 is executed, saving ex2.
ex3 is executed, saving a
Saved token list: ex2· a
ex4 is executed, saving b and expanding c
All saved tokens ex2· a · b are reinserted in front of the replacement of
c
S. v. Bechtolsheim, “A tutorial on expandafter”, TUGboat, vol. 9, no. 1, pp. 57–61,
1988.
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
ε-TEX programming: expandafter
Multiple expandafters: ex1ex1ex1aex4bc
ex1 is executed, saving ex2.
ex3 is executed, saving a
Saved token list: ex2· a
ex4 is executed, saving b and expanding c
All saved tokens ex2· a · b are reinserted in front of the replacement of
c
Now ex2 s executed, saving a and expanding b
S. v. Bechtolsheim, “A tutorial on expandafter”, TUGboat, vol. 9, no. 1, pp. 57–61,
1988.
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
ε-TEX programming: expandafter
Multiple expandafters: ex1ex1ex1aex4bc
ex1 is executed, saving ex2.
ex3 is executed, saving a
Saved token list: ex2· a
ex4 is executed, saving b and expanding c
All saved tokens ex2· a · b are reinserted in front of the replacement of
c
Now ex2 s executed, saving a and expanding b
a is reinserted and then expanded
S. v. Bechtolsheim, “A tutorial on expandafter”, TUGboat, vol. 9, no. 1, pp. 57–61,
1988.
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
ε-TEX programming: expandafter
Multiple expandafters: ex1ex1ex1aex4bc
ex1 is executed, saving ex2.
ex3 is executed, saving a
Saved token list: ex2· a
ex4 is executed, saving b and expanding c
All saved tokens ex2· a · b are reinserted in front of the replacement of
c
Now ex2 s executed, saving a and expanding b
a is reinserted and then expanded
Execution continues with the replacement text of a
S. v. Bechtolsheim, “A tutorial on expandafter”, TUGboat, vol. 9, no. 1, pp. 57–61,
1988.
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
ε-TEX programming: expandafter
Reverse expansion of 4 tokens: 7 expandafters, token a, 3
expandafters, token b, expandafter, token c, token d
S. v. Bechtolsheim, “A tutorial on expandafter”, TUGboat, vol. 9, no. 1, pp. 57–61,
1988.
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
ε-TEX programming: expandafter
Reverse expansion of 4 tokens: 7 expandafters, token a, 3
expandafters, token b, expandafter, token c, token d
For n tokens, the ith token must be preceded by 2n−i −1 expandafters
S. v. Bechtolsheim, “A tutorial on expandafter”, TUGboat, vol. 9, no. 1, pp. 57–61,
1988.
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
ε-TEX programming: csname…endcsname
csname–endcsname are TEX primatives used to define and call macros
A. Hendrickson, “The joy of csname…endcsname”, TUGboat, vol. 33, no. 2,
pp. 219–224, 2012.
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
ε-TEX programming: csname…endcsname
csname–endcsname are TEX primatives used to define and call macros
def can only used letters
A. Hendrickson, “The joy of csname…endcsname”, TUGboat, vol. 33, no. 2,
pp. 219–224, 2012.
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
ε-TEX programming: csname…endcsname
csname–endcsname are TEX primatives used to define and call macros
def can only used letters
Can do: expandafterdefcsname $&3endcsname{Hi!}
A. Hendrickson, “The joy of csname…endcsname”, TUGboat, vol. 33, no. 2,
pp. 219–224, 2012.
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
ε-TEX programming: csname…endcsname
csname–endcsname are TEX primatives used to define and call macros
def can only used letters
Can do: expandafterdefcsname $&3endcsname{Hi!}
Then csname $&3endcsname produces “Hi!”
A. Hendrickson, “The joy of csname…endcsname”, TUGboat, vol. 33, no. 2,
pp. 219–224, 2012.
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
ε-TEX programming: csname…endcsname
csname–endcsname are TEX primatives used to define and call macros
def can only used letters
Can do: expandafterdefcsname $&3endcsname{Hi!}
Then csname $&3endcsname produces “Hi!”
Can expand commands within this and use for building dynamic macros
A. Hendrickson, “The joy of csname…endcsname”, TUGboat, vol. 33, no. 2,
pp. 219–224, 2012.
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
Overleaf compilation
Uses latexmk
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
Overleaf compilation
Uses latexmk
Configure with a .latexmkrc file
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
Overleaf compilation
Uses latexmk
Configure with a .latexmkrc file
https:
//www.overleaf.com/help/216-how-does-overleaf-compile-my-project
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
Overleaf compilation
Uses latexmk
Configure with a .latexmkrc file
https:
//www.overleaf.com/help/216-how-does-overleaf-compile-my-project
To use our local timezone: $ENV{'TZ'}='Canada/Eastern';
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
Overleaf compilation
Uses latexmk
Configure with a .latexmkrc file
https:
//www.overleaf.com/help/216-how-does-overleaf-compile-my-project
To use our local timezone: $ENV{'TZ'}='Canada/Eastern';
Sandboxed via Docker
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
Overleaf compilation
Uses latexmk
Configure with a .latexmkrc file
https:
//www.overleaf.com/help/216-how-does-overleaf-compile-my-project
To use our local timezone: $ENV{'TZ'}='Canada/Eastern';
Sandboxed via Docker
Permit shell-escape: $pdflatex = 'pdflatex --shell-escape';
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
Overleaf version 2
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
Overleaf version 2
Try it out yourself: v2.overleaf.com
Import of V1 projects available. Not yet for production uses.
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
Overleaf version 2
Try it out yourself: v2.overleaf.com
Import of V1 projects available. Not yet for production uses.
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
Overleaf version 2
Try it out yourself: v2.overleaf.com
Import of V1 projects available. Not yet for production uses.
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
Overleaf version 2
Try it out yourself: v2.overleaf.com
Import of V1 projects available. Not yet for production uses.
Lab meeting—
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
S. Kottwitz. (2015), Example: a diagram of tex engines,
http://www.texample.net/tikz/examples/smart-bubbles/.
H. T. Thành, “Micro-typographic extensions of pdfTEX in practice”,
TUGboat, vol. 25, no. 1, pp. 35–38, 2004.
S. Khirevich. (2018), Tips on writing a thesis in latex,
http://www.khirevich.com/latex/microtype/.
S. v. Bechtolsheim, “A tutorial on expandafter”, TUGboat, vol. 9, no. 1,
pp. 57–61, 1988.
A. Hendrickson, “The joy of csname…endcsname”, TUGboat, vol. 33, no. 2,
pp. 219–224, 2012.
J. Wright, “siunitx: a comprehensive (SI) units package”, TUGboat, vol. 32,
no. 1, pp. 95–98, 2011.

More Related Content

PDF
Veriloggen.Stream: データフローからハードウェアを作る(2018年3月3日 高位合成友の会 第5回 @東京工業大学)
PDF
How to Build a Telegraf Plugin by Noah Crowley
PDF
Write your own telegraf plugin
PPTX
Developing Your Own Flux Packages by David McKay | Head of Developer Relation...
PPTX
Miller: A command-line tool for querying, shaping, and reformatting data files
PDF
GNU Parallel: Lab meeting—technical talk
PDF
TCRpower
PPTX
Efficient querying of genomic reference databases with gget
Veriloggen.Stream: データフローからハードウェアを作る(2018年3月3日 高位合成友の会 第5回 @東京工業大学)
How to Build a Telegraf Plugin by Noah Crowley
Write your own telegraf plugin
Developing Your Own Flux Packages by David McKay | Head of Developer Relation...
Miller: A command-line tool for querying, shaping, and reformatting data files
GNU Parallel: Lab meeting—technical talk
TCRpower
Efficient querying of genomic reference databases with gget

More from Hoffman Lab (20)

PPTX
WashU Epigenome Browser
PPTX
Wireguard: A Virtual Private Network Tunnel
PPTX
Plotting heatmap with matplotlib/seaborn
PPTX
Go Get Data (GGD)
PPTX
fastp: the FASTQ pre-processor
PPTX
R markdown and Rmdformats
PPTX
File searching tools
PPTX
Better BibTeX (BBT) for Zotero
PPTX
Awk primer and Bioawk
PPTX
Terminals and Shells
PPTX
BioRender & Glossary/Acronym
PPTX
Linters in R
PPTX
BioSyntax: syntax highlighting for computational biology
PPTX
Get Good With Git
PDF
Tech Talk: UCSC Genome Browser
PDF
MultiQC: summarize analysis results for multiple tools and samples in a singl...
PPTX
dreamRs: interactive ggplot2
PPTX
Basic Cryptography & Security
PDF
Intervene: a tool for intersection and visualization of multiple gene or geno...
PPTX
Evaluating machine learning claims
WashU Epigenome Browser
Wireguard: A Virtual Private Network Tunnel
Plotting heatmap with matplotlib/seaborn
Go Get Data (GGD)
fastp: the FASTQ pre-processor
R markdown and Rmdformats
File searching tools
Better BibTeX (BBT) for Zotero
Awk primer and Bioawk
Terminals and Shells
BioRender & Glossary/Acronym
Linters in R
BioSyntax: syntax highlighting for computational biology
Get Good With Git
Tech Talk: UCSC Genome Browser
MultiQC: summarize analysis results for multiple tools and samples in a singl...
dreamRs: interactive ggplot2
Basic Cryptography & Security
Intervene: a tool for intersection and visualization of multiple gene or geno...
Evaluating machine learning claims
Ad

Recently uploaded (20)

PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Approach and Philosophy of On baking technology
PDF
cuic standard and advanced reporting.pdf
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Machine learning based COVID-19 study performance prediction
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPTX
Cloud computing and distributed systems.
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Building Integrated photovoltaic BIPV_UPV.pdf
Approach and Philosophy of On baking technology
cuic standard and advanced reporting.pdf
sap open course for s4hana steps from ECC to s4
Machine learning based COVID-19 study performance prediction
Advanced methodologies resolving dimensionality complications for autism neur...
“AI and Expert System Decision Support & Business Intelligence Systems”
Programs and apps: productivity, graphics, security and other tools
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
20250228 LYD VKU AI Blended-Learning.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Cloud computing and distributed systems.
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Digital-Transformation-Roadmap-for-Companies.pptx
Understanding_Digital_Forensics_Presentation.pptx
Unlocking AI with Model Context Protocol (MCP)
Spectral efficient network and resource selection model in 5G networks
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Ad

Topics in TeX and LaTeX: Selected packages, programming, and Overleaf updates