Math & SciencePassing options to commands

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
Vaite
Posts: 2
Joined: Thu Oct 12, 2023 12:19 am

Passing options to commands

Post by Vaite »

Have two commands that take an argument. Would like to enhance the capability to take an option to apply any of the various ceiling sizes (`\bigl`, `Bigl`, `\biggl`, `\Biggl`).

Code: Select all

   \documentclass[a4paper,12pt]{article}
    \usepackage{xcolor}
    
    \ExplSyntaxOn
    
    \NewDocumentCommand \ceil {m}
      { \lceil #1 \rceil }
    
    \NewDocumentCommand \ceilbig {m}
      { \Bigl \lceil #1 \Bigr \rceil }
    
    \ExplSyntaxOff
    
    \begin{document}
    
    \ceil{x}
    
    \end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

Post Reply