ご質問はこちらへ
otf.styの多書体利用での不具合?
{\sffamily\gtfamily\mdseries これは中ゴシック mdseries}
%太ゴシック体
{\sffamily\gtfamily\bfseries これは太ゴシック bfseries}
%極太ゴシック体
{\sffamily\gtfamily\ebseries これは極太ゴシック ebseries}

\newenvironment 中の filecontents のファイル名の指定
以下で \input{\filename} を入れなければコンパイルはできますが、当然なにも表示されません。
\input{\filename} を入れると、ファイルは作成されるものの、コンパイルができません。
(TeXLive 2019 の pdflatex を使用しています。)
より具体的には、
./output/q-hoge-fuga.tex が無い状態で実行すると、
LaTeX Warning: Writing file `././output/q-hoge-fuga.tex'.
(./output/q-hoge-fuga.tex
! Missing number, treated as zero.
<to be read again>
\protect
l.1 %% LaTeX2e file `./output/q-hoge-fuga.tex'
となります。
この状態でもう一度、pdflatex を実行すると、
LaTeX Warning: File `./output/q-hoge-fuga.tex' already exists on the system.
Not generating it from this source.
(./output/q-hoge-fuga.tex (./output/q-hoge-fuga.tex (./output/q-hoge-fuga.tex
(./output/q-hoge-fuga.tex (./output/q-hoge-fuga.tex (./output/q-hoge-fuga.tex
(./output/q-hoge-fuga.tex (./output/q-hoge-fuga.tex (./output/q-hoge-fuga.tex
(./output/q-hoge-fuga.tex (./output/q-hoge-fuga.tex (./output/q-hoge-fuga.tex
(./output/q-hoge-fuga.tex (./output/q-hoge-fuga.tex
! TeX capacity exceeded, sorry [text input levels=15].
<argument> "./output/q-hoge-fuga.tex"
l.1 %% LaTeX2e file `./output/q-hoge-fuga.tex'
となります。 (再帰的に読み込もうとしている?)
どのようにすれば意図通りの動作になりますでしょうか?
\documentclass{article}
\usepackage{xstring}
\begin{document}
\def\outdir{./output/}
\def\mkfilename#1{
\StrSubstitute{#1}{:}{-}[\filename]
\edef\filename{\outdir\filename.tex}
% 結果を変数に格納する
% (できれば文字列を返し、\newenvironment の中で、\def\filename{\mkfilename{#1}} とかしたい)
}
% 第一引数は xx:yy:zz のような形式のラベル。
% xx 等には特殊な文字や空白などは入らないと仮定。
% この文字列中の : を - に変えたファイル名でファイル作成したい。
% (変更前の文字列は、tcolorbox でラベルを付けるために使用)
\newenvironment{question}[2]{%
\mkfilename{#1}
\csname filecontents\endcsname{\filename}%
%
% \begin{filecontents}{\filename}%
% だと上手くいかない
%
% 後でここに \begin{tcolorbox} を追加したい
% (#2 は tcolorbox 用)
}{% 後でここに \end{tcolorbox} を追加したい
%
% \end{filecontents} % だと上手くいかない
\csname endfilecontents\endcsname%
\input{\filename}% (*1) これが上手くいかない <-----
}
% ./output/q-hoge-fuga.tex としてファイルを作成したい
\begin{question}{q:hoge:fuga}{Title}
$E = mc^{2}$
\end{question}
\end{document}
追加の質問 (こちらは無視していただいても結構です):
上記コードで \begin{filecontents}{\filename}, \end{filecontents} だと以下のようなエラーが出るのですが、
なぜなのでしょう?
(上のコードは検索で出てきたものを参考に書きました)。
LaTeX Warning: Writing file `././output/q-hoge-fuga.tex'.
)
Runaway argument?
! File ended while scanning use of ^^M.
<inserted text>
\par
<*> q.tex
どうしてもコンパイルしません。
\documentclass[a4]{jsarticle}
\usepackage{amsmath, amssymb}
\usepackage{latexsym}
\usepackage{overcite}
\usepackage{amsthm}
\begin{document}
\noindent
\textbf{質問1} \\
\hspace{0.3cm}(458page)なぜ$\textbf{H_j}$は実ヒルベルト空間になるのでしょうか?\\
\end{document}
また、ログの表示は
This is ptex2pdf[.lua] version 20170622.0.
Processing texforum.tex
This is e-pTeX, Version 3.14159265-p3.7.1-161114-2.6 (utf8.sjis) (TeX Live 2017/W32TeX) (preloaded format=platex)
restricted \write18 enabled.
entering extended mode
(./texforum.tex
pLaTeX2e <2017/10/28>+4 (based on LaTeX2e <2017-04-15>)
Babel <3.17> and hyphenation patterns for 84 language(s) loaded.
(c:/texlive/2017/texmf-dist/tex/platex/jsclasses/jsarticle.cls
Document Class: jsarticle 2017/10/04 jsclasses (okumura, texjporg)
(c:/texlive/2017/texmf-dist/tex/platex/jsclasses/jslogo.sty))
(c:/texlive/2017/texmf-dist/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(c:/texlive/2017/texmf-dist/tex/latex/amsmath/amstext.sty
(c:/texlive/2017/texmf-dist/tex/latex/amsmath/amsgen.sty))
(c:/texlive/2017/texmf-dist/tex/latex/amsmath/amsbsy.sty)
(c:/texlive/2017/texmf-dist/tex/latex/amsmath/amsopn.sty))
(c:/texlive/2017/texmf-dist/tex/latex/amsfonts/amssymb.sty
(c:/texlive/2017/texmf-dist/tex/latex/amsfonts/amsfonts.sty))
(c:/texlive/2017/texmf-dist/tex/latex/base/latexsym.sty)
(c:/texlive/2017/texmf-dist/tex/latex/cite/overcite.sty)
(c:/texlive/2017/texmf-dist/tex/latex/cite/cite.sty)
(c:/texlive/2017/texmf-dist/tex/latex/amscls/amsthm.sty)
LaTeX Warning: Unused global option(s):
[a4].
(./texforum.aux) (c:/texlive/2017/texmf-dist/tex/latex/amsfonts/umsa.fd)
(c:/texlive/2017/texmf-dist/tex/latex/amsfonts/umsb.fd)
(c:/texlive/2017/texmf-dist/tex/latex/base/ulasy.fd)
! Missing $ inserted.
<inserted text>
$
l.9 \hspace{0.3cm}(458page)なぜ$\textbf{H_j}
$は実ヒルベルト空間になるのでし...
?
です。よろしくお願いいたします。
TeXShopでの矩形選択について
LuaTeX-jaとtcolorboxの禁則処理
\documentclass[a4j,12pt]{ltjsarticle}
\usepackage[no-math]{luatexja-fontspec}
\usepackage[deluxe,haranoaji]{luatexja-preset}
\usepackage{tcolorbox}
\begin{document}
\begin{tcolorbox}
禁則処理。禁則処理。禁則処理。禁則処理。禁則処理。「禁則処理。」「禁則処理。」
「禁則処理。」「禁則処理。」「禁則処理。」
\end{tcolorbox}
\end{document}
%----------
対処法をご存知のかたがいらっしゃいましたら、ご回答をお願いします。
%==========
EDIT 1:
tcolorboxに限らず、minipageで禁則処理がなされていないようです。
\begin{minipage}{10\zw}
禁則処理。禁則処理。禁則処理。禁則処理。禁則処理。「禁則処理。」「禁則処理。」
「禁則処理。」「禁則処理。」「禁則処理。」
\end{minipage}
LuaTeX-jaとiwonaフォント
\documentclass[a4paper]{ltjsarticle}
\usepackage[no-math,deluxe,haranoaji]{luatexja-preset}
\usepackage[math]{iwona}
\usepackage[T1]{fontenc}
\begin{document}
\[
\int_0^1\sqrt{1-x^2}\,dx
= \pi/4
\approx 0.785398163
\]
Hey! ABCDEFG 12345
\end{document}
%----------
数式部分の数字だけデフォルトから変わらないという奇妙な挙動をします。
プリアンブルからLuaTeX-jaを取り除くと正常になるのですが、
作ろうとしているのは日本語のドキュメントです。
LuaTeX-jaを使いつつiwonaを使いたいのですが、適切な設定を教えていただけないでしょうか。