セクションを再定義すると、biblatex のタイトルが壊れる

セクションを再定義すると、biblatex のタイトルが壊れる

を再定義したらsection、どういうわけか参考文献のタイトルがおかしくなりました。MWE は次のとおりです。

\documentclass{article}
\usepackage[utf8]{inputenc}

\newcommand{\linia}{\rule{\linewidth}{0.5pt}}
\renewcommand{\section}[1]{%
  \bigskip%
  {\LARGE\MakeUppercase{#1}}\\[-1ex]%
  \linia\medskip
}

\usepackage{biblatex}
\addbibresource{sample.bib}

\begin{document}
\nocite{*}

\printbibliography

\end{document}

出力は次のようになります。

ここに画像の説明を入力してください

答え1

biblatexのデフォルトのbibliography見出しは、 のようなクラス\section*{<title>}で参考文献の見出しをタイプセットするために使用します。article

再定義

\renewcommand{\section}[1]{%
  \bigskip%
  {\LARGE\MakeUppercase{#1}}\\[-1ex]%
  \linia\medskip
}

のスター付きバージョンが無効になり\section、望ましくない出力が発生します。

\section{<title>}と星付きバージョンを扱うことができる定義を提供するか、別の見出し(例 )を使用するように\section*{<title>}指示します。後者はさまざまな方法で実行できますが、1つは次のようになります。biblatex\section

\documentclass{article}
\usepackage[utf8]{inputenc}

\newcommand{\linia}{\rule{\linewidth}{0.5pt}}
\renewcommand{\section}[1]{%
  \bigskip%
  {\LARGE\MakeUppercase{#1}}\\[-1ex]%
  \linia\medskip
}

\usepackage{biblatex}
\addbibresource{biblatex-examples.bib}

\begin{document}
\nocite{sigfridsson}

\printbibliography[heading=bibnumbered]
\end{document}

同じことを行うセクションコマンドのスター付きバージョンとスターなしバージョンを定義する1つの方法は、(コマンドのスター付きバージョンを定義する (* マクロ)より多くのオプション、特に最新のTeXシステムを使用している場合はxparse/オプションを参照してください)expl3

\documentclass{article}
\usepackage[utf8]{inputenc}

\newcommand{\linia}{\rule{\linewidth}{0.5pt}}

\makeatletter
\renewcommand{\section}{\@ifstar\@section\@section}
\newcommand{\@section}[1]{%
  \bigskip%
  {\LARGE\MakeUppercase{#1}}\\[-1ex]%
  \linia\medskip
}
\makeatother

\usepackage{biblatex}
\addbibresource{biblatex-examples.bib}

\begin{document}
\nocite{*}

\printbibliography
\end{document}

関連情報