Text FormattingHow to align footnote text and numbering

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
thorpn
Posts: 53
Joined: Mon Jul 30, 2012 7:30 pm

How to align footnote text and numbering

Post by thorpn »

I wish to align the text of longer footnotes with the number, a minimum working example (below) shows how the text goes more to the left than the numbering of longer footnotes.

Thank you in advance!

Code: Select all

\documentclass[10pt,a4paper,oneside]{paper}
\usepackage[top=0.5cm,left=0.5 cm,right=10 mm,bottom=10 mm,headheight=11.0 pt]{geometry}	

\begin{document}

I think that\footnote{something} and that \footnote{Alternatively banks can hold an amount of capital based on a standardized approach but this would generally lead to a higher requirement of capital. In fact this is the standard approach, only banks deemed sufficiently sophisticated may use the "international model-based approach" described in the subsection.}
\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

How to align footnote text and numbering

Post by cgnieder »

The KOMA-Script classes offer the command \deffootnote that can be used for this. The command is also available in other classes if you load the package scrextend. The syntax is as follows:

Code: Select all

\deffootnote[<width of mark>]
  {<indent of footnote text>}
  {<paragraph indent in the footnote text>}
  {<definition of mark>}
Below I show an example of its usage. I also changed "..." into ``...'' in order to get correct quotation marks.
deffootnote.png
deffootnote.png (19.56 KiB) Viewed 28211 times

Code: Select all

\documentclass{article}
\setlength\textheight{3cm}% /only/ for this example!

\usepackage{scrextend}
\deffootnote[2em]{2em}{1em}{\textsuperscript{\thefootnotemark}\,}
\begin{document}

I think this\footnote{something} and that\footnote{Alternatively banks can
  hold an amount of capital based on a standardized approach but this would
  generally lead to a higher requirement of capital. In fact this is the
  standard approach, only banks deemed sufficiently sophisticated may use the
  ``international model-based approach'' described in the subsection.}

\end{document}
Regards
site moderator & package author
thorpn
Posts: 53
Joined: Mon Jul 30, 2012 7:30 pm

How to align footnote text and numbering

Post by thorpn »

Thanks, it looks exactly like what i need. However it seems to encounter an error because of one of the packages i am using. Could you suggest how to fix this ?

(i have tons of packages..)

Code: Select all

\usepackage[top=2.5cm,left=2 cm,right=3.0 cm,bottom=2.5cm,headheight=12.0 pt]{geometry}	
\usepackage[ansinew]{inputenc}
\usepackage{graphicx}
\usepackage{amssymb,amsmath}
%\usepackage[compact]{titlesec}												%Bruges til at fjerne white space omkring overskrifter(chapters/sections etc.)
\usepackage{tabularx}
\usepackage{multicol}
\usepackage{amsmath, amsthm, amssymb}									%Stor matematik pakke
\usepackage{ulem} 																		%lettere adgang til over og underline
\usepackage{listings} 																%Gør kode pænere
\usepackage{textcomp} 																%gør at man kan skrive nye symboler, bla. 
\usepackage{wrapfig}																	%Gør at figure kan wrappes
\usepackage[dvipsnames]{xcolor}																		%Gør at tekst osv. kan farves
\usepackage[bf]{caption}						 									%gGør navnet på captions(fx. "Figur 5.1"') til fed skrift
\usepackage{enumerate}																%Gør at man kan sætte tal/bogstaver som indeks på lister
\usepackage[nottoc,numbib]{tocbibind}									%Sørger for at bibliografien er med i table of kontents
\usepackage{natbib}																		%Tillader at citer som \citep hvilket af nogen af foretrukket over \cite
\usepackage[all]{xy}																	%Kan bruges til at tegne figurer såsom flowcharts
\usepackage{verbatim}
\usepackage{epstopdf}																	%Tillader brugen af .eps billeder uden at skulle compile via dvi/ps
\usepackage{environ}																	%Gør at man kan definere nye enviroments
\usepackage{framed,color}															%Kan lave simple bokse eller venstre streger									
%\usepackage[toc]{multitoc}														%Laver pæn indholdsfortegnelse med 2 søjler
\usepackage{subcaption}
\usepackage{epsf}
\usepackage{url}
\usepackage{lscape}																	  %Allows for landscape
\usepackage{etoolbox}
\usepackage{mdframed}																	%have to install this manually on miktex, helps with boxing theorems
\usepackage{fancyhdr}																	%fancy headers 
\usepackage{lscape}																	  %Allows for landscape
\usepackage{multirow}																  %multiple rows in tables
\usepackage{qtree}																	  %draws trees 
\usepackage{scrextend}
Last edited by cgnieder on Fri Jul 19, 2013 1:44 pm, edited 1 time in total.
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

How to align footnote text and numbering

Post by cgnieder »

thorpn wrote:Thanks, it looks exactly like what i need. However it seems to encounter an error because of one of the packages i am using. Could you suggest how to fix this ?
Yes: try to build a Infominimal working example. This should reveal where the conflict stems from. (This really is the standard way that we all use to determine where and why something went wrong).

Regards
site moderator & package author
thorpn
Posts: 53
Joined: Mon Jul 30, 2012 7:30 pm

How to align footnote text and numbering

Post by thorpn »

Good idea, i did that now. It turns out it was two packages. How can i now make them work together ?

Code: Select all

\documentclass{article}
\usepackage[bf]{caption}						 									%gGør navnet på captions(fx. "Figur 5.1"') til fed skrift
\usepackage{subcaption}

\usepackage{scrextend}															  %to make footnotes nicer


\deffootnote[2em]{2em}{1em}{\textsuperscript{\thefootnotemark}\,}
\begin{document}

I think this\footnote{something} and that\footnote{Alternatively banks can
  hold an amount of capital based on a standardized approach but this would
  generally lead to a higher requirement of capital. In fact this is the
  standard approach, only banks deemed sufficiently sophisticated may use the
  ``international model-based approach'' described in the subsection.}

\end{document}

Again thanks :)
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

How to align footnote text and numbering

Post by cgnieder »

The first thing to try if two packages conflict is change the loading order. This works in this case:

Code: Select all

\documentclass{article}
\usepackage{scrextend}
\usepackage[bf]{caption}
\usepackage{subcaption}

\deffootnote[2em]{2em}{1em}{\textsuperscript{\thefootnotemark}\,}
\begin{document}

I think this\footnote{something} and that\footnote{Alternatively banks can
  hold an amount of capital based on a standardized approach but this would
  generally lead to a higher requirement of capital. In fact this is the
  standard approach, only banks deemed sufficiently sophisticated may use the
  ``international model-based approach'' described in the subsection.}

\end{document}
Regards
site moderator & package author
thorpn
Posts: 53
Joined: Mon Jul 30, 2012 7:30 pm

Re: How to align footnote text and numbering

Post by thorpn »

Thanks alot :) didnt know changing the ordering helped
Post Reply