I know I am sounding crazy, but this looks like a veritable pdflatex bug to me. even small innocent changes to the file make it go away.
\documentclass[12pt]{article}
\usepackage[english]{babel} %% hyphenation and other small changes
\RequirePackage[T1]{fontenc} %% hyphenation of accented words, copy-paste pdf output, pipe sign, less than ,etc.
\RequirePackage{charter} %% the main font, scaleable
\usepackage{microtype} %% should always be the default
\newcommand{\textxsmally}[1]{#1}
\newcommand{\lmc}[1]{$\backslash$#1}
\begin{document}
\lmc{textbf} (\textbf{bold}) an \lmc{textsf} (\textsf{sans-serif}), and define \lmc{textxsmall} (\textxsmally{anything}).
\end{document}
just removing even some obviously innocent characters in the text, and, poof, it is gone.
this is under
pdfTeX 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian)
kpathsea version 6.1.1
Copyright 2013 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
There is NO warranty. Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
Compiled with libpng 1.2.49; using libpng 1.2.49
Compiled with zlib 1.2.8; using zlib 1.2.8
Compiled with poppler version 0.24.1
and it only rears its head under pdflatex, not under latex (which is of course also pdftex).
is there something wrong with my install or can this be replicated elsewhere?
UPDATE: This is a little more interesting. If you look at the example above, realize that I did not (want to) use the computer modern fonts, but charter fonts, which are scaleable.
One way to eliminate the bug is to remove the microtype, which apparently is doing font expansion (whatever this may be). Searching the log file for pk tells me the culprit: fonts/pk/ljfour/jknappen/ec/ecss1200.600pk. I did not realize that we were even using them. pdffonts tells me
$ pdffonts ...pdf
name type encoding emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
HAJUBM+CMSY10 Type 1 Builtin yes yes no 4 0
CZKSHZ+CharterBT-Roman Type 1 Custom yes yes no 5 0
KMKFIH+CharterBT-Bold Type 1 Custom yes yes no 6 0
[none] Type 3 Custom yes no no 7 0
hmmm...maybe the first font is the problem. I did not believe that any CMS fonts were still being used, once I usepackage{charter}. but I was mistaken. obviously CMSY10 is still there, as is some unidentified Type-3 font.
so, I need to get rid of bitmap CMR fonts, even though I do not want to use them. I can do so by including package lmodern before package charter, even though I do not believe any of its fonts are actually used. So, this worked for me:
\documentclass[12pt]{article}
\usepackage[english]{babel} %% hyphenation and other small changes
\usepackage[T1]{fontenc} %% hyphenation of accented words, copy-paste pdf output, pipe sign, less than ,etc.
\usepackage{lmodern}
\usepackage{charter} %% the main font, scaleable
\usepackage{microtype} %% should always be the default
\newcommand{\textxsmally}[1]{#1}
\newcommand{\lmc}[1]{$\backslash$#1}
\begin{document}
\lmc{textbf} (\textbf{bold}) an \lmc{textsf} (\textsf{sans-serif}), and define \lmc{textxsmall} (\textxsmally{anything}).
\end{document}
and the resulting font output is
name type encoding emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
CQLPTE+LMMathSymbols10-Regular Type 1 Custom yes yes no 4 0
CZKSHZ+CharterBT-Roman Type 1 Custom yes yes no 5 0
KMKFIH+CharterBT-Bold Type 1 Custom yes yes no 6 0
OHZRNJ+LMSans12-Regular Type 1 Custom yes yes no 7 0
hope this helps some other hapless soul(s).
/iaw
\usepackage{lmodern}. – egreg Jan 28 '14 at 20:46\RequirePackageto\usepackage. This is unrelated to the error but is a good practice. – marczellm Jan 28 '14 at 20:49cm-superpackage or load the Latin-Modern-Fonts. – Jan 28 '14 at 21:14charteronly sets the main (roman) font, while sanserif (ecss1200) and maths (cmsy10) fonts will still be Computer Modern. With thelmodernpackage, you can solve themicrotypeproblem (not bug!), but it would actually be preferable to loadmathdesignwith thecharteroption to get a matching maths font, and to choose an appropriate sanserif one as well. – Robert Jan 30 '14 at 17:27