| 1 |
\documentclass[a4paper,article,oneside,english,10pt]{memoir} |
| 2 |
|
| 3 |
\makeatletter |
| 4 |
|
| 5 |
\usepackage[utf8]{inputenc} |
| 6 |
\usepackage[T1]{fontenc} |
| 7 |
\usepackage{babel} |
| 8 |
\usepackage[noDcommand,slantedGreeks]{kpfonts} |
| 9 |
|
| 10 |
\frenchspacing |
| 11 |
|
| 12 |
\usepackage{mathtools,etoolbox, microtype,xspace,color} |
| 13 |
|
| 14 |
\usepackage[shortlabels]{enumitem}%control lists |
| 15 |
|
| 16 |
\usepackage[draft]{fixme} |
| 17 |
|
| 18 |
%Setup of memoir: |
| 19 |
\pagestyle{plain} %change to heading for running headings |
| 20 |
\nouppercaseheads %running heads should not be capitalized |
| 21 |
\captionnamefont{\small} %captions with small font |
| 22 |
\captiontitlefont{\small} |
| 23 |
\makeevenhead{headings}{\thepage}{}{\itshape\leftmark} %make headings italic instead of slanted (though we do not use headings right now) |
| 24 |
\makeoddhead{headings}{\itshape\rightmark}{}{\thepage} |
| 25 |
|
| 26 |
\setlrmarginsandblock{4cm}{*}{*} |
| 27 |
\setulmarginsandblock{4cm}{*}{*} |
| 28 |
\checkandfixthelayout |
| 29 |
|
| 30 |
\raggedbottomsectiontrue%less harse than \raggedbottom |
| 31 |
%\allowdisplaybreaks %long equations may break |
| 32 |
|
| 33 |
\g@addto@macro\bfseries{\boldmath} %make math in bold text automatically bold |
| 34 |
|
| 35 |
\usepackage[english=american]{csquotes} |
| 36 |
|
| 37 |
\usepackage[hidelinks]{hyperref} |
| 38 |
|
| 39 |
\usepackage[nameinlink]{cleveref} |
| 40 |
|
| 41 |
\title{\texttt{semtex}: For stripped Seman\!\TeX\ documents (v0.45)} |
| 42 |
\date{\today} |
| 43 |
\author{Sebastian Ørsted (\href{mailto:[email protected]}{[email protected]})} |
| 44 |
|
| 45 |
\hypersetup{ |
| 46 |
pdfauthor={Sebastian Ørsted}, |
| 47 |
pdftitle={semtex: For stripped SemanTeX documents}, |
| 48 |
%pdfsubject={}, |
| 49 |
%pdfkeywords={}, |
| 50 |
%pdfproducer={Latex with hyperref, or other system}, |
| 51 |
%pdfcreator={pdflatex, or other tool}, |
| 52 |
} |
| 53 |
|
| 54 |
\usepackage{showexpl} |
| 55 |
|
| 56 |
\lstset{% |
| 57 |
language=[LaTeX]TeX, |
| 58 |
basicstyle=\ttfamily\small, |
| 59 |
commentstyle=\itshape\ttfamily\small, |
| 60 |
alsoletter={\\}, |
| 61 |
%escapechar=@, |
| 62 |
breaklines=true, |
| 63 |
breakindent={0pt}, |
| 64 |
captionpos=t, |
| 65 |
pos=r, |
| 66 |
tabsize=2, |
| 67 |
%inputencoding=utf8, |
| 68 |
explpreset={numbers=none,}, |
| 69 |
texcl=false, |
| 70 |
wide=false, |
| 71 |
width=.45\textwidth, |
| 72 |
} |
| 73 |
|
| 74 |
\newcommand\mylst{\lstinline[mathescape]} |
| 75 |
|
| 76 |
\def\<#1\>{\textrm{\textlangle\textit{#1}\textrangle}} |
| 77 |
|
| 78 |
\def\usercommand\<#1\>{\textrm{\textbackslash\textlangle\textit{#1}\textrangle}} |
| 79 |
|
| 80 |
\def\values\<#1\>{\textrm{\textlangle\textup{#1}\textrangle}} |
| 81 |
|
| 82 |
\def\num#1{\textsubscript{\textup{#1}}} |
| 83 |
|
| 84 |
\newcommand\default[1]{\smash{\underline{\smash{#1}}}} |
| 85 |
|
| 86 |
\newcommand\commandname[1]{\textbackslash\texttt{#1}} |
| 87 |
|
| 88 |
\let\pack=\texttt |
| 89 |
|
| 90 |
\newcommand\semantex{Seman\!\TeX\xspace} |
| 91 |
|
| 92 |
\newcommand\stripsemantex{\texttt{stripsemantex}\xspace} |
| 93 |
|
| 94 |
\usepackage{hologo} |
| 95 |
|
| 96 |
% Setting up SemanTeX: |
| 97 |
|
| 98 |
\usepackage{semtex} |
| 99 |
|
| 100 |
\makeatother |
| 101 |
|
| 102 |
\begin{document} |
| 103 |
|
| 104 |
\maketitle |
| 105 |
|
| 106 |
\noindent |
| 107 |
The package~\pack{semtex} is a small package |
| 108 |
that adds a collection of simple macros for parentheses |
| 109 |
and bullets. |
| 110 |
It exists for one purpose only: |
| 111 |
To be loaded by documents which were originally typeset |
| 112 |
using the package \semantex, but which have been stripped |
| 113 |
of \semantex markup using the package~\pack{stripsemantex}. |
| 114 |
Therefore, unless your document is one of those, |
| 115 |
simply \textbf{don't use this package}. |
| 116 |
|
| 117 |
|
| 118 |
And even if your document \emph{is} one of those, there is a good chance |
| 119 |
you will not have to load it after all. In most cases, you will be able to replace |
| 120 |
the macros it provides by macros from other packages. |
| 121 |
|
| 122 |
\chapter*{Bullet commands} |
| 123 |
|
| 124 |
The package provides the commands \mylst!\SemantexBullet! and \mylst!\SemantexDoubleBullet!. |
| 125 |
These commands print bullets which are smaller (and prettier, in my opinion) |
| 126 |
than the standard \lstinline!\bullet! command from~\LaTeX. |
| 127 |
They are (of course) based on code by egreg, see \url{tex.stackexchange.com/a/564506/19809}. |
| 128 |
\begin{LTXexample} |
| 129 |
$ H^{\SemantexBullet} $, |
| 130 |
$ H^{\SemantexDoubleBullet} $ |
| 131 |
(compare to $H^{\bullet}$) |
| 132 |
\end{LTXexample} |
| 133 |
You can recreate them yourself as follows, rendering |
| 134 |
the package \pack{semtex} unnecessary for this purpose: |
| 135 |
\begin{lstlisting} |
| 136 |
\usepackage{graphicx} |
| 137 |
|
| 138 |
\makeatletter |
| 139 |
\DeclareRobustCommand\SemantexBullet{% |
| 140 |
\mathord{\mathpalette\SemantexBullet@{0.5}}% |
| 141 |
} |
| 142 |
\newcommand\SemantexBullet@[2]{% |
| 143 |
\vcenter{\hbox{\scalebox{#2}{$\m@th#1\bullet$}}}% |
| 144 |
} |
| 145 |
\DeclareRobustCommand\SemantexDoubleBullet{\SemantexBullet \SemantexBullet} |
| 146 |
\makeatother |
| 147 |
\end{lstlisting} |
| 148 |
|
| 149 |
\chapter*{Replacements for \texorpdfstring{\textbackslash\texttt{left} and~\textbackslash\texttt{right}}{\left and \right}} |
| 150 |
|
| 151 |
The package provides the commands \mylst!\SemantexLeft! |
| 152 |
and~\mylst!\SemantexRight! |
| 153 |
These work just like \lstinline!\left...\right!, but fix some spacing issues |
| 154 |
around these: |
| 155 |
\begin{LTXexample} |
| 156 |
\[ |
| 157 |
\SemantexLeft( |
| 158 |
\frac{1}{2} |
| 159 |
\SemantexRight] |
| 160 |
\] |
| 161 |
\end{LTXexample} |
| 162 |
They are completely equivalent to~\lstinline!\mleft! and~\lstinline!\mright! |
| 163 |
from the package~\pack{mleftright}, so it is safe to just load that package |
| 164 |
and replace the above commands by \lstinline!\mleft...\mright! instead. |
| 165 |
Alternatively, you can recreate them yourself by |
| 166 |
\begin{lstlisting} |
| 167 |
\newcommand\SemantexLeft{% |
| 168 |
\mathopen{}\mathclose\bgroup\left |
| 169 |
} |
| 170 |
|
| 171 |
\newcommand\SemantexRight{% |
| 172 |
\aftergroup\egroup\right |
| 173 |
} |
| 174 |
\end{lstlisting} |
| 175 |
|
| 176 |
\end{document} |