Update, much later
Don’t do this. Change the font instead. This just causes much trouble in unexpected and hard-to-debug places. See the other answer to the same question for details.
changing the direction of the slash of the digit zero
In this answer I learned how to change the direction of the slash through the digit 0
inside a texttt
block. This works fine, except it doesn’t work in a ticket environment.
Note we use pdflatex (run twice).
business cards
\documentclass[a4paper,11pt]{article}
\usepackage[zw32010,boxed]{ticket}% for debugging
\RequirePackage[utf8]{inputenc}
\RequirePackage[pdftex]{graphics}
\RequirePackage{ngerman}
\RequirePackage[ngerman]{babel}
\RequirePackage[T1]{fontenc}
\RequirePackage{pxfonts}
\renewcommand{\familydefault}{\sfdefault}
\newcommand\0{\scalebox{-1}[1]{0}}
\let\svttfamily\ttfamily
\let\svtexttt\texttt
\catcode`0=\active
\def0{\0}
\renewcommand\ttfamily{\svttfamily\catcode`0=\active }
\renewcommand\texttt{\bgroup\ttfamily\texttthelp}
\def\texttthelp#1{#1\egroup}
\catcode`0=12
\renewcommand{\ticketdefault}{
\put(1,46){\LARGE SSCCE}
\put(2,38){texttt:}
\put(2,32){implicit:}
\put(2,26){explicit:}
}
\newcommand{\vcard}[1]{\ticket{
\put(30,38){\texttt{#1}}
\put(30,32){\ttfamily #1}
\put(30,26){\ttfamily\catcode`0=\active #1}
}}
\begin{document}
\vcard{x0y}
\vspace{10cm}
Outside, \texttt{a0b} with texttt.
\end{document}
As you can see, the slash through the 0
is from bottom-left to top-right outside, but I can’t seem to get it working for inside the business card. I thought this was because of \put
at first, but placing the text of the \ticketdefault
or \ticket
in there “raw”, i.e. not inside a \put
, doesn’t fix it either:
\newcommand{\vcard}[1]{\ticket{
Outside \texttt{m0n} with texttt.
\put(30,38){\texttt{#1}}
\put(30,32){\ttfamily #1}
\put(30,26){\ttfamily\catcode`0=\active #1}
}}
(same for \ticketdefault
)
tables
\RequirePackage[utf8]{inputenc}
\RequirePackage[pdftex]{graphics}
\RequirePackage[T1]{fontenc}
\RequirePackage{textcomp}
\RequirePackage{graphicx}
\RequirePackage{pxfonts}
\renewcommand{\familydefault}{\sfdefault}
\RequirePackage{hyphenat}
\documentclass{scrartcl}
\newcommand\0{\scalebox{-1}[1]{0}}
\let\svttfamily\ttfamily
\let\svtexttt\texttt
\catcode`0=\active
\def0{\0}
\renewcommand\ttfamily{\svttfamily\catcode`0=\active }
\renewcommand\texttt{\bgroup\ttfamily\texttthelp}
\def\texttthelp#1{#1\egroup}
\catcode`0=12
\usepackage{tabu}
\usepackage{longtable}
\usepackage[export]{adjustbox}
\begin{document}
Das kann doch nicht sein! foo0bar \texttt{baz0blah} meh!
\begin{longtabu} to \linewidth {|@{}c@{}|X|X|l|l|l|l|}
\hline\rowfont\bfseries Foto & Nachname & Vorname & Geburts\-datum & Benutzer & Fahrt & Fahr\-karte \\\hline
\endhead
x & \nohyphens{Lastname} & \nohyphens{Firstname} & \nohyphens{1970-01-01} & \texttt{hal2001} & \nohyphens{nein} & \nohyphens{nein}\\\hline
\end{longtabu}
\end{document}
As can be seen, this also does not work in tables ☹