TeX - LaTeX Asked by FGHP on June 23, 2021
How to center customised lof name ?
I need to control lof style. I need :
Trying this
~lof> more .lof.tex
documentclass[letterpaper,10pt]{report}
usepackage{fontspec}
newcommand{lof}{
renewcommand{listfigurename}{%
centering%
fontsize{16pt}{18pt}selectfont textbf{MY LIST OF FIG}%
newline%
centering%
vspace*{0.3cm}%
{rule{3cm}{0.8pt}}%
vspace*{0.3cm}%
}
listoffigures
}
begin{document}
lof
end{document}
gives
Which is not centered as expected. Trying this :
~lof> more .lof2.tex
documentclass[letterpaper,10pt]{report}
usepackage{fontspec}
newcommand{lof}{
renewcommand{listfigurename}{%
begin{center}%
fontsize{16pt}{18pt}selectfont textbf{MY LIST OF FIG}%
newline%
vspace*{0.3cm}%
{rule{3cm}{0.8pt}}%
vspace*{0.3cm}%
end{center}%
}
listoffigures
}
begin{document}
lof
end{document}
Does not help (getting exact same result).
UPDATE 1
This does not help either
~lof> more lof.tex
documentclass[letterpaper,10pt]{report}
usepackage{tocloft}
usepackage{fontspec}
newcommand{lof}{
renewcommand{listfigurename}{%
textbf{MY LIST OF FIG}%
}
renewcommand{cftloftitlefont}{%
centering%
fontsize{16pt}{18pt}selectfont%
}
renewcommand{cftafterloftitle}{%
centering%
newline%
vspace*{0.3cm}%
{rule{3cm}{0.8pt}}%
vspace*{0.3cm}%
}
listoffigures
}
begin{document}
lof
end{document}
Which gives
UPDATE 2
Does not work either
~lof> more .lof.tex
documentclass[letterpaper,10pt]{report}
usepackage{tocloft}
usepackage{fontspec}
usepackage{textcase}
newcommand{lof}{
newlength{lofnamel}
renewcommand{listfigurename}{%
my list of fig%
}
settowidth{lofnamel}{listfigurename}
renewcommand{cftloftitlefont}{%
hfillbfseriesfontsize{16pt}{18pt}selectfontMakeTextUppercase%
}
renewcommand{cftafterloftitle}{
%
vspace*{0.3cm}%
centering {rule{3cm}{0.8pt}}%
vspace*{0.3cm}%
}
listoffigures
}
begin{document}
lof
end{document}
Which gives
Franck
If you would be willing to switch to the memoir
class (a superset of book
and report
) then this gives you the basics of what I think you want.
% loftitleprob.tex SE 598988
documentclass[letterpaper,10pt]{memoir}
usepackage{fontspec}
usepackage{lipsum}
newlength{lofnamel}
renewcommand{listfigurename}{MY LIST OF FIG}
settowidth{lofnamel}{listfigurename}
renewcommand{printloftitle}[1]{%
centering Largebfseries #1 rule{lofnamel}{0.1em}}
begin{document}
listoffigures
begin{comment} % stuff below adds text and a figure
lipsum[1]
begin{figure}
centering
FIGURE
caption{A figure}
end{figure}
end{comment}
end{document}
Answered by Peter Wilson on June 23, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP