Hot answers tagged

7 votes
Accepted

Smarter way to write bullet point notes?

The easylist package is suitable for this kind of use cases. You choose a symbol as package option (at, sharp, ampersand, pilcrow, for @, #, &, ¶ respectively, or not choose a symbol for the ...
user avatar
  • 29.5k
6 votes
Accepted

How to make it so that newcommand takes the rest of my line as argument?

Here's a LuaLaTeX-based solution. It sets up a Lua function, called process_items, which acts as a preprocessor: By the time TeX gets to process the input lines in question, it will not "see"...
user avatar
  • 435k
6 votes
Accepted

Nested lists with roman numerals

Since you mention that the roman-lowercase enumeration style is a one-off requirement for your document, I suggest you (a) load the enumitem package and (b) use its machinery to provide the formatting ...
user avatar
  • 435k
5 votes

Nested lists with roman numerals

Like this. %! TEX program = pdflatex \documentclass{article} \usepackage[shortlabels]{enumitem} \begin{document} \setlist[enumerate,1]{label=(\roman*)} \setlist[enumerate,2]{label=(\roman{enumi}.\...
user avatar
  • 1,404
5 votes

Smarter way to write bullet point notes?

You can include Markdown in LaTeX using the markdown package: \documentclass{article} \usepackage{markdown} \begin{document} \begin{markdown} main phrase * hence A 1. since A follows B 1. ...
user avatar
  • 2,390
4 votes
Accepted

How can I write line numbers inside boxed code

I warmly suggest tcolorbox. \begin{filecontents*}{\jobname.sol} function hello() public returns bool { uint256 amount = 100 return amount * 100 return true; } \end{filecontents*} \...
user avatar
  • 983k
4 votes

How to make it so that newcommand takes the rest of my line as argument?

If you don't plan to use nested lists in this case, you can implement the job in expl3. Split the input at \item and massage the resulting sequence so that uppercasing of the first letter is performed....
user avatar
  • 983k
3 votes

How to make it so that newcommand takes the rest of my line as argument?

You can borrow the \eoldef macro from OpTeX. Syntax: \eoldef\macro #1{body of the macro, #1 can be used} The \macro is defined with its parameter separated by the end of line. In your LaTeX document ...
user avatar
  • 51.7k
3 votes

How can I write line numbers inside boxed code

Use the option framexleftmargin to include the numbers: \expandafter\def\csname ver@fixltx2e.sty\endcsname{} \documentclass[10pt,journal,compsoc]{IEEEtran} \PassOptionsToPackage{table}{xcolor} \...
user avatar
  • 19.3k
3 votes

Smarter way to write bullet point notes?

Just for fun. Of course, you have to remember your level. \documentclass{article} \usepackage{outlines} \usepackage{enumitem} \usepackage{showframe}% alignment tool \begin{document} \begin{outline} \...
user avatar
  • 69.4k
2 votes
Accepted

How to define a custom description environment?

Just % definition \NewDocumentEnvironment{my desp}{ m m }{% \begin{description}[align=right, itemindent=0cm, leftmargin=\labelsep+#1, font=#2] }{ \end{description}% } % usage \begin{my desp}{3cm}{...
user avatar
  • 20.4k
1 vote
Accepted

List with the first item equals the last number in another list + 1

You can try this: \documentclass{article} \usepackage{enumitem}% <-- changed \begin{document} List 1 \begin{enumerate} \item A \item B \end{enumerate} List 2 \begin{...
user avatar
  • 130

Only top scored, non community-wiki answers of a minimum length are eligible