Graphics, Figures & Tables ⇒ 2 table questions: align caption & notes environment
2 table questions: align caption & notes environment
I cannot figure out how to align the caption of a table. My caption is at the top and I am using tabularx package. I would like to align it to the left.
Also, what is the best way to put notes in a table? Is there an environment or package that is recommended to use?
thank you
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
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
2 table questions: align caption & notes environment
That's definitely a job for the caption package.PGScooter wrote:[...] I cannot figure out how to align the caption of a table. My caption is at the top and I am using tabularx package. I would like to align it to the left. [...]
Try the threeparttable package. Since the package has no manual, you have to look at the *.sty file itself to get a short description of the provided commands and environments.PGScooter wrote:[...] Also, what is the best way to put notes in a table? Is there an environment or package that is recommended to use? [...]
Best regards
Thorsten¹
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
2 table questions: align caption & notes environment
if with notes you are thinking on table footnotes, my proposal is the minipage environment, it works fine. Try with:
Code: Select all
\begin{table}[!ht]
\begin{minipage}{\textwidth}
\captionof{table}[TOC title]{\label{tab:my_table}My table with footnotes.}
\begin{center}
\resizebox{0.9\textwidth}{!} {
\begin{tabular}{|c|c|}
\hline
A\footnote[1]{Uppercase a.} & B\\
\hline
C & D\footnote[2]{Another footnote.}\\
\hline
\end{tabular}
}
\end{center}
\end{minipage}
\end{table}
Code: Select all
\usepackage{caption}
\usepackage{mpfnmark}
\renewcommand*{\thempfootnote}{\fnsymbol{mpfootnote}}
The boxhandler package may also work...localghost wrote:That's definitely a job for the caption package.
Re: 2 table questions: align caption & notes environment
thanks!
2 table questions: align caption & notes environment
I just need to also like to left-align a caption to a figure, and saw this:
So, I took a look at http://tug.ctan.org/tex-archive/macros/ ... on-eng.pdf, and the word "align" is mentioned only three times in it, here:localghost wrote:That's definitely a job for the caption package.PGScooter wrote:[...] I cannot figure out how to align the caption of a table. My caption is at the top and I am using tabularx package. I would like to align it to the left. [...]
That is - no mention of left alignment ... Just to make myself clear, what I'd like to do, is move the caption to where the arrows indicate:The command
\sidecaptionvpos{hfloat typei}{hposi}
sets the vertical position of the side-caption. hposi can be either ‘t’ (for top alignment), ‘b’ (for
bottom alignment), or ‘c’ (for center alignment).
Any suggestions on what could be used to achieve this?
Thanks....
- Attachments
-
- leftaligncaption.jpg (67.78 KiB) Viewed 27035 times
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
2 table questions: align caption & notes environment
Best regards
Thorsten¹
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
2 table questions: align caption & notes environment
Thanks for the great advice - indeed, that is it.. Unfortunately the 'align' terminology sticks too much for me, so I missed the singlelinechecklocalghost wrote:Just give the option singlelinecheck=false to the caption package as described in the manual (Section 2.2 - Justification, p. 8f).

Code: Select all
\begin{raggedright}
\includegraphics[width=4.3957in,height=0.3957in]{myimage.jpg}
\captionsetup{singlelinecheck=off,justification=raggedright}
\captionof{figure}{\textit{Picture zero}}
\label{fig:piczero}
\end{raggedright}
Thanks again !!!

- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
2 table questions: align caption & notes environment
Code: Select all
\documentclass[11pt,a4paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{babel}
\usepackage[font=small,labelfont=bf,singlelinecheck=false]{caption}
\usepackage{lmodern}
\usepackage{blindtext}
\parindent0em
\begin{document}
\blindtext
\begin{figure}[!ht]
\centering
\begin{minipage}{0.5\textwidth} % Desired width of the figure
\rule{\linewidth}{0.5\linewidth} % To be replaced with graphics file
\caption{Dummy Figure}\label{fig:dummy}
\end{minipage}
\end{figure}
\blindtext
\end{document}
Code: Select all
\includegraphics[width=\linewidth]{graphicsfile}
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
2 table questions: align caption & notes environment
Code: Select all
\documentclass{article}
\usepackage[font=small,labelfont=bf,singlelinecheck=false]{caption}
\usepackage{floatrow}
\begin{document}
\begin{figure}
\ffigbox[\FBwidth]
{\caption{Dummy figure}\label{fig:test}}
{\rule{7cm}{4cm}}%just to simulate an actual figure
\end{figure}
\end{document}