Forgot password
 Register account
View 2619|Reply 0

align中某式子加框

[Copy link]

676

Threads

110K

Posts

218

Reputation

Show all posts

kuing posted 2015-2-2 19:26 |Read mode
转自Some LATEX2ε tricks and tips (IV) Luca Merciadri
  1. \makeatletter
  2. \newcommand\Aboxed[1]{%
  3. % syntax: \Aboxed{ left & right }
  4. \@Aboxed#1\ENDDNE}
  5. \def\@Aboxed#1&#2\ENDDNE{%
  6. % idea: get the left and right part
  7. % typeset them in a \boxed AFTER an ‘&’
  8. % and pull it backwards
  9. % but in order to get the horizontal
  10. % placement to work we need to set
  11. % some appropriate space to the left
  12. % of the ‘&’
  13. \settowidth\@tempdima{$\displaystyle#1{}$}%
  14. \setlength\@tempdima
  15. {\@tempdima+\fboxsep+\fboxrule}
  16. % \global does not always mix well
  17. % with \setlength
  18. \global\@tempdima=\@tempdima
  19. \kern\@tempdima
  20. &
  21. \kern-\@tempdima
  22. \boxed{#1#2}%
  23. }
  24. \makeatother
Copy the Code
然后
  1. \begin{align*}
  2. \Aboxed{A&=B}\\
  3. A&=B\\
  4. &=C
  5. \end{align*}
Copy the Code

Quick Reply

Advanced Mode
B Color Image Link Quote Code Smilies
You have to log in before you can reply Login | Register account

$\LaTeX$ formula tutorial

Mobile version

2025-7-13 17:37 GMT+8

Powered by Discuz!

Processed in 0.014496 seconds, 22 queries