LaTeX forum ⇒ Graphics, Figures & TablesInline Todonote

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

Inline Todonote

Postby Pierrotdu18 » Wed Apr 02, 2014 1:14 am

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) :

  1. \documentclass[a4paper, 12pt, fleqn]{article}
  2. \usepackage{todonotes}
  3. \usepackage[utf8]{inputenc}
  4. \usepackage{amsmath}
  5. \usepackage[frenchb]{babel}
  6.  
  7. \usepackage[a4paper]{geometry}
  8. \geometry{top=2cm, bottom=2cm, left=3cm, right=3cm}
  9. \setlength{\marginparwidth}{2.5cm}
  10.  
  11. \begin{document}
  12.  
  13. \begin{tabular}{rcl}
  14. $f\left(x + 2\pi\right)$&=&$ \dfrac {3\cos^2\left(x + 2\pi\right)+1}{\cos^3\left(x + 2\pi\right)+1}$\\\\
  15. &$=$& $\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}$ \\\\
  16. && \todo[inline]{Car $\cos\left(x + 2\pi\right)=\cos\left(x\right)$} \\
  17. &$=$& $\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}$\\\\
  18. &$=$& $\dfrac {3\cos^2\left(x\right)+1}{\cos^3\left(x\right)+1}$
  19. \end{tabular}\\
  20.  
  21. \noindent
  22. Donc, $\forall x\in D, f\left(x+2\pi\right)=f\left(x\right)$\\
  23. $f$ est donc $2\pi$ périodique.
  24.  
  25.  
  26. \end{document}



Thanks for your future help! :D

Tags:

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

Postby Pierrotdu18 » Wed Apr 02, 2014 3:53 pm

I am in a bit of a hurry... Pleaseee... :?

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

Postby Pierrotdu18 » Wed Apr 02, 2014 4:10 pm

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

Postby esdd » Thu Apr 03, 2014 12:38 am

Why do you use a table for the math environment?

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

  1. \documentclass[a4paper, 12pt, fleqn]{article}
  2. \usepackage{todonotes}
  3. \usepackage[utf8]{inputenc}
  4. \usepackage{amsmath}
  5. \usepackage[frenchb]{babel}
  6.  
  7. \usepackage[a4paper]{geometry}
  8. \geometry{top=2cm, bottom=2cm, left=3cm, right=3cm}
  9. \setlength{\marginparwidth}{2.5cm}
  10.  
  11. \usepackage{amsmath}
  12.  
  13. \begin{document}
  14.  
  15. \begin{align*}
  16. f\left(x + 2\pi\right)&= \dfrac {3\cos^2\left(x + 2\pi\right)+1}{\cos^3\left(x + 2\pi\right)+1}\\
  17. &=\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} \\
  18. &\quad\,\text{\parbox{0.4\linewidth}{\todo[inline]{Car $\cos\left(x + 2\pi\right)=\cos\left(x\right)$}}}\\
  19. &=\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}\\
  20. &=\dfrac {3\cos^2\left(x\right)+1}{\cos^3\left(x\right)+1}
  21. \end{align*}
  22.  
  23. \noindent
  24. Donc, $\forall x\in D, f\left(x+2\pi\right)=f\left(x\right)$\\
  25. $f$ est donc $2\pi$ périodique.
  26.  
  27. \end{document}


Best regards
Elke

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

Postby Pierrotdu18 » Sun Apr 06, 2014 8:30 pm

Thank you, it works :)
But I found another way to create a non-inline todonote ;)

User avatar
Johannes_B
Site Moderator
Posts: 4186
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Mon Apr 07, 2014 8:55 am

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.


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 13 guests