[Tex/LaTex] How to align frame title of mdframed on custom place

horizontal alignmentmdframed

mdframed has an option of frametitlealignment, but the manual does not list possible values. I wonder if it accepts values other than left, right and center (apart from derivatives like raggedleft).

Is it possible to place the title in a custom place (e.g. 30% from left)?

If not, how to set padding (margin) for the title? I simply moved the title by

frametitle=\hspace{1em}Title

but the problem is that I use the title in the page header, and do not want this hspace there.

EDIT: MWE for clarification of the problem.

\documentclass{article}

\usepackage{mdframed}
\usepackage{lipsum}
\makeatletter
\mdfdefinestyle{example}{settings={\@mkboth{\mdf@frametitle}{\mdf@frametitle}}}
\makeatother
\pagestyle{headings}
\begin{document}

\begin{mdframed}[style=example,frametitle=\hspace*{0.30\linewidth}Some Title 1]
\lipsum[1]
\end{mdframed}
\end{document}

enter image description here
enter image description here

As can be seen, by adding \hspace to the frametitle, not only the frame title shifts, but also the page header will do. I need to customize the position of frame title, but not the page header.

In fact, I cannot alter frametitle, as its value is exactly used in the page header. I need to align the frame title with frametitlealignment.

Best Answer

You can use frametitlealignment={\hspace*{0.30\linewidth}} to position the text to 30% the \linewidth:

enter image description here

\documentclass{article}

\usepackage{mdframed}
\usepackage{lipsum}
\makeatletter
\mdfdefinestyle{example}{settings={\@mkboth{\mdf@frametitle}{\mdf@frametitle}}}
\makeatother
\pagestyle{headings}
\begin{document}

\begin{mdframed}[style=example,frametitle=Some Title 1,
frametitlealignment={\hspace*{0.30\linewidth}}]
\lipsum[1]
\end{mdframed}
\end{document}