
MWE は次のとおりです。
\documentclass{scrartcl}
\usepackage{adforn}
\renewcommand{\sectionlinesformat}[4]{%
\ifstr{#1}{section}{%
{\adforn{30} {#3}. {#4} \adforn{58}}
}
{{\hskip#2#3}{#4}}%
}\makeatother
\begin{document}
\section{ABC}
\end{document}
こうなりたいです:1. ABCそしてそうではない1. ABC (「1」と「.」の間にはスペースを入れないでください)それは可能ですか?
もし可能ならば、どうすればできますか?
ありがとう!
答え1
マクロの最後に\sectionformat
は が含まれています。これなしで再定義できます。\enskip
\documentclass{scrartcl}
\usepackage{adforn}
\def\sectionformat{\thesection\autodot}% \enskip
\renewcommand{\sectionlinesformat}[4]{%
\ifstr{#1}{section}{%
{\adforn{30} {#3}. {#4} \adforn{58}}
}
{{\hskip#2#3}{#4}}%
}\makeatother
\begin{document}
\section{ABC}
\end{document}
答え2
グループ中括弧を最小限に抑え、.
次のいずれかを追加する必要があります\sectionformat
。
\documentclass{scrartcl}
\usepackage{adforn}
\renewcommand*{\sectionformat}{\thesection.\enskip}% replaced \autodot by .
\renewcommand{\sectionlinesformat}[4]{%
\ifstr{#1}{section}%
{\adforn{30} #3#4 \adforn{58}}%
{\hskip#2#3#4}%
}\makeatother
\begin{document}
\section{ABC}
\end{document}
または、numbers=withdot
すべてのセクション レベルにドットを追加することを選択します。
\documentclass[numbers=enddot]{scrartcl}
\usepackage{adforn}
\renewcommand{\sectionlinesformat}[4]{%
\ifstr{#1}{section}%
{\adforn{30} #3#4 \adforn{58}}%
{\hskip#2#3#4}%
}
\begin{document}
\section{ABC}
\end{document}
どちらの例も結果は次のようになります。
注意: 2 つのドットが生成されるため、\autodot
in を\sectionformat
ハードコードされたもの.
(仕様により誤って配置されている in\autodot
または on ) と組み合わせないでください。\sectionlinesformat
ぜひご覧くださいKOMA-Script マニュアルのデフォルトおよび 、および の意味については、を\sectionformat
参照してください。numbers=withdot
\sectionformat
\autodot
ところで、\makeatother
あなたの例の も必要ないので削除する必要があります (私はそうしました)。
話題外: また、コードの後の改行}
や{
、コードの途中の実際のスペースによって、不要な空白文字が発生することも避けてください。
コメントによると、これは次の場合には機能しないようですhebrew
:
\documentclass[numbers=enddot]{scrartcl}
\usepackage{polyglossia}
\setmainlanguage{hebrew}
\newfontfamily\hebrewfont[Script=Hebrew]{David CLM}
\newfontfamily\hebrewfonttt[Script=Hebrew]{Miriam Mono CLM}
\newfontfamily\hebrewfontsf[Script=Hebrew]{Simple CLM}
\usepackage{adforn}
\renewcommand{\sectionlinesformat}[4]{%
\ifstr{#1}{section}%
{\adforn{30} #3#4 \adforn{58}}%
{\hskip#2#3#4}%
}
\begin{document}
\section{גדה}
\end{document}
そして
\documentclass{scrartcl}
\usepackage{polyglossia}
\setmainlanguage{hebrew}
\newfontfamily\hebrewfont[Script=Hebrew]{David CLM}
\newfontfamily\hebrewfonttt[Script=Hebrew]{Miriam Mono CLM}
\newfontfamily\hebrewfontsf[Script=Hebrew]{Simple CLM}
\usepackage{adforn}
\renewcommand*{\sectionformat}{\thesection.\enskip}% replaced \autodot by .
\renewcommand{\sectionlinesformat}[4]{%
\ifstr{#1}{section}%
{\adforn{30} #3#4 \adforn{58}}%
{\hskip#2#3#4}%
}
\begin{document}
\section{גדה}
\end{document}
どちらの結果も次のようになります:
これは RL を使用する場合に正しいようです。