LaTeX forum ⇒ GeneralSide notes along an outline Topic is solved

LaTeX specific issues not fitting into one of the other forums of this category.
strider1551
Posts: 2
Joined: Thu Aug 21, 2014 10:10 pm

Side notes along an outline

Postby strider1551 » Thu Aug 21, 2014 10:56 pm

I'm trying to do a complex layout that I've yet to find a good solution for. A significant amount of my text is an outline with multiple levels, which in the past I have used easylist for. In my next project, though, I have a lot of one-line references that I want to run to the right of the outline, on the exact line for the reference.

I don't want these to be typical marginal notes, though, because these documents have a small marginal space that wouldn't accommodate; they also consist of more than outlines, so if I change the margin size to accommodate there would be a ton of margin space for no reason in everything else. Plus, I want them on the exact line, not floating.

This is what I've come up with so far (borrowing an example from another topic):

  1. \documentclass{article}
  2. \usepackage[letterpaper,margin=0.75in]{geometry}
  3.  
  4. \usepackage{lipsum}
  5. \usepackage{tabularx}
  6.  
  7. \usepackage[sharp]{easylist}
  8. \ListProperties(Indent=2em,Hang=true,FinalMark2=,%
  9. Margin2=2em,Margin3=4.9em,%
  10. Align=move,FinalSpace=1em,%
  11. Hide3=2,%
  12. Style1=\bfseries\scshape)
  13.  
  14. \makeatletter
  15. \newcommand\currlinewidth{\dimexpr\textwidth-\el@TotalMargin\relax}
  16. \newcommand\notewidth{\dimexpr\textwidth-\el@TotalMargin-1in\relax}
  17. \makeatother
  18.  
  19. \begin{document}
  20.  
  21. \lipsum[1]\bigskip
  22.  
  23. \begin{easylist}
  24. # Section
  25. ## \renewcommand{\tabcolsep}{2pt}
  26. \begin{tabularx}{\currlinewidth}{ p{\notewidth} >{\raggedleft\arraybackslash}X }
  27. A really long note that might take several lines to explain because, you know, information and stuff. But no, seriously, sometimes there's like a whole paragraph here with all kinds of crazy things. & DN 2.10.1
  28. \end{tabularx}
  29. ### \renewcommand{\tabcolsep}{2pt}
  30. \begin{tabularx}{\currlinewidth}{ p{\notewidth} >{\raggedleft\arraybackslash}X }
  31. But not always. & AC 1.5.6
  32. \end{tabularx}
  33. ### \renewcommand{\tabcolsep}{2pt}
  34. \begin{tabularx}{\currlinewidth}{ p{\notewidth} >{\raggedleft\arraybackslash}X }
  35. Some don't need a reference, but without a tabularx environment it overflows into the reference space. &
  36. \end{tabularx}
  37. \end{easylist}
  38.  
  39. \end{document}


example.png
example.png (79.77 KiB) Viewed 1686 times


My problems with what I have:
  • The outline numbers are being vertically aligned in the center, not the top.
  • Line spacing in outline seems to get confused? (see lack of space below "Section")
  • Just for my own sanity, the source is pretty hard to read with the repeated begin/end tabularx, and God forbid pages into it I realize I need to make a change in all of those.

I'm also open to suggestions of other ways to do what I want.
Last edited by cgnieder on Fri Aug 29, 2014 10:55 am, edited 1 time in total.
Reason: scaled images to a smaller size so they don't destroy formatting of the site

Tags:

strider1551
Posts: 2
Joined: Thu Aug 21, 2014 10:10 pm

Postby strider1551 » Thu Aug 28, 2014 6:06 pm

Found my own solution. I stopped using easylist or any other list structures, and instead made some of my own counters.

  1. \documentclass{article}
  2. \usepackage[letterpaper,margin=0.75in]{geometry}
  3.  
  4. \usepackage{lipsum}
  5. \usepackage{tabularx}
  6. \usepackage{calc}
  7.  
  8. \newcounter{firstcount}
  9. \newcounter{secondcount}
  10. \newcounter{thirdcount}
  11. \newcommand{\first}{%
  12. \stepcounter{firstcount}%
  13. \setcounter{secondcount}{0}%
  14. \setcounter{thirdcount}{0}%
  15. \bfseries %
  16. \hangindent=25pt\hspace*{0pt}\makebox[25pt][l]{\thefirstcount.}%
  17. }
  18. \newcommand{\second}{%
  19. \stepcounter{secondcount}%
  20. \setcounter{thirdcount}{0}%
  21. \hangindent=50pt\hspace*{25pt}\makebox[25pt][l]{\thefirstcount.\thesecondcount}%
  22. }
  23. \newcommand{\third}{%
  24. \stepcounter{thirdcount}%
  25. \hangindent=75pt\hspace*{50pt}\makebox[25pt][l]{\thethirdcount.}%
  26. }
  27. % Counters need to be reset if there are separate outlines in one document.
  28. \newcommand{\reset}{%
  29. \setcounter{firstcount}{0}%
  30. \setcounter{secondcount}{0}%
  31. \setcounter{thirdcount}{0}%
  32. }
  33.  
  34. \begin{document}
  35.  
  36. \lipsum[1]
  37. \bigskip
  38.  
  39. \noindent
  40. \setlength{\tabcolsep}{0pt}
  41. \begin{tabularx}{\textwidth}{ @{} p{\textwidth-1in} >{\raggedleft\arraybackslash}X @{} }
  42. \first Section & \\
  43. \second A really long note that might take several lines to explain because, you know, information and stuff. But no, seriously, sometimes there's like a whole paragraph here with all kinds of crazy things. & DN 2.10.1 \\
  44. \third But not always. & AC 1.5.6 \\
  45. \third Some don't need a reference, but we still don't want it to overflow into the reference space. & \\
  46. \end{tabularx}
  47.  
  48. \end{document}


example2.png
example2.png (75.78 KiB) Viewed 1686 times
Last edited by cgnieder on Fri Aug 29, 2014 10:56 am, edited 1 time in total.
Reason: scaled image to a smaller size so it doesn't destroy formatting of the site


Return to “General”

Who is online

Users browsing this forum: Bing [Bot] and 6 guests