KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
How do you create a command with optional arguments in LaTeX? Something like: \newcommand{\sec}[2][]{ \section*{#1 \ifsecondargument and #2 \fi} } } Then, I can call it like \sec{Hello} %Output: Hello \sec{Hello}{Hi} %Output: Hello and Hi
Tags (comma-separated)
Save Edits
Cancel