回転した長表のウムラウトに関する問題

回転した長表のウムラウトに関する問題

で回転したロングテーブルを設定しているときに奇妙なことに遭遇しましたapa6

具体的には、次のように機能します。

\documentclass[12pt
               ,man % manuscript mode; jou man doc
               ,babel, american % language
               %,biblatex % loads biblatex or apacite
               ,a4paper % default:letter
               % ,floatsintext
               ,noextraspace %removes extra space after headings; closer to "true" double-spacing
               %,mask
               ,longtable
               %,helv % font in man mode
               %,tt   % font in man mode
               %,draftfirst
               %,draftall
               ]{apa6}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{booktabs}
\usepackage{pdflscape}
\usepackage{lipsum}
\usepackage{threeparttablex}
\usepackage{siunitx}


%% for the huge table to avoid boxes warnings
\newcommand{\rr}{\raggedright}
\newcommand{\tn}{\tabularnewline}


\DeclareDelayedFloatFlavor*{landscape}{table}


\title{Longtables and Me: An Endless Story}
\shorttitle{Longtables}

\author{Me}
\affiliation{MeU}

\authornote{
Empty
}



\abstract{
Empty.
}


\keywords{Empty}





\begin{document}

\lipsum

\begin{landscape}

\begin{ThreePartTable}

\begin{TableNotes}
\rr \footnotesize %
\textit{Note.} 
Just a TableNote to explain some stuff.
\end{TableNotes}


\begin{longtable}{p{7.3cm}
                  S[table-format = 5]
                  l
                  l
                  S[table-format = 2.2]
                  c
                  p{5cm}}

\caption{Longitudinal Studies Included in the Analysis} \\
\label{tab:studies} \\

\toprule
1st Column  & {2nd Column}  &  3rd Column   &  4th Column  &  {5th Column}  &  6th  &  7th Column\\
\midrule
\endfirsthead


\multicolumn{7}{l}{{\tablename} \thetable{} (continued)} \\[0.5ex]

\toprule
1st Column  & {2nd Column}  &  3rd Column   &  4th Column  &  {5th Column}  &  6th  &  7th Column\\
\midrule
\endhead

\rr An Entry    & 1234  & ABCD    & glo  & 99.32  & 2  & Some more text \\

\rr An Entry   & 1234  & ABCD    & glo  & 99.32  & 2  & Some more text \\

\rr An Entry   & 1234  & ABCD    & glo  & 99.32  & 2  & Some more text \\

\rr An Entry   & 1234  & ABCD    & glo  & 99.32  & 2  & Some more text \\

\rr An Entry   & 1234  & ABCD    & glo  & 99.32  & 2  & Some more text \\

\rr An Entry   & 1234  & ABCD    & glo  & 99.32  & 2  & Some more text \\

\rr An Entry   & 1234  & ABCD    & glo  & 99.32  & 2  & Some more text \\

\rr An Entry   & 1234  & ABCD    & glo  & 99.32  & 2  & Some more text \\

\rr An Entry   & 1234  & ABCD    & glo  & 99.32  & 2  & Some more text \\

\rr An Entry that is quite long and breaks to the next line   & 1234  & ABCD    & glo  & 99.32  & 2  & Some more text \\

\rr An Entry   & 1234  & ABCD    & glo  & 99.32  & 2  & Some more text \\

\rr An Entry   & 1234  & ABCD    & glo  & 99.32  & 2  & Some more text \\

\rr Another rather long Entry that also breaks and extends over two lines   & 1234  & ABCD    & glo  & 99.32  & 2  & Some more text \\

\rr An Entry   & 1234  & ABCD    & glo  & 99.32  & 2  & Some more text \\


\bottomrule

\insertTableNotes

\end{longtable}

\end{ThreePartTable}
\end{landscape}


\lipsum


\end{document}

表のセルの 1 つ (最初の行、左の列) にウムラウトを挿入すると、すべてが壊れてエラーが発生します。

\documentclass[12pt
               ,man % manuscript mode; jou man doc
               ,babel, american % language
               %,biblatex % loads biblatex or apacite
               ,a4paper % default:letter
               % ,floatsintext
               ,noextraspace %removes extra space after headings; closer to "true" double-spacing
               %,mask
               ,longtable
               %,helv % font in man mode
               %,tt   % font in man mode
               %,draftfirst
               %,draftall
               ]{apa6}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{booktabs}
\usepackage{pdflscape}
\usepackage{lipsum}
\usepackage{threeparttablex}
\usepackage{siunitx}


%% for the huge table to avoid boxes warnings
\newcommand{\rr}{\raggedright}
\newcommand{\tn}{\tabularnewline}


\DeclareDelayedFloatFlavor*{landscape}{table}


\title{Longtables and Me: An Endless Story}
\shorttitle{Longtables}

\author{Me}
\affiliation{MeU}

\authornote{
Empty
}



\abstract{
Empty.
}


\keywords{Empty}





\begin{document}

\lipsum

\begin{landscape}

\begin{ThreePartTable}

\begin{TableNotes}
\rr \footnotesize %
\textit{Note.} 
Just a TableNote to explain some stuff.
\end{TableNotes}


\begin{longtable}{p{7.3cm}
                  S[table-format = 5]
                  l
                  l
                  S[table-format = 2.2]
                  c
                  p{5cm}}

\caption{Longitudinal Studies Included in the Analysis} \\
\label{tab:studies} \\

\toprule
1st Column  & {2nd Column}  &  3rd Column   &  4th Column  &  {5th Column}  &  6th  &  7th Column\\
\midrule
\endfirsthead


\multicolumn{7}{l}{{\tablename} \thetable{} (continued)} \\[0.5ex]

\toprule
1st Column  & {2nd Column}  &  3rd Column   &  4th Column  &  {5th Column}  &  6th  &  7th Column\\
\midrule
\endhead

\rr An Entry with ä    & 1234  & ABCD    & glo  & 99.32  & 2  & Some more text \\

\rr An Entry   & 1234  & ABCD    & glo  & 99.32  & 2  & Some more text \\

\rr An Entry   & 1234  & ABCD    & glo  & 99.32  & 2  & Some more text \\

\rr An Entry   & 1234  & ABCD    & glo  & 99.32  & 2  & Some more text \\

\rr An Entry   & 1234  & ABCD    & glo  & 99.32  & 2  & Some more text \\

\rr An Entry   & 1234  & ABCD    & glo  & 99.32  & 2  & Some more text \\

\rr An Entry   & 1234  & ABCD    & glo  & 99.32  & 2  & Some more text \\

\rr An Entry   & 1234  & ABCD    & glo  & 99.32  & 2  & Some more text \\

\rr An Entry   & 1234  & ABCD    & glo  & 99.32  & 2  & Some more text \\

\rr An Entry that is quite long and breaks to the next line   & 1234  & ABCD    & glo  & 99.32  & 2  & Some more text \\

\rr An Entry   & 1234  & ABCD    & glo  & 99.32  & 2  & Some more text \\

\rr An Entry   & 1234  & ABCD    & glo  & 99.32  & 2  & Some more text \\

\rr Another rather long Entry that also breaks and extends over two lines   & 1234  & ABCD    & glo  & 99.32  & 2  & Some more text \\

\rr An Entry   & 1234  & ABCD    & glo  & 99.32  & 2  & Some more text \\


\bottomrule

\insertTableNotes

\end{longtable}

\end{ThreePartTable}
\end{landscape}


\lipsum


\end{document}

\DeclareDelayedFloatFlavor*{landscape}{table}興味深いことに、プリアンブルから削除すると、すべてが再び機能します (ただし、このコマンドを保持する必要があります)。

もちろん、ウムラウトや特殊文字をエスケープすることで簡単に問題を回避できます (\"aこの場合など) が、このコンテキストではより一般的な解決策があるのではないかと考えました。

前もって感謝します。

PS: ウムラウトは、回転した長表の外側でも適切に機能します。

答え1

理由は分かりませんが、遅延テーブルが書き出される一時ファイルは、utf8ではなくlatin 1でエンコードされています。回避策としては、テーブルを再度読み込むときに入力エンコードをlatin 1に設定することです。これは次のように簡単に行うことができます。

\AtBeginDelayedFloats{\inputencoding{latin1}}

サンプル出力

\documentclass[12pt
               ,man % manuscript mode; jou man doc
               ,babel, american % language
               %,biblatex % loads biblatex or apacite
               ,a4paper % default:letter
               % ,floatsintext
               ,noextraspace %removes extra space after headings; closer to "true" double-spacing
               %,mask
               ,longtable
               %,helv % font in man mode
               %,tt   % font in man mode
               %,draftfirst
               %,draftall
               ]{apa6}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{booktabs}
\usepackage{pdflscape}
\usepackage{lipsum}
\usepackage{threeparttablex}
\usepackage{siunitx}


%% for the huge table to avoid boxes warnings
\newcommand{\rr}{\raggedright}
\newcommand{\tn}{\tabularnewline}


\DeclareDelayedFloatFlavor*{landscape}{table}
\AtBeginDelayedFloats{\inputencoding{latin1}}

\title{Longtables and Me: An Endless Story}
\shorttitle{Longtables}

\author{Me}
\affiliation{MeU}

\authornote{
Empty
}



\abstract{
Empty.
}


\keywords{Empty}





\begin{document}

\lipsum

\begin{landscape}

\begin{ThreePartTable}

\begin{TableNotes}
\rr \footnotesize %
\textit{Note.}
Just a TableNote to explain some stuff.
\end{TableNotes}


\begin{longtable}{p{7.3cm}
                  S[table-format = 5]
                  l
                  l
                  S[table-format = 2.2]
                  c
                  p{5cm}}

\caption{Longitudinal Studies Included in the Analysis} \\
\label{tab:studies} \\

\toprule
1st Column  & {2nd Column}  &  3rd Column   &  4th Column  &  {5th Column}  &  6th  &  7th Column\\
\midrule
\endfirsthead


\multicolumn{7}{l}{{\tablename} \thetable{} (continued)} \\[0.5ex]

\toprule
1st Column  & {2nd Column}  &  3rd Column   &  4th Column  &  {5th Column}  &  6th  &  7th Column\\
\midrule
\endhead

\rr An Entry with ä    & 1234  & ABCD    & glo  & 99.32  & 2  & Some more text \\

\rr An Entry   & 1234  & ABCD    & glo  & 99.32  & 2  & Some more text \\

\rr An Entry   & 1234  & ABCD    & glo  & 99.32  & 2  & Some more text \\

\rr An Entry   & 1234  & ABCD    & glo  & 99.32  & 2  & Some more text \\

\rr An Entry   & 1234  & ABCD    & glo  & 99.32  & 2  & Some more text \\

\rr An Entry   & 1234  & ABCD    & glo  & 99.32  & 2  & Some more text \\

\rr An Entry   & 1234  & ABCD    & glo  & 99.32  & 2  & Some more text \\

\rr An Entry   & 1234  & ABCD    & glo  & 99.32  & 2  & Some more text \\

\rr An Entry   & 1234  & ABCD    & glo  & 99.32  & 2  & Some more text \\

\rr An Entry that is quite long and breaks to the next line   & 1234  & ABCD    & glo  & 99.32  & 2  & Some more text \\

\rr An Entry   & 1234  & ABCD    & glo  & 99.32  & 2  & Some more text \\

\rr An Entry   & 1234  & ABCD    & glo  & 99.32  & 2  & Some more text \\

\rr Another rather long Entry that also breaks and extends over two lines   & 1234  & ABCD    & glo  & 99.32  & 2  & Some more text \\

\rr An Entry   & 1234  & ABCD    & glo  & 99.32  & 2  & Some more text \\


\bottomrule

\insertTableNotes

\end{longtable}

\end{ThreePartTable}
\end{landscape}


\lipsum


\end{document}

答え2

apa6メンテナーまたはendfloatメンテナー (フロートを表示するためにapa6を使用します)に通知することをお勧めします。endfloat

主な問題は、utf8 をディスクに書き込むことができる場合、書き込む前にデータを保護する必要があり、そうしないと特殊文字が展開されることです。

これは前文に書かれており、役に立つようだ

\makeatletter
\renewcommand\efloat@iwrite[1]{%
   \expandafter\immediate\expandafter\protected@write\csname efloat@post#1\endcsname{}}

\makeatother

このマクロは 2 つではなく 3 つの引数を必要とするため、\writeに変更して後に\protected@write追加しました。{}\csname

編集: うーん、生成されたコードを見ると、これは utf8 をディスクに書き込んでいませんが、正しくコンパイルされているようです。

関連情報