4

MWE

\documentclass[a4paper,11pt]{report}
\usepackage[turkish]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{calculator} % 2014/02/20 v.2.0
\usepackage{calculus}   % 2014/02/20 v.2.0

\begin{document}

Ş ş Ç ç % Before

\newcommand\gga{10}
\newcommand\ggb{30}
\newcommand\ggc{5}
\newcommand\ggd{5}
\newcommand\gge{10}
\newcommand\ggf{9}

\ADD{\gga}{\ggb}\a
\ADD{\ggc}{\ggd}\b
%\ADD{\gge}{\ggf}\c %<----- This Line

Ş ş Ç ç % After

\end{document}

and output,

enter image description here

no problem. But added the This Line,

enter image description here

How is it changing macro in MWE?

  • 4
    Don't use single letters like this: many are already defined to mark accents (e.g., \b, \c, \d, \H, \k, \r, \t, \u, \v). – jon Oct 11 '15 at 6:17
  • 3
    A colleague of mine had an issue with a paper; I discovered that he was redefining \c (to \gamma, because he knew Greek), but that particular paper had a Turkish coauthor whose surname started with Ş. Don't use \def unless you have a good reason to; packages such as calculator that do redefinitions without any check are to be avoided, in my opinion. Use some distinguishable prefix, like you did at the beginning. – egreg Oct 11 '15 at 9:39
7

Change your code to:

\documentclass[a4paper,11pt]{report}
\usepackage[turkish]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{calculator} % 2014/02/20 v.2.0
\usepackage{calculus}   % 2014/02/20 v.2.0

\begin{document}

Ş ş Ç ç % Before

\newcommand\gga{10}
\newcommand\ggb{30}
\newcommand\ggc{5}
\newcommand\ggd{5}
\newcommand\gge{10}
\newcommand\ggf{9}

\ADD{\gga}{\ggb}\sola
\ADD{\ggc}{\ggd}\solb
\ADD{\gge}{\ggf}\solc %<----- This Line

\show\c  \show\solc  % Look into the log file

Ş ş Ç ç % After

\end{document}

It seems that your used macro \c has another definition and gives the problem. Follow the documentation and use varaiables \solx for your solutions. Change x to what you need, for example c.

With \show you can see in the log file, what the following macro means. The result for my MWE is:

> \c=macro:
->\T1-cmd \c \T1\c .
l.25 \show\c
              \show\solc

> \solc=macro:
->19.

You see, macro \solc has the value 19.

Result in your pdf:

enter image description here

At last the reason for this behaviour is that \usepackage[utf8]{inputenc} translates Ş into \c{S} (and similarly for the other letters with the cedilla). \c marks the "cedillia" that is added to the following letter (here in the example S). Now you redefined the cedillia to 19 so you get at last \c{S} --> 19{S} --> 19S. And so redefining \c is definitely a bad idea, especially for Turks (Thanks to @egreg for his great comment!)

  • Oh my God. I don't believe that. :). – Özgür Oct 11 '15 at 6:21
  • 1
    @Özgür In LaTeX exists a lot of predefined macros. \c marks the accent you used in your text line. Thats the reason you got 19 (new content of \c) followed by S etc. (Sorry, I do not know the english name of this accent) – Mensch Oct 11 '15 at 6:28
  • 1
    According to Wikipedia, the under accent is called “Çengel işareti” or “Sedil” in Turkish and “cedilla” in English. “Cedille" in German. You could add that the utf8 option to inputenc translates Ş into \c{S} (and similarly for the other letters with the cedilla), so redefining \c is definitely a bad idea, especially for Turks. – egreg Oct 11 '15 at 9:42
  • 1
    @egreg Thanks, I added your comment to my answer. I hope that is okay for you?! – Mensch Oct 12 '15 at 21:25

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.