Graphics, Figures & TablesInline Todonote

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Pierrotdu18
Posts: 22
Joined: Sun Dec 01, 2013 11:24 pm

Inline Todonote

Post by Pierrotdu18 »

Hello everybody,

I would need your help to change the width of my inline todonote...
Indeed, it takes the whole width, and I didn't find any tip in other forums, websites and even in the documentation.

Package needed : todonote

Here's a MWE (a bit long, cause I kept the equations) :

Code: Select all

\documentclass[a4paper, 12pt, fleqn]{article}
\usepackage{todonotes}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage[frenchb]{babel}

\usepackage[a4paper]{geometry}
\geometry{top=2cm, bottom=2cm, left=3cm, right=3cm}
\setlength{\marginparwidth}{2.5cm}

\begin{document}

\begin{tabular}{rcl}
$f\left(x + 2\pi\right)$&=&$ \dfrac {3\cos^2\left(x + 2\pi\right)+1}{\cos^3\left(x + 2\pi\right)+1}$\\\\
        &$=$& $\dfrac {3\times \cos\left(x + 2\pi\right)\times \cos\left(x + 2\pi\right)+1}{\cos\left(x + 2\pi\right)\times \cos\left(x + 2\pi\right)\times \cos\left(x + 2\pi\right)+1}$ \\\\
        && \todo[inline]{Car $\cos\left(x + 2\pi\right)=\cos\left(x\right)$} \\
        &$=$& $\dfrac {3\times \cos\left(x\right)\times \cos\left(x\right)+1}{\cos\left(x\right)\times \cos\left(x\right)\times \cos\left(x\right)+1}$\\\\
        &$=$& $\dfrac {3\cos^2\left(x\right)+1}{\cos^3\left(x\right)+1}$
\end{tabular}\\

\noindent
Donc, $\forall x\in D, f\left(x+2\pi\right)=f\left(x\right)$\\
$f$ est donc $2\pi$ périodique.


\end{document} 

Thanks for your future help! :D

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

Pierrotdu18
Posts: 22
Joined: Sun Dec 01, 2013 11:24 pm

Re: Inline Todonote

Post by Pierrotdu18 »

I am in a bit of a hurry... Pleaseee... :?
Pierrotdu18
Posts: 22
Joined: Sun Dec 01, 2013 11:24 pm

Re: Inline Todonote

Post by Pierrotdu18 »

Hmm.... In the doc, it is said that "The width of inline todonotes will always be the same as the current line width."...
So, would you have an idea?... :)
esdd
Posts: 36
Joined: Sat Jan 25, 2014 9:13 pm

Inline Todonote

Post by esdd »

Why do you use a table for the math environment?

To change the linewidth for your inline todonote put it in a \parbox.

Code: Select all

\documentclass[a4paper, 12pt, fleqn]{article}
\usepackage{todonotes}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage[frenchb]{babel}

\usepackage[a4paper]{geometry}
\geometry{top=2cm, bottom=2cm, left=3cm, right=3cm}
\setlength{\marginparwidth}{2.5cm}

\usepackage{amsmath}

\begin{document}

\begin{align*}
f\left(x + 2\pi\right)&= \dfrac {3\cos^2\left(x + 2\pi\right)+1}{\cos^3\left(x + 2\pi\right)+1}\\
        &=\dfrac {3\times \cos\left(x + 2\pi\right)\times \cos\left(x + 2\pi\right)+1}{\cos\left(x + 2\pi\right)\times \cos\left(x + 2\pi\right)\times \cos\left(x + 2\pi\right)+1} \\
        &\quad\,\text{\parbox{0.4\linewidth}{\todo[inline]{Car $\cos\left(x + 2\pi\right)=\cos\left(x\right)$}}}\\
        &=\dfrac {3\times \cos\left(x\right)\times \cos\left(x\right)+1}{\cos\left(x\right)\times \cos\left(x\right)\times \cos\left(x\right)+1}\\
        &=\dfrac {3\cos^2\left(x\right)+1}{\cos^3\left(x\right)+1}
\end{align*}

\noindent
Donc, $\forall x\in D, f\left(x+2\pi\right)=f\left(x\right)$\\
$f$ est donc $2\pi$ périodique.

\end{document}
Best regards
Elke
Pierrotdu18
Posts: 22
Joined: Sun Dec 01, 2013 11:24 pm

Re: Inline Todonote

Post by Pierrotdu18 »

Thank you, it works :)
But I found another way to create a non-inline todonote ;)
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Re: Inline Todonote

Post by Johannes_B »

Are you willing to share this other method with us? Might be handy some time.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply