New answers tagged

7

tabularx suppresses all kinds of tex warnings during trials in particular it sets \hbadness\@M and then disables anyone setting it back by going \let\hbadness\@tempcnta so you can use \ifx\hbadness\@tempcnta % do nothing in trials \else do something in the final run \fi


12

The definition of \appto is % etoolbox.sty, line 891: \newrobustcmd{\appto}[2]{% \ifundef{#1} {\edef#1{\unexpanded{#2}}} {\edef#1{\expandonce#1\unexpanded{#2}}}} The first argument should be a parameterless macro. Why not using \apptocmd? Because it is much less efficient and it may even not succeed if the replacement text has “non standard” ...


9

if you are creating a package that you expect to be used by authors submitting books and papers for publication, you should consider the restrictions set by the likely publishers, and the reasons for those restrictions. mostly, such restrictions are not arbitrary, but are made on account of requirements of the production and printing processes, and the need ...


10

Best ways will provoke opinion based answers... Well, here is my opinion: At the first glance, I found expl3 syntax terrible, but meanwhile I have transformed my first package from L2 to expl3, extending it's facilities tremendously. 'Currently' I will use expl3 to rewrite the other packages as well, as for the future ones ('some plans I have -- written ...


4

Solution using kvoptions The default value is configured by macro `\myPackage@val@default'. If the value is out of range, then an error message is given and the value is set to the default value. The leading zeros can be omitted in the package options, but the macro \theMyPackageVal is normalized to show four digits. Package file myPackage.sty: ...


4

The xkeyval package sets a family of keys that has the same name like the package. For this family keys can be defined, like \define@key{mypackage.sty}{val}[100]{% \ifnum#1 < -1 \GenericError{Error!}{The value is not in the correct range}{See blabla}{or other blabla} \fi \ifnum#1 > 10000 \GenericError{Error!}{The value ...



Top 50 recent answers are included