Changes in doc/LaTeXmacros/common.tex [b52d900:9724df0]
- File:
-
- 1 edited
-
doc/LaTeXmacros/common.tex (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
doc/LaTeXmacros/common.tex
rb52d900 r9724df0 11 11 %% Created On : Sat Apr 9 10:06:17 2016 12 12 %% Last Modified By : Peter A. Buhr 13 %% Last Modified On : Sat Apr 9 10:06:39201614 %% Update Count : 1 13 %% Last Modified On : Mon Jun 20 09:35:20 2016 14 %% Update Count : 178 15 15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 16 17 17 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 18 18 19 \setlength{\textheight}{9in} 20 %\oddsidemargin 0.0in 21 \renewcommand{\topfraction}{0.8} % float must be greater than X of the page before it is forced onto its own page 22 \renewcommand{\bottomfraction}{0.8} % float must be greater than X of the page before it is forced onto its own page 23 \renewcommand{\floatpagefraction}{0.8} % float must be greater than X of the page before it is forced onto its own page 24 \renewcommand{\textfraction}{0.0} % the entire page maybe devoted to floats with no text on the page at all 25 26 \lefthyphenmin=4 27 \righthyphenmin=4 28 29 \usepackage{pslatex} % reduce size of san serif font 30 31 \usepackage[ignoredisplayed]{enumitem} % do not affect trivlist 32 \setlist{labelsep=1ex}% global 33 \setlist[itemize]{topsep=0.5ex,parsep=0.25ex,itemsep=0.25ex,listparindent=\parindent,leftmargin=\parindent}% global 34 \setlist[itemize,1]{label=\textbullet}% local 35 %\renewcommand{\labelitemi}{{\raisebox{0.25ex}{\footnotesize$\bullet$}}} 36 \setlist[enumerate]{listparindent=\parindent}% global 37 \setlist[enumerate,2]{leftmargin=\parindent,labelsep=*,align=parleft,label=\alph*.}% local 38 \setlist[description]{listparindent=\parindent,leftmargin=\parindent,labelsep=*} 39 19 40 % Names used in the document. 20 41 21 \newcommand{\CFA}{C$\mathbf\forall$\xspace} % set language symbolic name22 \newcommand{\CFL}{Cforall\xspace} % set language text name23 \newcommand{\CC}{ C\kern-.1em\hbox{+\kern-.25em+}\xspace} % CC symbolic name42 \newcommand{\CFA}{C$\mathbf\forall$\xspace} % set language symbolic name 43 \newcommand{\CFL}{Cforall\xspace} % set language text name 44 \newcommand{\CC}{\rm C\kern-.1em\hbox{+\kern-.25em+}\xspace} % CC symbolic name 24 45 \def\c11{ISO/IEC C} % C11 name (cannot have numbers in latex command name) 25 46 … … 27 48 28 49 \makeatletter 50 % parindent is relative, i.e., toggled on/off in environments like itemize, so store the value for 51 % use rather than use \parident directly. 52 \newlength{\parindentlnth} 53 \setlength{\parindentlnth}{\parindent} 54 29 55 % allow escape sequence in lstinline 30 56 %\usepackage{etoolbox} 31 57 %\patchcmd{\lsthk@TextStyle}{\let\lst@DefEsc\@empty}{}{}{\errmessage{failed to patch}} 32 58 33 % make fontsize "small" slightly larger, specifically for san serif (helvetica) in program code 34 \renewcommand\small{% 35 \@setfontsize\small{8.5}{11}% 36 \abovedisplayskip 8.5pt \@plus 3pt \@minus 4pt 37 \abovedisplayshortskip \z@ \@plus 2pt 38 \belowdisplayshortskip 4pt \@plus 2pt \@minus 2pt 39 \def\@listi{\leftmargin\leftmargini 40 \topsep 4pt \@plus 2pt \@minus 2pt 41 \parsep 2pt \@pluspt \@minuspt 42 \itemsep \parsep}% 43 \belowdisplayskip \abovedisplayskip 44 } 45 \usepackage{relsize} % must be after change to small or selects old size 59 \usepackage{pslatex} % reduce size of san serif font 60 \usepackage{relsize} % must be after change to small or selects old size 46 61 47 62 % reduce size of chapter/section titles … … 66 81 \vskip 50\p@ 67 82 }} 68 \renewcommand\section{\@startsection{section}{1}{\z@}{-3. 0ex \@plus -1ex \@minus -.2ex}{1.0ex \@plus .2ex}{\normalfont\large\bfseries}}69 \renewcommand\subsection{\@startsection{subsection}{2}{\z@}{- 2.5ex \@plus -1ex \@minus -.2ex}{1.0ex \@plus .2ex}{\normalfont\normalsize\bfseries}}83 \renewcommand\section{\@startsection{section}{1}{\z@}{-3.5ex \@plus -1ex \@minus -.2ex}{1.75ex \@plus .2ex}{\normalfont\large\bfseries}} 84 \renewcommand\subsection{\@startsection{subsection}{2}{\z@}{-3.25ex \@plus -1ex \@minus -.2ex}{1.5ex \@plus .2ex}{\normalfont\normalsize\bfseries}} 70 85 \renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}{-2.5ex \@plus -1ex \@minus -.2ex}{1.0ex \@plus .2ex}{\normalfont\normalsize\bfseries}} 71 86 \renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}{-2.0ex \@plus -1ex \@minus -.2ex}{-1em}{\normalfont\normalsize\bfseries}} … … 75 90 \newcommand{\definition}[1]{\textbf{\hyperpage{#1}}} 76 91 \newcommand{\see}[1]{\emph{see} #1} 77 78 % reduce bullet size and spacing for "itemize" macro79 \renewcommand{\labelitemi}{{\raisebox{0.25ex}{\footnotesize$\bullet$}}}80 \renewenvironment{itemize}{\begin{list}{\labelitemi}{\topsep=5pt\itemsep=5pt\parsep=0pt}}{\end{list}}81 92 82 93 % Define some commands that produce formatted index entries suitable for cross-references. … … 109 120 \newcommand{\@sIndex}[2][\@empty]{#2\ifx#1\@empty\index{#2}\else\index{#1@{\protect#2}}\fi} 110 121 122 \newcommand{\Indexc}[1]{\lstinline$#1$\index{#1@\lstinline$#1$}} 123 \newcommand{\indexc}[1]{\index{#1@\lstinline$#1$}} 124 111 125 \newcommand{\newtermFontInline}{\emph} 112 126 \newcommand{\newterm}{\@ifstar\@snewterm\@newterm} … … 116 130 117 131 \newenvironment{quote2}{% 118 \list{}{\lstset{resetmargins=true }\leftmargin=\parindent\rightmargin\leftmargin}%132 \list{}{\lstset{resetmargins=true,aboveskip=0pt,belowskip=0pt}\topsep=4pt\parsep=0pt\leftmargin=\parindent\rightmargin\leftmargin}% 119 133 \item\relax 120 134 }{% … … 122 136 }% quote2 123 137 \newenvironment{rationale}{% 124 \begin{quot ation}\noindent$\Box$\enspace138 \begin{quote2}\noindent$\Box$\enspace 125 139 }{% 126 \hfill\enspace$\Box$\end{quot ation}140 \hfill\enspace$\Box$\end{quote2} 127 141 }% 128 142 129 143 % blocks and titles 130 144 \newcommand{\define}[1]{\emph{#1\/}\index{#1}} 131 \newcommand{\rewrite}{\(\Rightarrow\)}132 145 \newcommand{\rewriterules}{\paragraph{Rewrite Rules}~\par\noindent} 133 146 \newcommand{\examples}{\paragraph{Examples}~\par\noindent} … … 137 150 138 151 % BNF macros 139 \def\syntax{\paragraph{Syntax}\trivlist\parindent=.5in\item[\hskip.5in]} 140 \let\endsyntax=\endtrivlist 141 \newcommand{\lhs}[1]{\par{\emph{#1:}}\index{#1@{\emph{#1}}|italic}} 142 \newcommand{\rhs}{\hfil\break\hbox{\hskip1in}} 143 \newcommand{\oldlhs}[1]{\emph{#1: \ldots}\index{#1@{\emph{#1}}|italic}} 144 \newcommand{\nonterm}[1]{\emph{#1\/}\index{#1@{\emph{#1}}|italic}} 152 \newenvironment{syntax}{ 153 \paragraph{Syntax} 154 \begin{quote2} 155 \begin{description}[noitemsep,leftmargin=\parindentlnth] 156 }{ 157 \end{description} 158 \end{quote2} 159 } 160 % \def\syntax{\paragraph{Syntax}\trivlist\parindent=.5in\item[\hskip.5in]} 161 %\let\endsyntax=\endtrivlist 162 \newcommand{\lhs}[1]{\item[\emph{#1:}\index{#1@{\emph{#1}}|italic}]~\ignorespaces} 163 \newcommand{\oldlhs}[1]{\item[\emph{#1:}\index{#1@{\emph{#1}}|italic}~\dots]~} 164 \newcommand{\rhs}{\hfil\newline} 165 \newcommand{\nonterm}[1]{\emph{#1}\index{#1@{\emph{#1}}|italic}} 145 166 \newcommand{\opt}{$_{opt}$\ } 146 167 … … 179 200 fallthru,finally,forall,ftype,_Generic,_Imaginary,inline,__label__,lvalue,_Noreturn,otype,restrict,_Static_assert, 180 201 _Thread_local,throw,throwResume,trait,try,typeof,__typeof,__typeof__,}, 181 moredelim=**[is][\color{red}]{`}{`}, % red highlighting of program text182 202 }% 183 203 … … 185 205 language=CFA, 186 206 columns=flexible, 187 basicstyle=\sf\relsize{-1}, 207 basicstyle=\linespread{0.9}\sf, 208 stringstyle=\tt, 188 209 tabsize=4, 189 xleftmargin=\parindent, 190 escapechar=@, 210 xleftmargin=\parindentlnth, 211 extendedchars=true, 212 escapechar=§, 191 213 mathescape=true, 192 214 keepspaces=true, 193 215 showstringspaces=false, 194 216 showlines=true, 195 aboveskip=6pt, 196 belowskip=4pt, 197 literate={\\`}{\raisebox{0.3ex}{\ttfamily\upshape \hspace*{-2pt}`}}1, % escape \`, otherwise used for red highlighting 217 aboveskip=4pt, 218 belowskip=3pt, 219 moredelim=**[is][\color{red}]{®}{®}, % red highlighting 220 moredelim=**[is][\color{blue}]{ß}{ß}, % blue highlighting 221 moredelim=**[is][\color{OliveGreen}]{¢}{¢}, % green highlighting 222 moredelim=[is][\lstset{keywords={}}]{¶}{¶}, % temporarily turn off keywords 223 % replace/adjust listing characters that look bad in sanserif 224 literate={-}{\raisebox{-0.15ex}{\texttt{-}}}1 {^}{\raisebox{0.6ex}{$\scriptscriptstyle\land\,$}}1 225 {~}{\raisebox{0.3ex}{$\scriptstyle\sim\,$}}1 {_}{\makebox[1.2ex][c]{\rule{1ex}{0.1ex}}}1 {`}{\ttfamily\upshape\hspace*{-0.1ex}`}1 226 {<-}{$\leftarrow$}2 {=>}{$\Rightarrow$}2 {...}{$\dots$}2, 198 227 }% 199 228 200 \makeatletter 201 % replace/adjust listings characters that look bad in sanserif 202 \lst@CCPutMacro 203 \lst@ProcessOther{"22}{\lst@ttfamily{"}{\raisebox{0.3ex}{\ttfamily\upshape "}}} % replace double quote 204 \lst@ProcessOther{"27}{\lst@ttfamily{'}{\raisebox{0.3ex}{\ttfamily\upshape '\hspace*{-2pt}}}} % replace single quote 205 \lst@ProcessOther{"2D}{\lst@ttfamily{-}{\ttfamily\upshape -}} % replace minus 206 \lst@ProcessOther{"3C}{\lst@ttfamily{<}{\texttt{<}}} % replace less than 207 \lst@ProcessOther{"3E}{\lst@ttfamily{<}{\texttt{>}}} % replace greater than 208 \lst@ProcessOther{"5E}{\raisebox{0.4ex}{$\scriptstyle\land\,$}} % replace circumflex 209 \lst@ProcessOther{"5F}{\lst@ttfamily{\char95}{{\makebox[1.2ex][c]{\rule{1ex}{0.1ex}}}}} % replace underscore 210 \lst@ProcessOther{"60}{\lst@ttfamily{`}{\raisebox{0.3ex}{\ttfamily\upshape \hspace*{-2pt}`}}} % replace backquote 211 \lst@ProcessOther{"7E}{\raisebox{0.3ex}{$\scriptstyle\sim\,$}} % replace tilde 212 %\lst@ProcessOther{"7E}{\raisebox{-.4ex}[1ex][0pt]{\textasciitilde}} % lower tilde 213 \@empty\z@\@empty % NECESSARY DO NOT REMOVE 214 \makeatother 229 \lstMakeShortInline© % single-character for \lstinline 215 230 216 231 % Local Variables: %
Note:
See TracChangeset
for help on using the changeset viewer.