## LaTeX forum ⇒ Page Layout ⇒ Enumerate Items Below Tikz Topic is solved

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
tpa77l3
Posts: 19
Joined: Mon Feb 24, 2020 9:49 pm

### Enumerate Items Below Tikz

Hi guys,

I'm having trouble positioning a tikzpicture where I'd like it in relation to the \item I'm nesting it under.

\begin{enumerate}[label=\roman*)]	\item Where A is the age in years of a junior runner, A $<$ 16 reads as A is less than 16'.	\vspace {3mm}	\item	\begin{figure}[H]	\centering	\begin{tikzpicture}[    dot/.style={draw, fill=#1, circle, inner sep=1.5pt},    filled/.style={dot},    open/.style={dot=white}]\begin{axis}[    x=12mm,    axis y line=none,    axis x line=center,    xtick align=outside,    xtick={9,...,16},    xmin=8, xmax=17,     ymin=0, ymax=1,    xlabel=$x$,    xlabel style={anchor=north}]\addplot [black]    coordinates {(9,.1) (16,.1)}         node [filled, at start] {}        node [open] {}        node [above, midway] {A};\end{axis}\end{tikzpicture}\end{figure}\end{enumerate}

Gives:

Screenshot 2020-02-27 at 04.39.21.png (16.18 KiB) Viewed 283 times

I'm looking to have the second item number [ii)] above the number line. I've played around with some float options but haven't had any luck. What am I doing wrong? Thanks in advance!
Last edited by cgnieder on Sun Mar 01, 2020 5:18 pm, edited 1 time in total.
Reason: added inline code formatting

Bartman
Posts: 70
Joined: Fri Jan 03, 2020 2:39 pm
Please remember to offer a complete example.

You don't need the figure environment to insert a picture. Add baseline=(current bounding box.north) to the options list of the environment tikzpicture.

\documentclass{article}\usepackage{enumitem}\usepackage{csquotes}% for \enquote\usepackage{pgfplots}\pgfplotsset{compat=1.16} \begin{document}\begin{enumerate}[label=\roman*)]    \item Where A is the age in years of a junior runner,     A $<$ 16 reads as \enquote*{A is less than 16}.    \item    \begin{tikzpicture}[        baseline=(current bounding box.north),        dot/.style={draw, fill=#1, circle, inner sep=1.5pt},        filled/.style={dot},        open/.style={dot=white}    ]    \begin{axis}[        x=12mm,        axis y line=none,        axis x line=center,        xtick align=outside,        xtick={9,...,16},        xmin=8, xmax=17,         ymin=0, ymax=1,        xlabel=$x$,        xlabel style={anchor=north}    ]    \addplot [black]        coordinates {(9,.1) (16,.1)}             node [filled, at start] {}            node [open] {}            node [above, midway] {A}    ;    \end{axis}    \end{tikzpicture}\end{enumerate}\end{document}

tpa77l3
Posts: 19
Joined: Mon Feb 24, 2020 9:49 pm
Duly noted about the complete example for the future.

Thanks for the input again. I'll take a look at the baseline option to get my head around it and thanks for pointing me in the direction of the csquotes` package.