Bei xltabular ist die ungerade Seite eine Zeile länger als die gerade Seite

Tabellen und Grafiken erstellen und anordnen


AaronK
Forum-Fortgeschrittener
Forum-Fortgeschrittener
Beiträge: 77
Registriert: So 2. Mai 2021, 09:29

Bei xltabular ist die ungerade Seite eine Zeile länger als die gerade Seite

Beitrag von AaronK »

Ich habe eine Tabelle, die sich über mehrere Seiten erstreckt. Ich habe festgestellt, dass die Tabelle auf der ungeraden Seite eine Zeile länger ist, als auf der geraden Seite. Wie korregiere ich den Fehler?

Damit das Minimalbeispiel läuft, habe ich die 2. Spalte l gesetzt. Da ich aber bei manchen Zeilen einen Umbruch brauche, habe ich folgende Zeile `\newcolumntype{F}{>{\RaggedRight\hspace{0pt}}X` gesetzt.
\documentclass[fontsize=10pt,paper=210mm:297mm,DIV=calc,open=any]{scrbook}               
\usepackage[outer=20mm,vscale=0.8]{geometry}

%% Packages
\usepackage{booktabs}
\usepackage{xltabular}

\begin{document}
{\renewcommand{\arraystretch}{1.1}
\begin{xltabular}{\textwidth}{@{}ll@{}}\toprule
\textbf{ITU Präfix} & \textbf{zugeteilt an} \\\midrule
\endhead
\texttt{AAA - ALZ} & United States of America \\
\texttt{AMA - AOZ} & Spain \\
\texttt{APA - ASZ} & Pakistan (Republic of) \\
\texttt{ATA - AWZ} & India (Republic of) \\
\texttt{AXA - AXZ} & Australia \\
\texttt{AYA - AZZ} & Argentinic Republic \\
\texttt{A2A - A2Z} & Botswana (Republik of) \\
\texttt{A3A - A3Z} & Tonga (Kingdom of) \\
\texttt{A4A - A4Z} & Oman (Sultanate of) \\
\texttt{A5A - A5Z} & Bhutan (Kingdom of) \\
\texttt{A6A - A6Z} & United Arab Emirates \\
\texttt{A7A - A7Z} & Qatar (State of) \\
\texttt{A8A - A8Z} & Liberia (Republic of) \\
\texttt{A9A - A9Z} & Bahrain (Kingdom of) \\
\texttt{BAA - BZZ} & China (People's Republic of) \\
\texttt{CAA - BEZ} & Chile \\
\texttt{CFA - CKZ} & Canada \\
\texttt{CLA - CMZ} & Cuba \\
\texttt{CNA - CNZ} & Morocco (Kingdom of) \\
\texttt{COA - COZ} & Cuba \\
\texttt{CPA - CPZ} & Bolivia (Republic of) \\
\texttt{CQA - CUZ} & Portual \\
\texttt{CVA - CXZ} & Uruguay (Eastern Republic of) \\
\texttt{CYA - CZZ} & Canada \\
\texttt{C2A - C2Z} & Nauru (Republic of) \\
\texttt{C3A - C3Z} & Andorra (Principality of) \\
\texttt{C4A - C4Z} & Cyprus (Republic of) \\
\texttt{C5A - C5Z} & Gambia (Republic of the) \\
\texttt{C6A - C6Z} & Bahamas (Commonwealth of) \\
\texttt{C7A - C7Z} & World Meteorological Organisation \\
\texttt{C8A - C9Z} & Mozambique (Republic of) \\
\texttt{DAA - DRZ} & Germany (Ferderal Republic of) \\
\texttt{DSA - DTZ} & Korea (Republic of)\\
\texttt{DUA - DZZ} & Philippines (Republic of) \\
\texttt{D2A - D3Z} & Angola (Republic of) \\
\texttt{D4A - D4Z} & Cape Verde (Republic of) \\
\texttt{D5A - D5Z} & Liberia (Republic of) \\
\texttt{D6A - D6Z} & Comoros (Union of) \\
\texttt{D7A - D9Z} & Korea (Republic of) \\
\texttt{EAA - EHZ} & Spain \\
\texttt{EIA - EJZ} & Ireland \\
\texttt{EKA - EKZ} & Armenia (Republic of) \\
\texttt{ELA - ELZ} & Liberia (Republic of) \\
\texttt{EMA - EOZ} & Ukraine \\
\texttt{EPA - EQZ} & Iran (Republic of) \\
\texttt{ERA - ERZ} & Moldova (Republic of) \\
\texttt{ESA - ESZ} & Estonis (Republic of) \\
\texttt{ETA - ETZ} & Ethiopia (Federal Democratic Republic of) \\
\texttt{EUA - EWZ} & Belarus (Republic of) \\
\texttt{EXA - EXZ} & Kygyz Republic \\
\texttt{EYA - EYZ} & Tajikistan (Republic of) \\
\texttt{EZA - EZZ} & Turkmenistan \\
\texttt{E2A - E2Z} & Thailand \\
\texttt{E3A - E3Z} & Eritrea \\
\texttt{E4A - E4Z} & Palestinian Authority (In response to Resulotion 99 Rev. Busan, 2014) \\
\texttt{E5A - E5Z} & New Zealand - Cook islands \\
\texttt{E6A - E6Z} & New Zealand - Niue \\
\texttt{E7A - E7Z} & Bosnia and Herzegovina \\
\texttt{FAA - FZZ} & France \\
\texttt{GAA - GZZ} & United Kingdom of Great Britain and North Ireland \\
\texttt{HAA - HAZ} & Hungary (Republic of) \\
\texttt{HBA - HBZ} & Switzerland (Confederation of) \\
\texttt{HCA - HDZ} & Ecuador \\
\texttt{HEA - HEZ} & Switzerland (Confederation of) \\
\texttt{HFA - HFZ} & Poland (Republic of) \\
\texttt{HGA - HGZ} & Hungary (Republic of) \\
\texttt{HHA - HHZ} & Haiti (Republic of) \\
\texttt{HIA - HIZ} & Dominicanian Republic \\
\texttt{HJA - HKZ} & Columbia (Republic of) \\
\texttt{HLA - HLZ} & Korea (Republic of) \\
\texttt{HMA - HMZ} & Democratic People's Republic of Korea \\
\texttt{HNA - HNZ} & Iraq (Republic of) \\
\texttt{HOA - HPZ} & Panama (Republic of) \\
\texttt{HQA - HRZ} & Honduras (Republic of) \\
\texttt{HSA - HSZ} & Thailand \\
\texttt{HTA - HTZ} & Nicaragua \\
\texttt{HUA - HUZ} & El Salvador (Republic of) \\
\texttt{HVA - HVZ} & Vatican City State \\
\texttt{HWA - HYZ} & France \\
\texttt{HZA - HZZ} & Saudi Arabia (Kingdom of) \\
\texttt{H2A - H2Z} & Cyprus (Republic of) \\
\texttt{H3A - H3Z} & Panama (Republic of) \\
\texttt{H4A - H4Z} & Solomaon islands \\
\texttt{H6A - H7Z} & Nicaragua \\
\texttt{H8A - H9Z} & Panama (Republic of) \\
\texttt{IAA - IZZ} & Italy \\
\texttt{JAA - JSZ} & Japan \\
\texttt{JTA - JVZ} & Mongolia \\
\texttt{JWA - JXZ} & Norway \\
\texttt{JYA - JYZ} & Jordan (Hashemite Kingdom of) \\
\texttt{JZA - JZZ} & Indonesia (Republic of) \\
\texttt{J2A - J2Z} & Djibouti (Republic of) \\
\texttt{J3A - J3Z} & Grenada \\
\texttt{J4A - J4Z} & Greece \\
\texttt{J5A - J5Z} & Guinea-Bissau (Republic of) \\
\texttt{J6A - J6Z} & Saint Lucia \\
\texttt{J7A - J7Z} & Dominica (Commonwealth of) \\
\texttt{J8A - J8Z} & Saint Vincent and the Grenadines \\
\texttt{KAA - KZZ} & United States of America \\
\texttt{LAA - LNZ} & Norway \\
\texttt{LOA - LWZ} & Argentine Republic \\
\texttt{LXA - LXZ} & Luxemborg \\
\texttt{LYA - LYZ} & Lithuania (Republic of) \\
\texttt{LZA - LZZ} & Bulgaria (Republic of) \\
\texttt{L2A - L9Z} & Argentine Republic \\
\texttt{MAA - MZZ} & United Kingdom of Great Britain and Northern Ireland \\
\texttt{NAA - NZZ} & United States of America \\
\end{xltabular}}

\end{document}

uliken

Re: Bei xltabular ist die ungerade Seite eine Zeile länger als die gerade Seite

Beitrag von uliken »

Das kann ich nicht nachvollziehen. Auf den ersten beiden Seiten besteht die Tabelle aus 49 Zeilen (ohne Kopfzeile). Ich habe mal eine Zeilennummerierung in deinem MWE eingefügt.
\documentclass[fontsize=10pt,paper=210mm:297mm,DIV=calc,open=any]{scrbook}               
\usepackage[outer=20mm,vscale=0.8]{geometry}

%% Packages
\usepackage{booktabs}
\usepackage{xltabular}
\usepackage{ragged2e} % neu eingefügt
\newcolumntype{F}{>{\RaggedRight\hspace{0pt}}X} % neu eingefügt

\newcounter{tlines} % neuen Zähler definiert
\begin{document}
  {\renewcommand{\arraystretch}{1.1}
    \begin{xltabular}{\textwidth}{@{\thetlines\refstepcounter{tlines}~}rF@{}}\toprule
      \textbf{ITU Präfix} & \textbf{zugeteilt an} \\\midrule
      \endhead
      \texttt{AAA - ALZ} & United States of America \\
      \texttt{AMA - AOZ} & Spain \\
      \texttt{APA - ASZ} & Pakistan (Republic of) \\
      \texttt{ATA - AWZ} & India (Republic of) \\
      \texttt{AXA - AXZ} & Australia \\
      \texttt{AYA - AZZ} & Argentinic Republic \\
      \texttt{A2A - A2Z} & Botswana (Republik of) \\
      \texttt{A3A - A3Z} & Tonga (Kingdom of) \\
      \texttt{A4A - A4Z} & Oman (Sultanate of) \\
      \texttt{A5A - A5Z} & Bhutan (Kingdom of) \\
      \texttt{A6A - A6Z} & United Arab Emirates \\
      \texttt{A7A - A7Z} & Qatar (State of) \\
      \texttt{A8A - A8Z} & Liberia (Republic of) \\
      \texttt{A9A - A9Z} & Bahrain (Kingdom of) \\
      \texttt{BAA - BZZ} & China (People's Republic of) \\
      \texttt{CAA - BEZ} & Chile \\
      \texttt{CFA - CKZ} & Canada \\
      \texttt{CLA - CMZ} & Cuba \\
      \texttt{CNA - CNZ} & Morocco (Kingdom of) \\
      \texttt{COA - COZ} & Cuba \\
      \texttt{CPA - CPZ} & Bolivia (Republic of) \\
      \texttt{CQA - CUZ} & Portual \\
      \texttt{CVA - CXZ} & Uruguay (Eastern Republic of) \\
      \texttt{CYA - CZZ} & Canada \\
      \texttt{C2A - C2Z} & Nauru (Republic of) \\
      \texttt{C3A - C3Z} & Andorra (Principality of) \\
      \texttt{C4A - C4Z} & Cyprus (Republic of) \\
      \texttt{C5A - C5Z} & Gambia (Republic of the) \\
      \texttt{C6A - C6Z} & Bahamas (Commonwealth of) \\
      \texttt{C7A - C7Z} & World Meteorological Organisation \\
      \texttt{C8A - C9Z} & Mozambique (Republic of) \\
      \texttt{DAA - DRZ} & Germany (Ferderal Republic of) \\
      \texttt{DSA - DTZ} & Korea (Republic of)\\
      \texttt{DUA - DZZ} & Philippines (Republic of) \\
      \texttt{D2A - D3Z} & Angola (Republic of) \\
      \texttt{D4A - D4Z} & Cape Verde (Republic of) \\
      \texttt{D5A - D5Z} & Liberia (Republic of) \\
      \texttt{D6A - D6Z} & Comoros (Union of) \\
      \texttt{D7A - D9Z} & Korea (Republic of) \\
      \texttt{EAA - EHZ} & Spain \\
      \texttt{EIA - EJZ} & Ireland \\
      \texttt{EKA - EKZ} & Armenia (Republic of) \\
      \texttt{ELA - ELZ} & Liberia (Republic of) \\
      \texttt{EMA - EOZ} & Ukraine \\
      \texttt{EPA - EQZ} & Iran (Republic of) \\
      \texttt{ERA - ERZ} & Moldova (Republic of) \\
      \texttt{ESA - ESZ} & Estonis (Republic of) \\
      \texttt{ETA - ETZ} & Ethiopia (Federal Democratic Republic of) \\
      \texttt{EUA - EWZ} & Belarus (Republic of)\setcounter{tlines}{1} \\ %Zähler rücksetzen
      \texttt{EXA - EXZ} & Kygyz Republic \\
      \texttt{EYA - EYZ} & Tajikistan (Republic of) \\
      \texttt{EZA - EZZ} & Turkmenistan \\
      \texttt{E2A - E2Z} & Thailand \\
      \texttt{E3A - E3Z} & Eritrea \\
      \texttt{E4A - E4Z} & Palestinian Authority (In response to Resulotion 99 Rev. Busan, 2014) \\
      \texttt{E5A - E5Z} & New Zealand - Cook islands \\
      \texttt{E6A - E6Z} & New Zealand - Niue \\
      \texttt{E7A - E7Z} & Bosnia and Herzegovina \\
      \texttt{FAA - FZZ} & France \\
      \texttt{GAA - GZZ} & United Kingdom of Great Britain and North Ireland \\
      \texttt{HAA - HAZ} & Hungary (Republic of) \\
      \texttt{HBA - HBZ} & Switzerland (Confederation of) \\
      \texttt{HCA - HDZ} & Ecuador \\
      \texttt{HEA - HEZ} & Switzerland (Confederation of) \\
      \texttt{HFA - HFZ} & Poland (Republic of) \\
      \texttt{HGA - HGZ} & Hungary (Republic of) \\
      \texttt{HHA - HHZ} & Haiti (Republic of) \\
      \texttt{HIA - HIZ} & Dominicanian Republic \\
      \texttt{HJA - HKZ} & Columbia (Republic of) \\
      \texttt{HLA - HLZ} & Korea (Republic of) \\
      \texttt{HMA - HMZ} & Democratic People's Republic of Korea \\
      \texttt{HNA - HNZ} & Iraq (Republic of) \\
      \texttt{HOA - HPZ} & Panama (Republic of) \\
      \texttt{HQA - HRZ} & Honduras (Republic of) \\
      \texttt{HSA - HSZ} & Thailand \\
      \texttt{HTA - HTZ} & Nicaragua \\
      \texttt{HUA - HUZ} & El Salvador (Republic of) \\
      \texttt{HVA - HVZ} & Vatican City State \\
      \texttt{HWA - HYZ} & France \\
      \texttt{HZA - HZZ} & Saudi Arabia (Kingdom of) \\
      \texttt{H2A - H2Z} & Cyprus (Republic of) \\
      \texttt{H3A - H3Z} & Panama (Republic of) \\
      \texttt{H4A - H4Z} & Solomaon islands \\
      \texttt{H6A - H7Z} & Nicaragua \\
      \texttt{H8A - H9Z} & Panama (Republic of) \\
      \texttt{IAA - IZZ} & Italy \\
      \texttt{JAA - JSZ} & Japan \\
      \texttt{JTA - JVZ} & Mongolia \\
      \texttt{JWA - JXZ} & Norway \\
      \texttt{JYA - JYZ} & Jordan (Hashemite Kingdom of) \\
      \texttt{JZA - JZZ} & Indonesia (Republic of) \\
      \texttt{J2A - J2Z} & Djibouti (Republic of) \\
      \texttt{J3A - J3Z} & Grenada \\
      \texttt{J4A - J4Z} & Greece \\
      \texttt{J5A - J5Z} & Guinea-Bissau (Republic of) \\
      \texttt{J6A - J6Z} & Saint Lucia \\
      \texttt{J7A - J7Z} & Dominica (Commonwealth of) \\
      \texttt{J8A - J8Z} & Saint Vincent and the Grenadines \\
      \texttt{KAA - KZZ} & United States of America \\
      \texttt{LAA - LNZ} & Norway \\
      \texttt{LOA - LWZ} & Argentine Republic \\
      \texttt{LXA - LXZ} & Luxemborg \\
      \texttt{LYA - LYZ} & Lithuania (Republic of) \\
      \texttt{LZA - LZZ} & Bulgaria (Republic of) \\
      \texttt{L2A - L9Z} & Argentine Republic \\
      \texttt{MAA - MZZ} & United Kingdom of Great Britain and Northern Ireland \\
      \texttt{NAA - NZZ} & United States of America \\
  \end{xltabular}}
  
\end{document}

Antworten