8

The complexity package redefines \L so you don't get an L with a stroke through it (that is Ł). How can you still get that Polish letter when using the package? Here is an example:

\documentclass[a4paper,10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[bold,basic]{complexity}

\begin{document}
Even Ł gets rendered as a bold L.
\begin{thebibliography}{50}
\bibitem{GKKLS:2015} Homer J.  {\L}{\k{a}}cki. \textsl{Mmmmm...donuts}.
\end{thebibliography}
\end{document}

I particularly want to use it in the bibliography.

  • 2
    Don't use complexity, that's all. Really, if a package does something like this, it goes against all basic LaTeX conventions. – egreg Sep 15 '17 at 21:49
  • You state that you use utf8 in your preamble - why don't you just type the Ł? – nhck Sep 15 '17 at 21:49
  • @nhck I added an example to the question. Even if you add Ł you get a bold L when using the complexity package. – Lembik Sep 15 '17 at 21:51
  • 2
    @Lembik The package has been updated! :-D Add the disableredefinitions option and it's all. – egreg Sep 17 '17 at 13:57
8

The package has

% We redefine 4 commands inside of Latex, but preserve them for usage

\let\defaultL\L
\renewcommand{\L}{\ComplexityFont{L}}
\let\defaultP\P
\renewcommand{\P}{\ComplexityFont{P}}
\let\defaultS\S
\renewcommand{\S}{\ComplexityFont{S}}

This goes against all basic LaTeX conventions of not redefining macros that pertain to the LaTeX internal character representation (LICR). There should at least be an option for not redefining \L, \P and \S.

The workaround of using \defaultL, \defaultP and \defaultS mentioned in the manual is ineffective, because if one types Ł, or § using UTF-8, the result will be L, P and S respectively, because the UTF-8 characters are translated back in the LICR to \L, \P and \S. There should be, at least, an option for avoiding those redefinitions.

However, it's easy to go back:

\documentclass[a4paper,10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[bold,basic]{complexity}

% fix the bad mistake in complexity.sty
\let\L\defaultL
\let\P\defaultP
\let\S\defaultS

\begin{document}
Even Ł gets rendered as a bold L.
\begin{thebibliography}{50}
\bibitem{GKKLS:2015} Homer J.  {\L}{\k{a}}cki. \textsl{Mmmmm...donuts}.
\end{thebibliography}
\end{document}

enter image description here

UPDATE

As of version 0.81a of the complexity package, released 2017-09-16, the disableredefinitions option is available. With the option, \L, \P and \S are not redefined and instead \cL, \cP and \cS can be used as shorthands for \ComplexityFont{L}, \ComplexityFont{P} and \ComplexityFont{P}.

\documentclass[a4paper,10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[bold,basic,disableredefinitions]{complexity}

\begin{document}
Now Ł gets rendered correctly and \cL{} prints the class

\begin{thebibliography}{1}

\bibitem{GKKLS:2015} Homer J.  {\L}{\k{a}}cki. \textsl{Mmmmm...donuts}.

\end{thebibliography}

\end{document}

enter image description here

  • Thank you. How does it manage to stop Ł being rendered correctly? – Lembik Sep 15 '17 at 21:54
  • 3
    @Lembik The package redefines \L and the UTF-8 character Ł is internally translated into \L again. – egreg Sep 15 '17 at 21:55
  • 4
    I filed a bug report to the package author – egreg Sep 15 '17 at 22:26
1

This is from the package documentation

Three commands in the complexity package override built-in T E X commands. Specifically, \L (which typesets the symbol L), \P (typesetting ¶ ), and \S (which typesets the symbol § ) are all redefined for use in the package. The complexity package preserves these commands so that you may still use them. To use any of these symbols, use the commands \defaultL , \defaultP , and \defaultS instead

  • 2
    This workaround is useless, I'm afraid, because typing Ł will print a boldface L anyhow. Similarly when one types or §. The package author should have thought better. – egreg Sep 15 '17 at 21:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.