LaTeX forum ⇒ Text FormattingApostrophe in title section gets rendered as a section symbol

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Tolaso
Posts: 37
Joined: Tue Dec 20, 2016 12:23 am

Apostrophe in title section gets rendered as a section symbol

Postby Tolaso » Sat Apr 07, 2018 12:43 pm

I'm not sure if this is the proper forum to post the question but here goes.

I'm using the memoir document class to typeset a book for my math class. However, when I type the section

  1. \section{Κανόνας \textlatin{DeL' Hospital}}


while in the TOC it gets printed right as

Κανόνας DeL' Hospital

in the header of the current chapter it gets printed as

Στιγμιότυποαπό2018-04-0713-36-19.jpg
Στιγμιότυποαπό2018-04-0713-36-19.jpg (5 KiB) Viewed 366 times


I'm presenting the entire preamble since in a vanilla document I cannot reproduce the problem , although in the header of the vanilla I don't get that weird symbol but I got ' either.

  1. \documentclass[11pt, a4paper]{memoir}
  2. \usepackage{amsmath}
  3. \usepackage{amsfonts}
  4. \usepackage{amssymb}
  5. \usepackage{amsthm}
  6. \renewcommand\qedsymbol{$\blacklozenge$}
  7. \usepackage[shortlabels]{enumitem}
  8. \usepackage{cancel}
  9. \usepackage{bigints}
  10. \usepackage[most]{tcolorbox}
  11. \usepackage[utf8]{inputenc}
  12. \usepackage[english, greek]{babel}
  13. \usepackage{multicol}
  14.  
  15. %chapter style ( Bringhurst chapter style)
  16.  
  17. \usepackage[T1]{fontenc}
  18. % not then font used by Bringhurst, but anyway:
  19. \usepackage{libertine}
  20. % we want to letterspace uppercased words and those in small caps, so:
  21. \usepackage{microtype}
  22.  
  23. % the chapter style:
  24. \usepackage{xcoffins,xcolor}
  25. \NewCoffin\main
  26. \NewCoffin\titleline
  27. \NewCoffin\chapternumber
  28.  
  29. \makechapterstyle{Bringhurst}{%
  30. \renewcommand*\chapterheadstart{}
  31. \renewcommand*\printchaptername{}
  32. \renewcommand*\chapternamenum{}
  33. \renewcommand*\afterchapternum{}
  34. % numbered chapters:
  35. \renewcommand*\printchapternum{%
  36. \SetHorizontalCoffin\chapternumber{%
  37. \textcolor{black!10}{\thechapter}%
  38. }%
  39. \ScaleCoffin\chapternumber{8}{8}%
  40. }
  41. % unnumbered chapters:
  42. \renewcommand*\printchapternonum{\SetHorizontalCoffin\chapternumber{}}
  43. \renewcommand*\printchaptertitle[1]{%
  44. \memRTLraggedright\normalfont\large\MakeUppercase{\textls[75]{##1}}}
  45. \renewcommand*\afterchaptertitle{%
  46. \vskip.5\onelineskip
  47. \SetHorizontalCoffin\titleline{\color{black!50}\rule{\linewidth}{1.5pt}}%
  48. \JoinCoffins\main\titleline
  49. \JoinCoffins*\main\chapternumber(\textwidth+\marginparsep,-4\baselineskip)%
  50. \TypesetCoffin\main
  51. \vskip\onelineskip
  52. }
  53. }
  54.  
  55. \chapterstyle{Bringhurst}
  56.  
  57. % sections and subsections:
  58. \setsecnumformat{\normalfont\csname the#1\endcsname\quad}
  59. \setsecnumdepth{subsection}
  60. \setcounter{secnumdepth}{2}
  61. \maxtocdepth{subsection}
  62.  
  63. %tcolorbox
  64.  
  65. \usepackage{tcolorbox}
  66.  
  67. %tikz & pgf
  68.  
  69. \usepackage{pgf,tikz}
  70. \usepackage{pgfplots}
  71. \pgfplotsset{compat=1.11}
  72. \usepackage{tkz-tab}
  73. \usetikzlibrary{fit, shapes,snakes,arrows,intersections, backgrounds,calc, trees, hobby}
  74. \usetikzlibrary{scopes,svg.path,shapes.geometric,shadows}
  75. \usetikzlibrary{positioning}
  76. \tikzset{point/.style={circle,draw=black,inner sep=0pt,minimum size=3pt}}
  77. \usetikzlibrary{datavisualization.formats.functions}
  78.  
  79. \newcommand*\circled[1]{\tikz[baseline=(char.base)]{%
  80. \node[shape=circle, fill=cyan!20!,draw,inner sep=2pt] (char) {#1};}}
  81.  
  82. %horizontal nested sets for numbers
  83.  
  84. \newcommand\drawnestedsets[4]{
  85. % initial position
  86. \def\position{#1}
  87. % number of sets
  88. \def\nbsets{#2}
  89. % list of sets
  90. \def\listofnestedsets{#3}
  91. % reversed list of colors
  92. \def\reversedlistofcolors{#4}
  93.  
  94. % position and draw labels of sets
  95. \coordinate (circle-0) at (#1);
  96. \coordinate (set-0) at (#1);
  97. \foreach \set [count=\c] in \listofnestedsets {
  98. \pgfmathtruncatemacro{\cminusone}{\c - 1}
  99. % label of current set (below previous nested set)
  100. \node[right=3pt of circle-\cminusone,inner sep=0]
  101. (set-\c) {$\mathbb{\set}$};
  102. % current set (fit current label and previous set)
  103. \node[ellipse,inner sep=0,fit=(circle-\cminusone)(set-\c)]
  104. (circle-\c) {};
  105. }
  106.  
  107. % draw and fill sets in reverse order
  108. \begin{scope}[on background layer]
  109. \foreach \col[count=\c] in \reversedlistofcolors {
  110. \pgfmathtruncatemacro{\invc}{\nbsets-\c}
  111. \pgfmathtruncatemacro{\invcplusone}{\invc+1}
  112. \node[ellipse,draw,fill=\col,inner sep=0,
  113. fit=(circle-\invc)(set-\invcplusone)] {};
  114. }
  115. \end{scope}
  116. }
  117.  
  118. %labeling figures
  119. \usepackage{caption}
  120. \usepackage{float}
  121.  
  122. %fontawesome
  123.  
  124. \usepackage{fontawesome}
  125. \renewcommand{\thefootnote}{\faBullhorn}
  126.  
  127. %custom commands / environments
  128.  
  129. \newtheorem*{sol}{Λύση}
  130. \renewcommand{\thepage}{\roman{page}}%
  131. \newtheorem{example}{Παράδειγμα}
  132. \DeclareSymbolFont{eulargesymbols}{U}{zeuex}{m}{n}
  133. \DeclareMathSymbol{\intop}{\mathop}{eulargesymbols}{"52}
  134.  
  135. %remove chapter enumeration in equations
  136.  
  137. \usepackage{chngcntr}
  138. \counterwithout{equation}{chapter}
  139.  
  140. %true or false boxes
  141.  
  142. \usepackage{tabularx}
  143. \newcounter{abc}
  144. \renewcommand{\theabc}{\stepcounter{abc}\alph{abc}}
  145. \newcommand{\answerbox}{\fbox{\phantom{M}}}
  146.  
  147. %floor function
  148.  
  149. \usepackage{pgfplots}
  150. \tikzset{
  151. declare function={Floor(\x)=round(\x-0.5);},
  152. declare function={Ceil(\x)=round(\x+0.5);}
  153. }
  154.  
  155.  
  156. \makeatletter
  157. \long\def\ifnodedefined#1#2#3{%
  158. \@ifundefined{pgf@sh@ns@#1}{#3}{#2}%
  159. }
  160. \newif\iffirstmarker
  161. \firstmarkertrue
  162.  
  163. \pgfplotsset{
  164. discontinuous/.style={
  165. scatter,
  166. options/.style={},
  167. execute at end plot visualization={\global\firstmarkertrue},
  168. scatter/@pre marker code/.code={
  169. \iffirstmarker
  170. \global\firstmarkerfalse
  171. \else
  172. \ifnodedefined{marker}{
  173. \pgfpointdiff{\pgfpointanchor{marker}{center}}%
  174. {\pgfpoint{0}{0}}%
  175. \ifdim\pgf@y>0pt
  176. \tikzset{options/.style={mark=*}}
  177. \draw [densely dashed] (marker-|0,0) -- (0,0);
  178. \draw plot [mark=*,mark options={fill=white}] coordinates {(marker-|0,0)};
  179. \else
  180. \ifdim\pgf@y<0pt
  181. \tikzset{options/.style={mark=*,fill=white}}
  182. \draw [densely dashed] (marker-|0,0) -- (0,0);
  183. \draw plot [mark=*] coordinates {(marker-|0,0)};
  184. \else
  185. \tikzset{options/.style={mark=none}}
  186. \fi
  187. \fi
  188. }{
  189. \tikzset{options/.style={mark=none}}
  190. }
  191. \fi
  192. \coordinate (marker) at (0,0);
  193. \begin{scope}[options]
  194. },
  195. scatter/@post marker code/.code={\end{scope}}
  196. }
  197. }
  198.  
  199. %complete gibberish
  200.  
  201. \usetikzlibrary{shadows.blur}
  202.  
  203. \usepackage{titletoc}
  204.  
  205. \usepackage{calc}
  206.  
  207. \definecolor{yourcolor}{HTML}{008bb2}
  208.  
  209. %define new chapter style (just for a nicer look)
  210. \makechapterstyle{mystyle}{%
  211. \chapterstyle{default}
  212. \renewcommand*{\chapnumfont}{\normalfont\Huge\sffamily\bfseries}
  213. \renewcommand*{\chaptitlefont}{\normalfont\huge\sffamily\itshape\color{yourcolor}}
  214. \settowidth{\chapindent}{\chapnumfont 111}
  215. \renewcommand*{\chapterheadstart}{}
  216. \renewcommand*{\chapnamefont}{\hfill\color{yourcolor}\normalfont\Huge\sffamily\bfseries}
  217. \renewcommand*{\printchapternum}{%
  218. \begin{tikzpicture}[baseline={([yshift=-.6ex]current bounding box.center)}]
  219. \node[fill=yourcolor,circle,text=white] {\thechapter};
  220. \end{tikzpicture}\\[1ex]
  221. \hrule height 1.5pt}
  222. \renewcommand*{\printchaptertitle}[1]{%
  223. {\chaptitlefont ##1}}
  224. }
  225.  
  226. %use new chapter style
  227. \chapterstyle{mystyle}
  228.  
  229. %command to print the acutal minitoc
  230. \newcommand{\printmyminitoc}{\noindent\hspace{-2cm}\begin{tikzpicture}
  231. \node[rounded corners,align=left,fill=yourcolor, blur shadow={shadow blur steps=5}, inner sep=5mm]{%
  232. \color{white}%
  233. \begin{minipage}{8cm}%minipage trick
  234. \printcontents[chapters]{}{1}{}
  235. \end{minipage}};
  236. \end{tikzpicture}}
  237.  
  238.  
  239. %plot of Weierstrass function
  240.  
  241. \makeatletter
  242. \pgfmathdeclarefunction{weierstrass}{4}{%
  243. \pgfmathfloattofixed@{#4}%
  244. \afterassignment\pgfmath@x%
  245. \expandafter\c@pgfmath@counta\pgfmathresult pt\relax%
  246. \pgfmathfloatcreate{1}{0.0}{0}%
  247. \let\pgfmathfloat@loc@TMPr=\pgfmathresult
  248. \pgfmathfloatpi@%
  249. \let\pgfmathfloat@loc@TMPp=\pgfmathresult%
  250. \edef\pgfmathfloat@loc@TMPx{#1}%
  251. \edef\pgfmathfloat@loc@TMPa{#2}%
  252. \edef\pgfmathfloat@loc@TMPb{#3}%
  253. \pgfmathloop
  254. \ifnum\c@pgfmath@counta>-1\relax%
  255. \pgfmathfloatparsenumber{\the\c@pgfmath@counta}%
  256. \let\pgfmathfloat@loc@TMPn=\pgfmathresult%
  257. \pgfmathpow{\pgfmathfloat@loc@TMPa}{\pgfmathfloat@loc@TMPn}%
  258. \let\pgfmathfloat@loc@TMPe=\pgfmathresult%
  259. \pgfmathpow{\pgfmathfloat@loc@TMPb}{\pgfmathfloat@loc@TMPn}%
  260. \pgfmathmultiply{\pgfmathresult}{\pgfmathfloat@loc@TMPp}%
  261. \pgfmathmultiply{\pgfmathresult}{\pgfmathfloat@loc@TMPx}%
  262. \pgfmathdeg{\pgfmathresult}%
  263. \pgfmathcos{\pgfmathresult}%
  264. \pgfmathmultiply{\pgfmathresult}{\pgfmathfloat@loc@TMPe}%
  265. \pgfmathadd{\pgfmathresult}{\pgfmathfloat@loc@TMPr}%
  266. \let\pgfmathfloat@loc@TMPr=\pgfmathresult
  267. \advance\c@pgfmath@counta by-1\relax%
  268. \repeatpgfmathloop%
  269. }
  270.  
  271. \begin{document}
  272.  
  273. \section{Κανόνας \textlatin{DeL' Hospital}}
  274.  
  275. \end{document}

Courtney McDaniel
Posts: 8
Joined: Mon Apr 16, 2018 11:04 am

Postby Courtney McDaniel » Mon Apr 16, 2018 11:51 am

Hah, I think that this problem is so common among beginners, even a post dedicated to it)

Thanks, it worked!


Return to “Text Formatting”

Who is online

Users browsing this forum: No registered users and 5 guests