6

I have a weird "bug" in my table. For some reason one asterisk does not show up. I am using LuaLaTex which as I understand it uses Unicode so all these weird glyphs I've got in my table should be fine being printed directly and they all are, except that one asterisk! And the weird thing is that if I add a second asterisk, one appears. I have tried the table without tcolorbox and with tabular instead of tabularx and neither brings back the asterisk. I am stumped.

What it looks like:

enter image description here

This is my code:

\documentclass[12pt,a4paper,openany]{book}
\usepackage{fontspec}
\setmainfont[Numbers=OldStyle,Ligatures=TeX]{linux libertine}

\usepackage{polyglossia} \setdefaultlanguage{icelandic}

\usepackage{tcolorbox} \usepackage{tabularx}

\begin{document} \begin{table}[h!]% \begin{footnotesize}

\begin{tcolorbox} \begin{center} \begin{tabularx}{0.9\textwidth}{lXX} Stofn & Tenging við [GULUR] & Orð af sama stofni \ \hline ƀlaikaz & gamalháþýska: \textit{bleih} ‘gulleitur, fölur’ & is. \textit{bleikur}; \ & & dk. \textit{bleg} ‘fölur’; \ & & en. \textit{bleak} ‘hráslagalegur’ \ \hline ƀlēwaz & skylt latnesku \textit{flāvus} ‘gullingulur’; & is. \textit{blár}; \ & fornírska \textit{blár} ‘gulur’ & dk. \textit{blå} ‘blár’; \ & & en. \textit{blue} ‘blár’ \ \hline falvaz & fornenska \textit{fealu} ‘gulbrúnn, gulur’; & is. \textit{fölur}; \ & gamalsaxneska \textit{falu} ‘fölgulur’; & en. \textit{fallow} ‘gulbrúnn’ \ & fornháþýska \textit{falo} ‘fölur, rauðgulur’; & \ & slavneska \textit{polь} ‘gulur, hvítleitur’ & \ \hline ʒallan & talið skylt \textit{g̑hel}- & is. \textit{gall}; \ ʒallōn & sanskrít \textit{hári} ‘fölur, gulleitur, grænleitur’; & en. \textit{gall} ‘ósvífni’ \ & avestíska \textit{zairi} ‘gulur, gulleitur’ & \ \hline ʒelwaz & fornenska \textit{ʒeolu} ‘gulur’; & is. \textit{gulur}; \ & skylt sanskrít \textit{gaurá}- ‘hvítleitur, gulleitur’; & dk. \textit{gul} ‘gulur’; \ & latína \textit{giluus} ‘fölgulur’; & en. \textit{yellow} ‘gulur’ \ & latína \textit{fuluus} ‘skærgulur’ & \ \hline ʒlōraz & sama og gríska \textit{khlorós} ‘grænleitur gulur’ & is. \textit{glor} ‘gulgrár hungurlitur’; \ & & en. \textit{chlorine} ‘klór(gas)’ \ \hline ʒlūmaz & skylt grísku \textit{khloús} ‘grænleitur gulur’ & is. \textit{Glúmur} ‘björn’; \ & & en. \textit{glum} ‘dökkur, daufur, leiður’ \ \hline xunaʒgan & tengt grísku \textit{knikós} ‘fölgulur’ & is. \textit{hunang}; \ & & en. \textit{honey} ‘hunang’ \ \hline pađđōn & fornírska \textit{buide} ‘gulur’ & is. \textit{padda}; \ & & dk. \textit{padde} ‘froskur’ \ \hline *salwaz & fornnorræna \textit{sǫlr} ‘gulur’ & is. \textit{söl} \ & miðhollenska \textit{salu} ‘skítugur, fölur, gulur’ & en. \textit{sallow} ‘gugginn, fölur’ \ \end{tabularx} \end{center} \end{tcolorbox} \end{footnotesize} \caption{Germanskir stofnar íslenskra litaorða} \label{tafla:gulur} \end{table} \end{document}

I realise that since I've technically found a solution (adding the second asterisk) it wouldn't be a problem, per se, but this is really bugging me. So if anyone has any ideas why this would be happening, please tell me.

Plergux
  • 874
  • 2
    Aside from the question itself, its title is perfect for a 7+ imdb-rated thriller :) – Diaa Nov 20 '20 at 17:27
  • 4
    The line-ending \\ scans for the following token since \\* is a valid command. Use \\\relax on the previous line. – Werner Nov 20 '20 at 17:29
  • That's "normal". \\ looks for a * and absorbs it. – campa Nov 20 '20 at 17:30
  • 2
    If you like to live dangerously, just before the tabularx environment, you can add \makeatletter \def\@arraycr{\relax\iffalse{\fi\ifnum 0=`}\fi\@xarraycr} \makeatother to disable scanning for the * – Phelype Oleinik Nov 20 '20 at 17:41
  • 1
    @PhelypeOleinik usually I would jump at the chance to live dangerously but this is my doctoral thesis so I think I'll have to err on the side of caution this time. :p (but I will put this code into my example file and save it to play with at a later date). – Plergux Nov 20 '20 at 17:43
  • 1
    @PhelypeOleinik You hothead daredevil :-) – campa Nov 20 '20 at 17:43
  • 1
    @Plergux I know what you mean :-) I have a copy of TeX Live installed just so an update won't accidentally break mine – Phelype Oleinik Nov 20 '20 at 17:45
  • @Fran, Yes, thank you. I will add it to my "documentation" :) – Plergux Nov 21 '20 at 11:00

1 Answers1

4

A very simple document

\documentclass{article}
\usepackage{tabularx}
\begin{document}
\begin{tabularx}{5cm}{lX}
\show\\
\end{tabularx}
\end{document}

gives the terminal output

> \\=macro:
->\relax \iffalse {\fi \ifnum 0=`}\fi \@ifstar \@xarraycr \@xarraycr .

Apart from the brace hack, there is a \@ifstar followed by two occurrences of the same macro \@xarraycr. This means that both \\ and \\* have the same effect. Now, the \@ifstar macro is based on \@ifnextchar, which does a good job at ignoring spaces after it. The side effect in cases like this is that a \\ followed by a new line follwed by * is interpreted as \\*. You must therefore "stop" the scanning of \@ifnextchar and use e.g. \\ \relax if your line starts with a *.

campa
  • 31,130