![Die Beschriftung von tabularray longtblr wird nicht linksbündig ausgerichtet](https://rvso.com/image/472686/Die%20Beschriftung%20von%20tabularray%20longtblr%20wird%20nicht%20linksb%C3%BCndig%20ausgerichtet.png)
Ich habe eine solche Konfiguration erstellt
\SetTblrTemplate{middlehead, lasthead, foot}{empty}
\SetTblrStyle{head, caption}{halign=l}
\newlength\lwidth
\setlength\lwidth{0.7pt}
\NewDocumentEnvironment{tabl}{m +b}{
\begin{longtblr}[caption=#1]{hlines={\lwidth}, hline{2}={2\lwidth}, vlines={\lwidth}, columns={halign=c, valign=m, co=1}, width=\linewidth}
#2
\end{longtblr}
}{}
Verwendung:
\begin{tabl}{caption}
1 & 1 & 1 \\
1 & 1 & 1 \\
1 & 1 & 1 \\
1 & 1 & 1 \\
1 & 1 & 1 \\
1 & 1 & 1 \\
1 & 1 & 1 \\
1 & 1 & 1 \\
1 & 1 & 1 \\
\end{tabl}
Die Überschrift sollte mit der Einstellung linksbündig ausgerichtet sein \SetTblrStyle{head, caption}{halign=l}
, aber das funktioniert nicht. Ich erhalte:
Ich frage mich, ob ich etwas falsch verstanden habe oder ob es ein Fehler ist. Ich habe herausgefunden, dass jemand seine eigene Konfiguration geschrieben hat, um dies zu tunHier.
Antwort1
Sie können caption
das Paket verwenden, um Ihre Untertitel und tblr-extras
Ihre Untertitelbibliothek zu konfigurieren, um Tabularray zu erstellen longtblr
und talltblr
diese Untertitel zu verwenden.
\documentclass{article}
\usepackage{tabularray,tblr-extras}
\UseTblrLibrary{caption}
\captionsetup[table]{singlelinecheck=false,position=above,justification=raggedright}
\newlength\lwidth
\setlength\lwidth{0.7pt}
\SetTblrTemplate{middlehead, lasthead, foot}{empty}
\begin{document}
\begin{longtblr}[
caption={A caption example}
]{
colspec=ccc,
hlines={\lwidth},
hline{2}={2\lwidth},
vlines={\lwidth},
columns={halign=c, valign=m, co=1}, width=\linewidth,
}
1 & 1 & 1 \\
1 & 1 & 1 \\
1 & 1 & 1 \\
1 & 1 & 1 \\
1 & 1 & 1 \\
1 & 1 & 1 \\
\end{longtblr}
\bigskip
\captionsetup[table]{justification=raggedleft}
\begin{longtblr}[
caption={A caption example}
]{
colspec=ccc,
hlines={\lwidth},
hline{2}={2\lwidth},
vlines={\lwidth},
columns={halign=c, valign=m, co=1}, width=\linewidth,
}
1 & 1 & 1 \\
1 & 1 & 1 \\
1 & 1 & 1 \\
1 & 1 & 1 \\
1 & 1 & 1 \\
1 & 1 & 1 \\
\end{longtblr}
\captionsetup[table]{justification=centering}
\begin{longtblr}[
caption={A caption example}
]{
colspec=ccc,
hlines={\lwidth},
hline{2}={2\lwidth},
vlines={\lwidth},
columns={halign=c, valign=m, co=1}, width=\linewidth,
}
1 & 1 & 1 \\
1 & 1 & 1 \\
1 & 1 & 1 \\
1 & 1 & 1 \\
1 & 1 & 1 \\
1 & 1 & 1 \\
\end{longtblr}
\end{document}