I've created a new symbol using the macro:
\documentclass{article}
\usepackage{amssymb}
\newcommand{\qc}{$\square$\kern-0.58em{s}}
\begin{document}
\qc
\end{document}
However I'd like the letter 's' to be centered vertically, how can I do this?
I've created a new symbol using the macro:
\documentclass{article}
\usepackage{amssymb}
\newcommand{\qc}{$\square$\kern-0.58em{s}}
\begin{document}
\qc
\end{document}
However I'd like the letter 's' to be centered vertically, how can I do this?
If the baseline of the open square is supposed to be on the typographic basedline, the following code may be of interest. (By using \ooalign, one doesn't have to insert a kern after the "s" glyph.) The d and b characters are there just to indicate the overall size of the composite symbol.
\documentclass{article}
\usepackage{amssymb} % for "\square" macro
\newcommand{\qc}{%
\ooalign{$\square$\cr\kern0.21em\raise0.28ex\hbox{s}}}
\begin{document}
\obeylines % just for this example
\footnotesize d\qc b
\small d\qc b
\normalsize d\qc b
\large d\qc b
\Large d\qc b
\end{document}
amsmath package and issue the instruction \renewcommand\qedsymbol{\qc}.
– Mico
Mar 12 '17 at 17:10
proof environment.
– Mico
Mar 12 '17 at 17:17
I assume you want a math symbol. If not, it would be easy to adjust the macro.
\documentclass{article}
\usepackage{amssymb}
\makeatletter
\DeclareRobustCommand\qc{%
\mathrel{% <-- or \mathbin, or ...
\vphantom{\square}%
\mathpalette\aw@qc\relax
}%
}
\newcommand{\aw@qc}[2]{%
\sbox\z@{$#1\square$}%
\sbox\tw@{$#1\mathrm{s}$}%
\dimen@=.5\dimexpr\ht\z@-\ht\tw@\relax
\ooalign{%
$\m@th#1\square$\cr
\hidewidth\raise\dimen@\box\tw@\hidewidth\cr
}%
}
\makeatother
\begin{document}
\footnotesize $d\qc b$
\small $d\qc b$
\normalsize $d\qc b_{\qc}$
\large $d\qc b$
\Large $d\qc b$
\end{document}
For each math style, the amount of raising is computed as half the height of the square minus the height of ‘s’. With \ooalign we get the superposition.
If you want a substitute for the QED marker in amsthm, here's the code. The twocolumn option is just for making a smaller picture.
\documentclass[twocolumn]{article}
\usepackage{amssymb,amsthm}
\makeatletter
\newcommand{\qc}{%
\begingroup
\vphantom{\openbox}%
\sbox\z@{\openbox}%
\sbox\tw@{$\mathrm{s}$}%
\dimen@=.5\dimexpr\ht\z@-\ht\tw@\relax
\ooalign{%
\box\z@\cr
\hidewidth\raise\dimen@\box\tw@\hidewidth\cr
}%
\endgroup
}
\makeatother
\begin{document}
\begin{proof}\renewcommand{\qedsymbol}{\qc}
Some proof with the modified symbol at the end of the line.
\end{proof}
\begin{proof}
Some proof with the standard symbol at the end of the line.
\end{proof}
\end{document}
sbe above the baseline), or should the square be pushed down a bit so that thesis on the baseline? – Mico Mar 12 '17 at 16:21