Trying to figure out how they place the command names on the left margin on package docs on CTAN, e.g.
I have tried using marginpar, but my text is not properly aligned. Minimal example:
\documentclass{article}
\usepackage[a4paper,left=6cm,top=2cm,right=2cm,bottom=2cm]{geometry}
\usepackage{marginnote}
\usepackage{lipsum}
\begin{document}
\reversemarginpar\marginpar{\raggedright SomeCommand}%
\lipsum[1]
\end{document}
Result:
Obviously, the text on the left is not aligned to the first line of the paragraph, which is the desired effect. I am also interested in having the text on the left to use \ttfamily.
How should I proceed?




docpackage (orltxdocclass which usesdoc.) The source for every document is available at the same place (minted.dtxin this example) – David Carlisle Jun 26 '22 at 22:17docpackage exposes things strictly related to documenting other Latex packages. Is that the way to go for me? – Victor Jun 26 '22 at 22:39docis almost certainly the answer of the question you asked, but it may not be the answer for your real use case as it is rather specialised for tex packages. You may prefer a basic description list and useenumitempackage to adjust the layout to your requirements – David Carlisle Jun 26 '22 at 22:44DescribeMacromacro. Search for an example in any dtx file (or in this unrelated answer of mine for an example that is usable in "normal TeX files" i.e. one that doesn't "comment out every lines". – user202729 Jun 27 '22 at 00:30documentationlibrary of tcolorbox. – frougon Jun 27 '22 at 12:53