質問用フォーラムです。ご質問の前に質問のしかたをご覧ください。

\item 内の minipage 環境の上下余白について

- 佐藤 健治 の投稿

こんにちは。初めて投稿します。

enumerate環境の各\itemの幅を詰めて,メインテキストの右側の空いたスペースに True / False のようなテキストを挿入するレイアウトを実現したいです。下のようなイメージです。

(1) Some text.      True / False
(2) Another text.   True / False

試みとして,\item の中にminipage環境を入れて下のように書いてみました。

メインテキストが1行のみのときは問題ないのですが,テキストが複数行に及ぶ項目があると,その項目と次の項目の行間が極端に小さくなってしまいます。


\documentclass[a4paper,lualatex,ja=standard]{bxjsarticle}

\usepackage{enumitem}

\newcommand\TorF{T / F}
\newcommand{\tfitem}[1]{\item \begin{minipage}[t]{10em}#1\end{minipage}\hfill\TorF}

\newlist{TFquiz}{enumerate}{1}
\setlist[TFquiz]{label=(\arabic*), align=left}

\begin{document}

\begin{TFquiz}
\tfitem{Some text.}
\tfitem{Some loooooooooooooooooong text.}
\tfitem{Another text.}
\end{TFquiz}

\end{document}

サンプルは bxjsarticlelualatex を使うことを想定していますが, jsarticleplatex でコンパイルしても同様でした。

articleクラスに変更して pdflatexでコンパイルすると,この余白問題は発生しませんでした。 なので,日本語ドキュメント用クラスファイル特有の問題あるいは仕様なのかな,と想像しています。

minipage環境を必ず使いたいというわけではないので他の方法でもよいのですが, 上記のようなレイアウトを(日本語文書で)実現できる方法はありますでしょうか。

PDFをチェックして場当たり的に\vspaceを書いたり消したりしない方法を希望しています。 よろしくお願いします。なお,当方,Mac で TexLive 2020 を利用しています。関係あるのか分かりませんが,細かいことを言えばTinyTex を入れたあとに,scheme-fullをインストールしています。

Texworksがうまく動きません

- umidori island の投稿
はじめて質問させていただきます。
Ubuntu 20.04 に、texlive2020 で、Texworksがうまく動きません。

具体的には、
===

\documentclass{jlreq}

\begin{document}


\section{序章}


\subsection{チャーチルのメモ}


1940 年、ウインストン・チャーチル。


\begin{quotation}

我々の職務を遂行するには大量の書類を読まねばならぬ。。

\end{quotation}

 

\end{document}

===


このようなソースをTexworks でLualatex でタイプセットしようとすると、下記が出ます。


===

This is LuaTeX, Version 1.10.0 (TeX Live 2019/Debian)

restricted system commands enabled.

(./kinoshita.tex

LaTeX2e <2020-02-02> patch level 2

[\directlua]:1: module 'luaotfload-main' not found:

no field package.preload['luaotfload-main']

[kpse lua searcher] file not found: 'luaotfload-main'

[kpse C searcher] file not found: 'luaotfload-main'

Error in luaotfload: reverting to OT1 L3 programming layer <2020-02-14>


! LaTeX Error: File `jlreq.cls' not found.


Type X to quit or <RETURN> to proceed,

or enter new name. (Default extension: cls)


Enter file name:

===


1行目に「TeX Live 2019」とあるのがおかしいようです。(2019は前に入れていて、消しました)


なお、コマンドラインからは、

===

$ lualatex kinoshita.tex This is LuaHBTeX, Version 1.12.0 (TeX Live 2020)

===

以下で、問題なく pdf が生成されます。


本は、LaTeX2ε美文書作成入門第7版をこれまで読んでおり、第8版を購入したばかりですが、ヒントは見つかっておりません。


Webでは過去に

https://okumuralab.org/tex/mod/forum/discuss.php?d=2014

こちらに同様の質問を見つけましたが、設定がおかしいらしいということだけで、結果は不明です。



初めてですので、このような情報で足りるのかもよく分かりませんが、何か必要でしたらご教示ください。


よろしくお願いします。




Lualatexでヘブル語

- nori mori の投稿
お世話になります。
Windows10 , Texlive2020 の環境です。
MS-wordで正しく表示できるヘブル語がLualatexでは母音記号が
ずれてしまいます。以下の画像はPrintScreenしたものです。
画像の左青枠内がMs-word、右がLualatexのpdf出力です。
ヘブル語のフォントはSBL HebrewとEzra SILで試しています。
若干違いますが両方ともずれる点では同じです。
一番目立つのは、正しく表示されているMs-wordの画像の赤文字で
下のドット2つ縦は本来は上の文字(コを反時計回り90度)の
下真ん中に来るはずですが、Lualatexでは左足の下に来ています。

(1)Lualatexの処理メッセージ
Welcome to the Emacs shell

~/tex-rensyu $ lualatex.exe luatex003.tex
This is LuaHBTeX, Version 1.12.0 (TeX Live 2020/W32TeX)
restricted system commands enabled.
(./luatex003.tex
LaTeX2e <2020-10-01> patch level 4
L3 programming layer <2021-02-18>
(c:/texlive/2020/texmf-dist/tex/latex/base/article.cls
Document Class: article 2020/04/10 v1.4m Standard LaTeX document class
(c:/texlive/2020/texmf-dist/tex/latex/base/size10.clo))
(c:/texlive/2020/texmf-dist/tex/latex/fontspec/fontspec.sty
(c:/texlive/2020/texmf-dist/tex/latex/l3packages/xparse/xparse.sty
(c:/texlive/2020/texmf-dist/tex/latex/l3kernel/expl3.sty
(c:/texlive/2020/texmf-dist/tex/latex/l3backend/l3backend-luatex.def))
(c:/texlive/2020/texmf-dist/tex/latex/l3packages/xparse/xparse-2020-10-01.sty
(c:/texlive/2020/texmf-dist/tex/latex/l3packages/xparse/xparse-generic.tex)))
(c:/texlive/2020/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty
(c:/texlive/2020/texmf-dist/tex/latex/base/fontenc.sty)
(c:/texlive/2020/texmf-dist/tex/latex/fontspec/fontspec.cfg))) (./luatex003.aux
) (c:/texlive/2020/texmf-dist/tex/latex/base/ts1cmr.fd) [1{c:/texlive/2020/texm
f-var/fonts/map/pdftex/updmap/pdftex.map}] (./luatex003.aux))
406 words of node memory still in use:
3 hlist, 1 vlist, 1 rule, 2 glue, 3 kern, 1 glyph, 4 attribute, 48 glue_spec
, 4 attribute_list, 1 write nodes
avail lists: 2:67,3:14,4:1,5:42,6:12,7:246,9:94,11:2
<c:/texlive/2020/texmf-dist/fonts/opentype/public/lm/lmroman10-regular.otf><c:/
Users/nori2/AppData/Local/Microsoft/Windows/Fonts/SILEOT.ttf><c:/Users/nori2/Ap
pData/Local/Microsoft/Windows/Fonts/SBL_Hbrw.ttf><c:/texlive/2020/texmf-dist/fo
nts/opentype/public/lm/lmroman17-regular.otf>
Output written on luatex003.pdf (1 page, 26851 bytes).
Transcript written on luatex003.log.
~/tex-rensyu $

(2)texの内容
\documentclass{article}
\usepackage{fontspec}

\begin{document}

\Huge

This is a pen.

\vspace{5mm}

(1)SBL Hebrew {\textdir TRT{\fontspec{SBL Hebrew}אֲנַ֫חְנוּ}}

\vspace{5mm}

(2)Ezra SIL {\textdir TRT{\fontspec{Ezra SIL}אֲנַ֫חְנוּ}}

\vspace{5mm}

\fboxsep=0pt

(3) {\textdir TRT{\fontspec{SBL Hebrew}\fbox{חְ}}}

(4) {\textdir TRT{\fontspec{SBL Hebrew}\fbox{ח}}}

(5) {\textdir TRT{\fontspec{SBL Hebrew}\fbox{ְ}}}

\end{document}

TeXLive2020をインストールした後で、上記ヘブル語フォントをインストールし、
その後入力のためにキーボードドライバーをインストールしています。

何かすべきことをしていないのでしょうか。

よろしくお願い致します。
添付 tex-situmon.jpg

tlmgr update --self --all でエラーになります。

- mr2h の投稿
Win10です。

最近、 texlive-scripts の update のときに、この2回ほど失敗します。

texlive-scripts [343k] (58272 -> 58321) ... tar: Could not create file texmf-dist/fonts/map/dvips/tetex/base14flags.ltx: Permission denied
TLUtils::untar: C:\texlive\2020\tlpkg\installer\tar.exe xmf C:\Users\mr2h-\AppData\Local\Temp\RHIpTZkhYE\NNQs89_baA/texlive-scripts.tar failed (in C:/texlive/2020)
TLPDB::_install_data: untar failed for https://ftp.kddilabs.jp/CTAN/systems/texlive/tlnet/archive/texlive-scripts.tar.xz
tlmgr.pl: Installation of new version of texlive-scripts failed, trying to unwind.
tlmgr.pl: Restoring old package state succeeded.

なぜ、Parmission denied となり、texlive-scripts.tar が untarできないのでしょうか?

対処法など教えていただきたく。なおほかのフアイルは問題ないようです。

jlreqとotf expertオプション

- 楠本 修司 の投稿
こんにちは。

これまで、私はupLaTeXでjsclassesを使ってきました。しかし、最近jlreqの評判が良さそうということで、LaTeX環境の見直しをしています。

ずっとotfを[expert,deluxe,burasage,jis2004,multi]{otf}で読み込んでお世話になってきました。フォントメトリックが美しいと聞いていたからです。
jlreqは独自のフォントメトリックを使用しているとのことで、otfとの併用で悩んでいます。jlreqのフォントメトリックを使用するには、otfを辞めれば良いのでしょうが、
1. ajナンチャラ系のコマンドが使えない
2. ルビ用仮名、縦書き用仮名が使えない
3. 多書体化が出来ない
という問題が起こりました。

1. はotfをnoreplaceで読み込むことで、3. はjlreq-deluxeを使用することで解決出来たと思います(解決になっていないのかもしれませんが)。
しかし、2. はうまいやり方が分かりませんでした。

ルビ、縦書き専用仮名を使いたいのであればjlreqは諦めるべきなのでしょうか。

また、現在は処理に時間がかかることや資料が少ないことからLuaLaTeXは見送っているのですが、過去の資料にとらわれなければLuaにした方がメリットは大きいのでしょうか。

【質問】フッターにコピーライト表示を追加したい

- keiji matsuzono の投稿
初めて投稿させていただきます。latex の設定について教えていただけないでしょうか。

やりたいこと:
latex で作成した PDF のフッターにコピーライトを追加したい。
例) "Copyright John Doe All right reserved."

調べて分かったこと:
(a) プリアンブルの後ろに fancyhdr を使ってヘッダーとフッターをカスタマイズできるらしい。
例)
\usepackage{fancyhdr}

\pagestyle{fancy}
\fancyhead{}
\fancyhead[RE]{\rightmark}
\fancyhead[LO]{\leftmark}
\fancyhead[LE,RO]{\thepage}
\fancyfoot{}

(b) ヘッダー/フッターのマクロの再定義
\@oddhead, \@oddfoot, \@oddhead, \@evenfoot を再定義すればよいらしい。
例)
\makeatletter
\def\@oddhead{\rightmark\hfil\thepage}
\makeatother

(a) のほうが自由度が高いが、文字列を追加するだけなら(b)でできそう。

不明な点:
1. (b) でコピーライトの文字列を入れるにはどう書けばよいのか?
直接埋め込んでいいのか、変数を定義してそれを参照するようにうめこむのか?
\makeatletter
\def\@oddfoot{"Copyrightの文字列"\rightmark\hfil\thepage}
\makeatother

2. (b) を書く場所
sphinx の場合、latex のオプションは conf.py の latex_elements に書くが、
(b) をどこにどんな風に書けばよいのか?
例)
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}
実行環境:
Windows10(64bit)上のVirtualBoxで、Ubuntu20.04LTS(Linux)を動かしています。
Ubuntu 上で sphinx を動かし、latex を通して PDF ファイルを作成しています。

・shinx のバージョン
$ shinx-build --version
sphinx-build 1.8.5

・latex のバージョン
$ latex --version
pdfTeX 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian)
kpathsea version 6.3.1
Compiled with libpng 1.6.37; using libpng 1.6.37
Compiled with zlib 1.2.11; using zlib 1.2.11
Compiled with xpdf version 4.01

以上、宜しくお願いします。

ページ番号を途中からすべて消す

- t bz の投稿
特定のページ番号は\thispagestyle{plane}で消せますが、途中からすべてのページ番号を消す便利な方法はないでしょうか。
毎回\thispagestyle{plane}を入力するのが面倒でして・・・

MePoTeXによる図形グラフの作成

- y. umeno の投稿
このフォーラムは、久しぶりの書き込みになります。

TeXの部屋」を開設してTeXに関する諸情報に
リンクを貼っておりましたが、このたび、
TeXのコードにMetaPostのコードを簡潔に書き込んで
立体図形や曲面描画までできるマクロパッケージ
「MePoTeX」に出会いました。すでに、10年以上も前に
発表されたパッケージのようですが、今年になってから
存在を知り、試してみたら非常に便利でした。
ほとんど「emath」のノリで立体図形や曲面描画ができ
パラパラ漫画まで作成できることには感激しました。

MePoTeXについては、このフォーラムでもときおり質問が
出されていますが、Web検索しても詳しく解説している
サイトは皆無です。そこで、知ったばかりなのですが、
その解説ページを作成してみました。

通常の数学教材の作成は、「emath」+「MePoTeX」が
あれば十分なのではないかとまで思えます。
関心を持たれた方は、よろしければご利用ください。




tabular環境の要素に定義したコマンドを差し込む方法

- TONE Kozaburo の投稿
Windows10 で W32TeX の pLaTeX を使っています。

% pLaTeX
\documentclass[dvipdfmx]{jsarticle}

\newcommand{\hoge}[3]{#1&#2&#3}%
\newcommand{\fuga}[2]{#1&#2}%

\pagestyle{empty}
\begin{document}

\begin{tabular}{ccc}%% OK
\hoge{9}{8}{7}\\
\fuga{5}{6}&\\
\end{tabular}

\end{document}

上記の例だと上手くいくのですが、tabular環境をコマンドにして以下のようにしました。

% pLaTeX
\documentclass[dvipdfmx]{jsarticle}

\newcommand{\hoge}[3]{#1&#2&#3}%

\newcommand{\fuga}[2]{#1&#2}%

\newcommand{\hogefuga}{%
\begin{tabular}{ccc}
\hoge{##1}{##2}{##3}\\
\fuga{##1}{##2}&\\
\end{tabular}}

\pagestyle{empty}
\begin{document}

\hoge{3}{4}{5}
\fuga{8}{9}

\hogefuga%% NG

\end{document}

ところが、これは上手く行きません。
以下のようなエラーを吐きます。

This is e-pTeX, Version 3.141592653-p3.9.0-210218-2.6 (utf8.sjis) (TeX Live 2021/W32TeX) (preloaded format=platex)
restricted \write18 enabled.
entering extended mode
(./ng.tex
pLaTeX2e <2020-10-01>+2 (based on LaTeX2e <2020-10-01> patch level 4)
L3 programming layer <2021-02-18>
Babel <3.55> and hyphenation patterns for 83 language(s) loaded.
(c:/usr/local/share/texmf-dist/tex/platex/jsclasses/jsarticle.cls(guessed encoding: UTF-8 = utf8)
Document Class: jsarticle 2020/10/09 jsclasses (okumura, texjporg)
(c:/usr/local/share/texmf-dist/tex/platex/jsclasses/jslogo.sty))
(c:/usr/local/share/texmf-dist/tex/latex/l3backend/l3backend-dvipdfmx.def
(|extractbb --version))
No file ng.aux.
! Misplaced alignment tab character &.
\hoge #1#2#3->#1&
                #2&#3
l.17 \hoge{3}{4}{5}

苦し紛れに次のようにしてみました。

% pLaTeX
\documentclass[dvipdfmx]{jsarticle}

%\newcommand{\hoge}[3]{#1&#2&#3}%
\newcommand{\hoge}[3]{#1\&#2\&#3}%

%\newcommand{\fuga}[2]{#1&#2}%
\newcommand{\fuga}[2]{#1\&#2}%

\newcommand{\hogefuga}{%
\begin{tabular}{ccc}
\hoge{##1}{##2}{##3}\\
\fuga{##1}{##2}&\\
\end{tabular}}

\pagestyle{empty}
\begin{document}

\hoge{3}{4}{5}
\fuga{8}{9}

\hogefuga%% NG

\end{document}

しかし、別なエラーを吐いてしまいました

This is e-pTeX, Version 3.141592653-p3.9.0-210218-2.6 (utf8.sjis) (TeX Live 2021/W32TeX) (preloaded format=platex)
restricted \write18 enabled.
entering extended mode
(./ng2.tex
pLaTeX2e <2020-10-01>+2 (based on LaTeX2e <2020-10-01> patch level 4)
L3 programming layer <2021-02-18>
Babel <3.55> and hyphenation patterns for 83 language(s) loaded.
(c:/usr/local/share/texmf-dist/tex/platex/jsclasses/jsarticle.cls(guessed encoding: UTF-8 = utf8)
Document Class: jsarticle 2020/10/09 jsclasses (okumura, texjporg)
(c:/usr/local/share/texmf-dist/tex/platex/jsclasses/jslogo.sty))
(c:/usr/local/share/texmf-dist/tex/latex/l3backend/l3backend-dvipdfmx.def
(|extractbb --version))
No file ng2.aux.
! You can't use `macro parameter character #' in restricted horizontal mode.
<recently read> ##

l.22 \hogefuga
              %% NG

根本的に何か間違っていると思うのですが、自分では解決できません。どなたかご教示願います。

初歩的な、keyboard入力の方法でわからないことがあります。

- mr2h の投稿
以下の例文で、
==================================================
\documentclass[12pt,a4paper]{article}
\usepackage{cmdcfrak,german}
\begin{document}
\Large
\cmfrakfamily
\fraklines
"Uber ein Jahr nahm sich der K"onig eine andere Gemahlin.
Es: war eine sch"one Frau, aber sie war stolz und
"uberm"utig und konnte nicht leiden, da"s sie an Sch"onheit
von jemand sollte "ubertroffen werden. Sie hatte einen
wunderbaren Spiegel, wenn sie vor den trat und sich
darin beschaute, sprach sie:
\begin{verse}
''Spieglein, Spieglein an der Wand, \\
wer ist die sch"onste im ganzen Land?''
\end{verse}
So antwortete der Spiegel:
\begin{verse}
''Frau K"onigin, Ihr seid die sch"onste im Land.''
\end{verse}
Da war sie zufrieden, denn sie wu"ste, da"s der Spiegel die
Wahrheit sagte.
\end{document}
=================================================
滅多に使わないドイツ語の umlautの入力において、"が
普通使うダブルコーテーション、つまりShift+2では似たような"となりますが、これではうまくゆかないのです。
しかたなく、例文からコピペしているという情けなさです。極めて初歩的質問で叱られそうですが、教えていただけますか?