LaTeX function which centres the second argument within the first argument and leaves the correct amount of space at the end.
\newcommand{\centretext}[2]{%
\newlength{\widthA}%
\settowidth{\widthA}{#1}%
%
\newlength{\widthB}%
\settowidth{\widthB}{#2}%
%
\newlength{\moveL}%
\setlength{\moveL}{\widthA}%
\addtolength{\moveL}{-1\widthB}%
\setlength{\moveL}{-0.5\moveL}%
\addtolength{\moveL}{-1\widthB}%
%
\newlength{\moveR}%
\setlength{\moveR}{\moveL}%
\addtolength{\moveR}{\widthB}%
\setlength{\moveR}{-1\moveR}%
%
#1\hspace{\moveL}#2\hspace{\moveR}%
}
Usage Example:
$\bigcirc$ bb
\centretext{$\bigcirc$}{{\scriptsize ai}} bb
Note that the text 'ai' is centred within the circle and the text 'bb' at the end of the two lines are aligned with each other.
Monday, July 6, 2009
Measure Width of Text in LaTeX
\newlength{\textwidth}
\settowidth{\textwidth}{hello}
Example:
hello\hspace{\textwidth}hell\_
Similarly:
\settodepth
References:
http://www-h.eng.cam.ac.uk/help/tpl/textprocessing/teTeX/latex/latex2e-html/ltx-90.html
http://www-h.eng.cam.ac.uk/help/tpl/textprocessing/teTeX/latex/latex2e-html/ltx-312.html
\settowidth{\textwidth}{hello}
Example:
hello\hspace{\textwidth}hell\_
Similarly:
\settodepth
References:
http://www-h.eng.cam.ac.uk/help/tpl/textprocessing/teTeX/latex/latex2e-html/ltx-90.html
http://www-h.eng.cam.ac.uk/help/tpl/textprocessing/teTeX/latex/latex2e-html/ltx-312.html
Thursday, July 2, 2009
Always show the Go button in Firefox 3
In Firefox 3, the Go button only shows up when you’re typing in the Location bar. You can show the Go button permanently by following these instructions.
- Open the folder that contains your Firefox profile (if you don’t know where that is you can read this page in the Mozillazine Knowledge Base).
- Look for a directory named
chrome
and open it. If the directory does not exist, create it. - Open the file called
userChrome.css
. If the file does not exist, create a blank text file and call ituserChrome.css
. - Make sure that the following is the first line of the file (taken from the file
\chrome\userChrome-example.css ):@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* set default namespace to XUL */
- At the end of the file, add the following line:
#urlbar[pageproxystate="valid"] > #urlbar-icons > #go-button { visibility: visible !important;} /* Show the Go button permanently in the location bar */
- Restart Firefox.
Disable Extension Compatibility Checking in Firefox 3
- Type
about:config
into Firefox's address bar and click the "I'll be careful, I promise!" button. Right-click anywhere. Choose New>Boolean. Name the new config valueextensions.checkCompatibility
and set it tofalse
.Right-click anywhere and choose New>Boolean again. Name this new boolean pairextensions.checkUpdateSecurity
and set the value tofalse
.- Right-click anywhere. Choose New>Boolean. Name the new config value
extensions.checkCompatibility.VERSION
and set it tofalse
. - e.g.
extensions.checkCompatibility.3.6
- Note the capital C in checkCompatibility - it's important.
VERSION
is the version number of firefox, e.g.3.6
- If using an Alpha version, the version number would be
VERSIONa
, e.g.3.6a
- If using a Beta version, the version number would be
VERSIONb
, e.g.3.6b
- Restart Firefox.
How to uninstall Microsoft .NET Framework Assistant from Firefox
- Open the Registry Editor (Start > Run: regedit)
- Navigate to the key
HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Firefox\extensions
(or HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mozilla\Firefox\extensions for 64-bit versions of Windows) - Delete the value with name
{20a82645-c095-46ed-80e3-08825760534b} - Restart Firefox.
Subscribe to:
Posts (Atom)