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

利用可能なパッケージ一覧を取得する方法

- Kobayashi Ryota の投稿
現在自分が使用しているパソコンで利用可能な,LaTeXパッケージの一覧を取得する方法を探しています.LaTeXはTeX Liveのものを使用しています.
ネットで調べたところ,TeX Liveに付属のkpsewhichを使い,ターミナルで

kpsewhich -expand-path='$TEXMF'

を実行することでLaTeXがパッケージを読みに行くパスを取得できることがわかりました.そこでMacのターミナル(bash)から

find $(echo $(kpsewhich -expand-path='$TEXMF') | tr ':' ' ') -name '*.sty' | xargs -I% basename % .sty | sort

とすることで,ひとまずパソコンに入っているパッケージ一覧を取得することができました.

しかしこの方法はWindowsでは使えませんし,TeX Liveに含まれるプログラムの中にはもっと簡単にパッケージ一覧を出力してくれるものがあるのではないか,とも思います.
なにか良い方法はありませんでしょうか.

また,上記のbashのコマンドは「そのパソコンで利用可能なLaTeXパッケージ一覧を取得する」という目的を達成できているでしょうか.

皆様のご意見をお聞かせください.
よろしくお願いいたします.

TeXmakerが突如動作しなくなった

- Imakado Yuki の投稿
はじめまして。TeXについてはほとんど知識のない初学者です。
先日、Windows7(64bit)にTexmakerとTeX Live 2015をインストールして使用していました。
今日久々に起動してみると、何故だかtexファイルを書き換えても全く反映されなくなりました。
また、新しくファイルを書き起こしても、texファイルは保存されるのですが、その他のdviやlog等のファイルが生成されず、Logファイルが見つからない旨のエラーを表示してタイプセットできません。

予備知識が皆無なので、何をどうすれば解決するのか、さっぱりわかりません。
どなたか知恵をお貸し頂ければと思います。どうかよろしくお願い致します。

thmtoolsとlibertineパッケージの組み合わせで、ゴシック体にならない

- 大宮 貴史 の投稿
thmtoolsとlibertineを同時に使用すると、定理環境の「定理1」などの日本語部分「定理」がゴシック体にならず、明朝体になってしまい困っています。
libertineパッケージを外すとゴシック体になるので、この組み合わせに問題があるのだと思うのですが。

環境はOS X El Capitan, TeX Live 2015の最新版(先ほどアップデート済み)です。

解決法があるのなら教えていただきたいです。
よろしくお願いいたします。

以下ソースコードです。

\documentclass[uplatex]{jsarticle}

\usepackage{amsthm}
\usepackage{thmtools}

\usepackage{libertine}

\declaretheoremstyle[
  spaceabove=6pt, spacebelow=6pt,
  headfont=\bfseries\sffamily,
  notefont=\bfseries\sffamily,
  notebraces={(}{)},
  postheadspace=1em
]{theorem}
\declaretheorem[title=定理, style=theorem]{theorem}

\begin{document}

\begin{theorem}
  あいう
\end{theorem}

\end{document}

マセマもどき

- ウッ キー の投稿
以前、大学数学・物理のマセマシリーズのような紙面作りがしたい、とここに書き込みしました。
マセマのサンプル
http://www.mathema.jp/books/abst/en_denjiki.pdf
今回、tikzを使ってなんとか「それらしく」しました。まだ試行錯誤がかなり必要でこれからもっと便利なやり方を模索しますが、「やってやれないことはないな 」とは感じてします。主な点は
・pxpgfmarkパッケージを使って、日本語環境でremember pictureを可能にする
・tikzのremember picture, overlayを使って、数式上に四角やアンダーラインなどのグラフィックを自由に描く
・数式の中の一部の文字に「ノード名」を与え、グラフィックの位置をそのノード名による「相対指定」によって行う。これにより、数式を変更してもグラフィックがそれに合わせて移動するようになる。
もっと良いやり方があると思いますので、アドバイスいただけると嬉しいです。(このレベルにするだけでも、僕的には大変でしたが・・・。)よろしくお願いします。
****************************************************************************
\documentclass[dvipdfmx]{jsarticle}

\usepackage{amsmath}

\usepackage[svgnames]{xcolor}

\usepackage{tikz}

\usepackage{pxpgfmark} % remember picture を可能にする

\usepackage{bm}

\usetikzlibrary{calc,decorations.pathmorphing,backgrounds,intersections}


%ノード名を付与(ウッキー作。もっとよい方法があれば教えてください)

\newcommand{\●}[2] {</p> <p style="margin:0px;text-indent:0px;"> \settowidth{\dimen0}{#2}

\settoheight{\dimen1}{#2}

\begin{tikzpicture}[remember picture,inner sep=0]

\useasboundingbox (0,0) rectangle (\the\dimen0, \the\dimen1);

\node[xshift=\the\dimen0 /2,yshift=\the\dimen1 /2] (#1) {#2};

\end{tikzpicture}

}

%上に0mmずらす。これしないと何故か「ずれる」←理由を教えてください

\newcommand{\raisezero}[1]{\raisebox{0mm}[0pt][0pt]{#1}}


\begin{document}

\begin{align*}

\bm{H}(\bm{r})

&=

\dfrac{1}{4\pi}

\iiint_{V'}

\bm{i}(\bm{r}')

\times

\dfrac

{\●{第1行左上}{$\bm{r}$}

-

\●{第1行右上}{$\bm{r}'$}}

{\●{第1行左下}{\raisezero{$\|$}}

\bm{r}-\bm{r}'

\●{第1行右下}{\raisezero{$\|$}}

^3}

\,\textrm{d}V'

\\[2ex]

&=

-\dfrac{1}{4\pi}

\iiint_{V'}

\●{第2行左}{$\bm{i}$}

(\bm{r}')

\times\nabla

\dfrac

{\●{第2行上}{$\!\!1$}}

{\|</p> <p style="margin:0px;text-indent:0px;"> \bm{r}-\bm{r}'

\●{第2行右下}{\raisezero{$\|$}}

}

\,\textrm{d}V' \\[5ex]

&=\dfrac{1}{4\pi}\iiint_{V'}\nabla\times\dfrac{\bm{i}(\bm{r}')}{\|\bm{r}-\bm{r}'\|}\textrm{d}V' \\

&=\nabla\times\dfrac{1}{4\pi}\iiint_{V'}\dfrac{\bm{i}(\bm{r}')}{\|\bm{r}-\bm{r}'\|}\textrm{d}V'

\end{align*}

\begin{tikzpicture}[remember picture,overlay]

%第1行被注釈

\path [name path=被注釈, red,draw,rounded corners=1ex]

let \p1=(第1行左下.south west), \p2=(第1行左上.north), \p3=(第1行右下.east) in

(\x1-0.4ex, \y1-0.7ex) rectangle (\x3+1.4ex, \y2+0.9ex) node (被注釈) {};

%第1行注釈

\path

let \p1=(第1行右上.north east) in

(\x1+3.5ex, \y1+0ex) node [anchor=south west] (temp)

{$-\nabla\dfrac{1}{\|\bm{r}-\bm{r}'\|}$(公式(a)より)};

 

\begin{scope}[on background layer]

\path [name path=注釈, rounded corners=1ex, draw, fill=red!20]

(temp.north east) rectangle (temp.south west) node (注釈) {} ;

\end{scope}

%第1行被注釈=第1行注釈の上側

\path [name path=イコール]

let \p1=(被注釈.center), \p2=(注釈.center) in

(\x1-1ex, \y1-0.8ex) -- (\x2+1ex, \y2+0.5ex);

 

\path [name intersections={of=イコール and 被注釈}];

\coordinate (Y) at (intersection-1);

 

\path [name intersections={of=イコール and 注釈}];

\coordinate (Z) at (intersection-1);

 

\begin{scope}[on background layer]

\draw (Y)--(Z);

\end{scope}

%第1行被注釈=第1行注釈の下側

\path [name path=イコール]

let \p1=(被注釈.center), \p2=(注釈.center) in

(\x1-1ex, \y1-0.5ex) -- (\x2+1ex, \y2+0.8ex);

 

\path [name intersections={of=イコール and 被注釈}];

\coordinate (Y) at (intersection-1);

 

\path [name intersections={of=イコール and 注釈}];

\coordinate (Z) at (intersection-1);

 

\begin{scope}[on background layer]

\draw (Y)--(Z);

\end{scope}

%第2行被注釈

\path [name path=被注釈, red,draw,rounded corners=1ex]

let \p1=(第2行左.west), \p2=(第2行上.north), \p3=(第2行右下.south east) in

(\x1-0.4ex, \y3-0.7ex) rectangle (\x3+0.4ex, \y2+0.4ex) node (被注釈) {};

%第2行注釈

\path

let \p1=(第2行上.north), \p2=(第2行右下.east) in

(\x2+2ex, \y1+0ex) node [anchor=south west] (temp)

{$-\nabla\times\dfrac{\bm{i}(\bm{r}')}{\|\bm{r}-\bm{r}'\|}$(公式(b)より)};

 

\begin{scope}[on background layer]

\path [name path=注釈, rounded corners=1ex, draw, fill=red!20]

(temp.north east) rectangle (temp.south west) node (注釈) {} ;

\end{scope}

%第2行被注釈=第2行注釈の上側

\path [name path=イコール]

let \p1=(被注釈.center), \p2=(注釈.center) in

(\x1-1ex, \y1-0.8ex) -- (\x2+1ex, \y2+0.5ex);

 

\path [name intersections={of=イコール and 被注釈}];

\coordinate (Y) at (intersection-1);

 

\path [name intersections={of=イコール and 注釈}];

\coordinate (Z) at (intersection-1);

 

\begin{scope}[on background layer]

\draw (Y)--(Z);

\end{scope}

%第2行被注釈=第2行注釈の下側

\path [name path=イコール]

let \p1=(被注釈.center), \p2=(注釈.center) in

(\x1-1ex, \y1-0.5ex) -- (\x2+1ex, \y2+0.8ex);

 

\path [name intersections={of=イコール and 被注釈}];

\coordinate (Y) at (intersection-1);

 

\path [name intersections={of=イコール and 注釈}];

\coordinate (Z) at (intersection-1);

 

\begin{scope}[on background layer]

\draw (Y)--(Z);

\end{scope}

%第2行アンダーライン

\path [name path=アンダーライン, red,draw]

let \p1=(第2行左.south west) in

(\x1-0.2ex, \y1-0.7ex) -- (\x1+4.8ex, \y1-0.7ex) node {};

%第2行アンダーラインの注釈

\path

let \p1=(第2行左.south west) in

(\x1-6ex, \y1-3.2ex) node [anchor=north] (temp)

{定ベクトル$\bm{a}$に相当};

 

\begin{scope}[on background layer]

\path [name path=注釈, rounded corners=1ex, draw, fill=red!20]

(temp.south west) rectangle (temp.north east) node (注釈) {} ;

\end{scope}

%第2行被注釈=第1行注釈の左側

\path[fill=white]

let \p1=(注釈.center) in

(\x1-3.5ex, \y1+0.5ex) rectangle +(1ex, 1ex);

 

\path [name path=イコール]

let \p1=(注釈.center) in

(\x1-3.5ex, \y1-1ex) -- +(1ex, 5ex);

 

\path [name intersections={of=イコール and アンダーライン}];

\coordinate (Y) at (intersection-1);

 

\path [name intersections={of=イコール and 注釈}];

\coordinate (Z) at (intersection-1);

 

\draw (Y)--(Z);

%第2行被注釈=第1行注釈の右側

\path [name path=イコール]

let \p1=(注釈.center) in

(\x1-3.2ex, \y1-1ex) -- +(1ex, 5ex);

 

\path [name intersections={of=イコール and アンダーライン}];

\coordinate (Y) at (intersection-1);

 

\path [name intersections={of=イコール and 注釈}];

\coordinate (Z) at (intersection-1);

 

\draw (Y)--(Z);

%第2行アンダーライン(上書き)

\path [name path=アンダーライン, red,draw]

let \p1=(第2行左.south west) in

(\x1-0.2ex, \y1-0.7ex) -- (\x1+4.8ex, \y1-0.7ex) node {};

\end{tikzpicture}

\end{document}


balance.styの動き

- 小島 広久 の投稿
2段組みの原稿の最後ページで、左右の段高さを揃えようと思い、
balance.styを使いました。

その結果
1. 最後のページで使用したfootnoteが、左右段の高さが揃えられる前の位置に表示され、高さが揃えられた右段の中に重なって表示されていしまいました。

2. 参考文献リストのタイトル(References)と、最後のセクション終了後の間の空白行がなくなってしまいました。
(\balanceを使用しないときは、Referencesと最後のセクション終了後に、1行空白行が正しく入ります)

balance.styのバグでしょうか?

Argument of \next@ has an extra }.エラーの解決

- ta yo の投稿

\documentclass[14pt, ja4]{jsarticle}

\bibliographystyle{junsrt2}

%\usepackage{tcclearerr}

%--^

%\setlength{\oddsidemargin}{-11pt}

%\setlength{\textwidth}{41zw}

%\setlength{\topmargin}{-10mm}

\setlength{\textheight}{40\baselineskip}

\title{レポート}

\author{}

\date{\today}

\setcounter{tocdepth}{3}

\usepackage{fancyhdr}

\pagestyle{fancy}

\lhead{}

\rhead{}

\rhead{\thepage{}}

\cfoot{}

\renewcommand{\headrulewidth}{0pt}

\usepackage[top=2cm, bottom=2cm, left=2cm, right=2cm, includefoot]{geometry}

\usepackage[dvipdfmx]{graphicx}

\usepackage[dvipdfmx, hidelinks]{hyperref}

\usepackage[numbers, sort]{natbib}

\usepackage{url}

\usepackage[at]{easylist}

\usepackage{listliketab}

\usepackage[english, japanese]{babel}

\usepackage{amsthm, amsmath}

\newtheoremstyle{mystyle}{}{}{\normalfont}{}{\bfseries}{}{\newline}{}

\theoremstyle{mystyle}

\newtheorem{thm}{定理}[section]

\newtheorem*{thm*}{定理}

\newtheorem{prf}{証明}[section]

\newtheorem*{prf*}{証明}

\usepackage{bm}

\setlength\intextsep{0pt}

\setlength\textfloatsep{0pt}

\makeatletter

\renewcommand{\theequation}

{\arabic{section}.\arabic{equation}}

\@addtoreset{equation}{section}

\makeatother

\usepackage{wrapfloat}

%--^\arabic{chapter}-

\begin{document}

\maketitle

%\tableofcontents% 目次の表示

%\newpage


% 本文


%\setcounter{section}{1}

\section{LHCとHERA}

%\setcounter{subsection}{3}

\subsection{固定標的}

%\setcounter{equation}{42}

\begin{align}

\root(s)

\end{align}

%\clearpage

%\bibliography{ref}

\end{document}



上のやつをコンパイルしたら

次のようなエラーが出ました


! Argument of \next@ has an extra }.

<inserted text> 

                \par 

l.59 \end{align}

 

?


解決策ありませんか

自作のカウンタを\label{...},\ref{...}で参照する方法

- 内田 奏 の投稿
この度,組み込み系プログラミングのレポートを書く機会がございまして,そのレポートでは「回路図等は図,測定結果等は表,プログラム等はリストとして示し,それぞれに通し番号を振ること」との指定がなされております.

以下のようにリスト番号を格納するカウンタを利用することで番号を振ることはできました.

\newcounter{Cntr}

\setcounter{Cntr}{0}

\newcommand{\programlist}[1]{\begin{center}リスト\the\value{Cntr}\hspace{1zw}#1\stepcounter{Cntr}\end{center}}

これを図表のように\label{...}\ref{...}を用いて参照するにはどのように記述すればよいのでしょうか.
ご存知の方がおられましたらどうかご教授願います.

追記
上記のカウンタの定義をよりシンプルにする方法があれば,それも教えていただけると幸いです.

El Capitanで美文書からインストールしたTeXでヒラギノが使えない

- Komiya の投稿
先日,MacをEl Capitanにアップデートしました。
すると,TeXが使えなくなったので,美文書第6版のPDF版の付録データを用いて
upLaTeXをインストールし直しました。TeXは使えるようになったのですが,
ヒラギノが使えなくなりました。https://okumuralab.org/tex/mod/forum/discuss.php?d=1879&parent=10955 の方法で解決しようとしたのですが,/Applications/TeXLive/Library/texlive/2013/texmf-dist/scripts/
cjk-gs-integrate/cjk-gs-integrate.plが存在しないので,そこから前に進みません。https://www.ctan.org/pkg/cjk-gs-integrate からcjk-gs-integrate/cjk-gs-integrate.pl を落として/Applications/TeXLive/Library/texlive/2013/texmf-dist/scripts/に入れてsudo perl /Applications/TeXLive/Library/texlive/2013/texmf-dist/scripts/cjk-gs-integrate/cjk-gs-integrate.pl --force --link-texmf を実行すると,(4)と(5)はうまくはいくのですが,(6)で
WARNING: Currently selected map file cannot be found: ptex-noEmbed.map
と表示され,(7)で
NOT EXIST ptex-hiragino-elcapitan-pron.map
と表示され,ヒラギノは使えません。

TeXの環境構築は,美文書でインストールしたことしかないので,全く分かりません。

BXjscls の \setpagelayout* での ドライバについて

- ヤバルゴ mdl.2 の投稿
ドキュメントクラスを bxjsarticle として,\setpagelayout* コマンドでレイアウトを再設定した際,クラスオプションに指定した DVIware (dvipdfmx) が効かない出力が得られました.

以下に簡単なコードと結果の一部を記載します.
(同じ内容のものを添付しておきます)

%-------------------------
\documentclass[uplatex,dvipdfmx,ja=standard,magstyle=real]{bxjsarticle}
\setpagelayout*{top=22truemm,bottom=22truemm,left=15truemm,right=15truemm}
\special{pdf:mapfile hiraginopron.map}
\begin{document}
やはりp\LaTeX は落ち着くな…
\end{document}
%-------------------------
...
(c:/w32tex/share/texmf-dist/tex/latex/bxjscls/bxjsja-standard.def
(c:/w32tex/share/texmf-dist/tex/latex/bxjscls/bxjsja-minimal.def))) (./test.aux)
*geometry* driver: auto-detecting
*geometry* detected driver: dvips
[1] (./test.aux) )
Output written on test.dvi (1 page, 476 bytes).
Transcript written on test.log.
test -> test.pdf
[1]
6390 bytes written
%-------------------------

以上について報告いたします.
ご確認のほど、よろしくお願いいたします.

Disappearing \hrule in otherwise empty minipage

- aminophen の投稿
LaTeX bugs database で LaTeX の面白い挙動を見つけたので、載せてみます。
https://www.latex-project.org/cgi-bin/ltxbugs2html?pr=latex/4463

\documentclass{article}
\begin{document}

no rule:

\noindent\begin{minipage}{\linewidth}
\hrule
\end{minipage}

a rule:

\noindent\begin{minipage}{\linewidth}
\hrule width \linewidth
\end{minipage}

again a rule:

\noindent\begin{minipage}{\linewidth}
\hrule

X
\end{minipage}

\end{document}

minipage 環境で \hrule を単独で使うと、\hrule が消えます。
しかし、前または後に別のモノがあると \hrule が現れます。
もう少し例を増やすと、\hbox{} と \mbox{} でも差が出ます。

no rule:

\noindent\begin{minipage}{\linewidth}
\hbox{}\hrule
\end{minipage}

a rule:

\noindent\begin{minipage}{\linewidth}
\mbox{}\hrule
\end{minipage}

no rule:

\noindent\begin{minipage}{\linewidth}
\hrule\hbox{}
\end{minipage}

a rule:

\noindent\begin{minipage}{\linewidth}
\hrule\mbox{}
\end{minipage}

# 前にも面白いものがあった気がしたので。