# Hiding the title, changing the font, editing, etc for the bibliography in *Lyx*

I am trying to deal with this unwieldy title in a bibtex lyx bibliography. I am curious how to change its size, rename it, or suppress it entirely. Right now, it looks like:

I am aware of this question, but these solutions do not work for Lyx.

• Why do they not work for LyX? Are you using biblatex as the tag suggests? – Torbjørn T. Jul 25 '18 at 19:48
• Bibtex, sorry. But \renewcommand\bibname{Bibliography} works to change the title, but I can't figure out font size – wolfsatthedoor Jul 25 '18 at 19:49
• Well the question you link to is specifically about removing the title altogether, I'd expect the same techniques to work with LyX. For changing the font size, something similar to tex.stackexchange.com/questions/226034 might work. (That question is for \subsection, while the bibliography will typically use \section or \chapter depending on documentclass.) – Torbjørn T. Jul 25 '18 at 19:55
• @TorbjørnT. Interestingly I thought the same thing. All section titles have changed except the bibliography, which is insanely stubborn. Isn't there a simple \renewcommand that has a call for the Bibliography title font? I am finding it insanely hard to find. – wolfsatthedoor Jul 25 '18 at 19:58
• How exactly are you creating the bibliography? Which documentclass are you using? – Torbjørn T. Jul 25 '18 at 20:07

To change the bibliography heading in a report from chapter to section, use the same technique as in How can I create a bibliography like a section?, i.e. add

\usepackage{etoolbox}
\patchcmd{\thebibliography}{\chapter*}{\section*}{}{}


to Document --> Settings --> Preamble.

Unless you're using natbib, in which case you need to redefine \bibsection, because that macro is responsible for placing the heading in the thebibliography environment created by natbib. So for example add this to the preamble:

\AtBeginDocument{\renewcommand\bibsection{%
\section*{\bibname\ifx\@mkboth\@gobbletwo\else\markright{\MakeUppercase{\bibname}}\fi}%
}}


But this won't work with tocbibind if you're using that one to add the bibliography to the ToC. If you're using that package, add this to the preamble instead:

\AtBeginDocument{\renewcommand\bibsection{\t@cb@bsection}}


For removing the heading, the method described in https://tex.stackexchange.com/a/22654/ works perfectly fine, also in LyX. The only difference is that as you're using the report class, the bibliography heading is a \chapter*, so you need to redefine \chapter not \section.

To modify the font and spacing, you can use the method described in Change font size of specific chapter. Add \usepackage{titlesec} in Document --> Settings --> Preamble, and add the \titleformat/\titlespacing code in an ERT.

Sample .lyx file (copy text into text editor, save as something.lyx):

#LyX 2.3 created this file. For more info see http://www.lyx.org/
\lyxformat 544
\begin_document
\save_transient_properties true
\origin unavailable
\textclass report
\begin_preamble
\usepackage{titlesec}
\end_preamble
\use_default_options true
\begin_modules
theorems-ams
\end_modules
\maintain_unincluded_children false
\language english
\language_package default
\inputencoding auto
\fontencoding global
\font_roman "default" "default"
\font_sans "default" "default"
\font_typewriter "default" "default"
\font_math "auto" "auto"
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100 100
\font_tt_scale 100 100
\use_microtype false
\use_dash_ligatures true
\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize default
\spacing single
\use_hyperref false
\papersize default
\use_geometry false
\use_package amsmath 1
\use_package amssymb 1
\use_package cancel 1
\use_package esint 1
\use_package mathdots 1
\use_package mathtools 1
\use_package mhchem 1
\use_package stackrel 1
\use_package stmaryrd 1
\use_package undertilde 1
\cite_engine basic
\cite_engine_type default
\biblio_style plain
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\justification true
\use_refstyle 1
\use_minted 0
\index Index
\shortcut idx
\color #008000
\end_index
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\paragraph_indentation default
\is_math_indent 0
\math_numbering_side default
\quotes_style english
\dynamic_quotes 0
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false

\begin_body

\begin_layout Standard
foo bar
\begin_inset CommandInset citation
LatexCommand cite
key "article-full"
literal "false"

\end_inset

\end_layout

\begin_layout Standard
\begin_inset ERT
status open

\begin_layout Plain Layout

\backslash
begingroup
\end_layout

\begin_layout Plain Layout

%% the next code line removes the heading altogether
\end_layout

\begin_layout Plain Layout

%
\backslash
renewcommand{
\backslash
chapter}[2]{
\backslash
cleardoublepage}%
\end_layout

\begin_layout Plain Layout

%
\end_layout

\begin_layout Plain Layout

%% the next code line changes the font to
\backslash
Huge bold and sans serif
\end_layout

\begin_layout Plain Layout

\backslash
titleformat{
\backslash
chapter}{}{}{0pt}{
\backslash
normalfont
\backslash
Huge
\backslash
sffamily
\backslash
bfseries}
\end_layout

\begin_layout Plain Layout

%% and finally this one is for setting the spacing
\end_layout

\begin_layout Plain Layout

\backslash
titlespacing*{
\backslash
chapter}{0pt}{0pt}{10pt}
\end_layout

\end_inset

\end_layout

\begin_layout Standard
\begin_inset CommandInset bibtex
LatexCommand bibtex
btprint "btPrintCited"
bibfiles "xampl"
options "plain"

\end_inset

\end_layout

\begin_layout Standard
\begin_inset ERT
status open

\begin_layout Plain Layout

\backslash
endgroup
\end_layout

\end_inset

\end_layout

\end_body
\end_document

• "\usepackage{etoolbox} \patchcmd{\thebibliography}{\chapter*}{\section*}{}{}" isn't working because I am using natbib format with numbered references. Is there a way to work around this? – wolfsatthedoor Jul 25 '18 at 21:32
• @wolfsatthedoor next time please provide a minimal .lyx file in your question. That way issues like these can be avoided. For more information, see wiki.lyx.org/FAQ/MinimalExample – scottkosty Jul 26 '18 at 2:23