ご質問はこちらへ
tabular環境の要素に定義したコマンドを差し込む方法
% pLaTeX
\documentclass[dvipdfmx]{jsarticle}
\newcommand{\hoge}[3]{#1}%
\newcommand{\fuga}[2]{#1}%
\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}%
\newcommand{\fuga}[2]{#1}%
\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
l.17 \hoge{3}{4}{5}
苦し紛れに次のようにしてみました。
% pLaTeX
\documentclass[dvipdfmx]{jsarticle}
%\newcommand{\hoge}[3]{#1}%
\newcommand{\hoge}[3]{#1\\}%
%\newcommand{\fuga}[2]{#1}%
\newcommand{\fuga}[2]{#1\}%
\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入力の方法でわからないことがあります。
==================================================
\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では似たような"となりますが、これではうまくゆかないのです。
しかたなく、例文からコピペしているという情けなさです。極めて初歩的質問で叱られそうですが、教えていただけますか?
Rからpdflatexコマンドを実行するための環境変数の設定方法がわかりません。
[改訂第8版]美文書作成入門の377ページ・下から8行目で、「Rからpdflatexコマンドが実行できるように環境変数PATHが設定されている必要があります」とありますが、具体的にはどのようにすればよいのでしょうか。
MacOS BigSur 11.2.2 (Intel)を使用しておりますが、可能でしたらWindows10での設定方法も教えていただきたいです。
環境変数の設定を無視したままlibrary("tikzDevice")を実行すると、やはりエラーが出ますが、以下のように解決策が示されます。
Set the path to your compiler as the value of either latexcmd or
tikzLatex in .Rprofile using options().
Set the path to your compiler as the value of either R_LATEXCMD or
R_PDFLATEXCMD in .Renviron.
Ensure the folder containing your compiler is included in PATH.
この通りにすればよいのですが、ターミナルをあまりいじったことがないので、操作方法がわかりません。
\ruby{}{}で、エラーがでますが、原因がわかりません。
===============
% upLaTeX文書
\documentclass[dvipdfmx,uplatex,paper=a5,fontsize=11pt,]{jlreq}
\usepackage{bxpapersize}
\usepackage{pxrubrica}
\usepackage{furikana}
\usepackage[deluxe,multi,jis2004]{otf}
\usepackage{graphicx}
\usepackage{bxglyphwiki}
\usepackage[directunicode*, noalphabet]{pxchfon}[2017/04/08]
\rubysetup{}
\begin{document}
木曽五木の一つに「ねずこ」という木がある。普通に漢字変換すると、鼠子となるが、島崎藤村の「夜明け前第一部上」をみると\GWI{u3bff}とある。この\GWI{u3bff}という難しい漢字にルビをうとうとすると、エラーとなり、こまった。
\begin{verbatim}
\GWI{u3bff}
\end{verbatim}
を括弧で囲み
\begin{verbatim}
{\GWI{u3bff}}
\end{verbatim}
としたうえで、いつものように、
\begin{verbatim}
\ruby{{\GWI{u3bff}}}{ねずこ}
\end{verbatim}
としても、エラーがたってうまくゆかない。
已むなく、藤田眞作氏の furikana.sty をよみこんで、
\begin{verbatim}
\kana{{\GWI{u3bff}}}{ねずこ}
\end{verbatim}
とすると、\kana{{\GWI{u3bff}}}{ねずこ}のように、目的が達せられた。
\end{document}
=====================================
どうして ruby命令で不首尾なのか原因を教えていただけませんか。用法が間違つているのでしようか?
LaTeXのインストール時の失敗について
\documentclass[dvipdfmx]{jsarticle} \begin{document} こんにちは \end{document}
「pLaTeX(ptex2pdf)の設定が適切になされていないようです」
fancyvrb の Verbatim を ifnextchar で条件分岐させる新環境について
tikzによる図形の書き方
私は、数学はよくわかりませんが、
\[\sin^2 x + \cos^2 x = 1\]
を印刷して、晴眼者に見てもらって、きちんと書けていると聞いた時には心から感動しました。
それで、今、表題のパッケージの使い方を読んで試してみたところです。
\usepackage{tikz}
\usetikzlibrary{intersections, calc, arrows.meta}
\begin{tikzpicture}
\draw (0,0)--(2,0);
\draw (1,1)--(3,1);
\end{tikzpicture}
\begin{tikzpicture}
\draw(0,0) circle (1);
\draw(1,1) circle (2);
\end{tikzpicture}
こちらを印刷して確認してみました。線や円はできているようです。
上の線はx軸に沿って支店が1ずれた直線が2本。もう一つは、原点と半径が異なる円(半径が倍)が重なっていることを想像しています。
まず、この想像は正しいでしょうか。それと、0,0から0,1と指定したときの長さはどのように規定されるのでしょうか。
図形は左寄せで印字されているようです。中央に寄せたり、比率を変えて拡大して表示させることもできるでしょうか。
自力で図形が描ければ、専用の立体コピー機で印刷することで、視覚障碍者のための教材として利用できると思います。
立体コピー作成機 ピアフ(PIAF)
http://www.amedia.co.jp/product/braille/embosser/piaf.html
pxjahyper のエラー?
日頃 uplatex + upmendex + dvipdfmx でタイプセットをしております.
つい最近 pxjahyper がアップデートされましたが,どうも otf パッケージと相性が悪くなったようで,以下のようなメッセージが出てきます.
以下再現ソースと,コンパイル時のメッセージです.entering extended mode
(./test.tex
pLaTeX2e <2020-10-01u04>+2 (based on LaTeX2e <2020-10-01> patch level 4)
L3 programming layer <2021-02-18>
(/usr/local/texlive/2020/texmf-dist/tex/latex/bxjscls/bxjsbook.cls
Document Class: bxjsbook 2021/02/02 v2.5 BXJS document classes
(/usr/local/texlive/2020/texmf-dist/tex/latex/tools/calc.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/bxjscls/bxjscompat.sty)
(/usr/local/texlive/2020/texmf-dist/tex/generic/iftex/ifpdf.sty
(/usr/local/texlive/2020/texmf-dist/tex/generic/iftex/iftex.sty))
(/usr/local/texlive/2020/texmf-dist/tex/latex/geometry/geometry.sty
(/usr/local/texlive/2020/texmf-dist/tex/generic/iftex/ifvtex.sty))
(/usr/local/texlive/2020/texmf-dist/tex/latex/bxwareki/bxwareki.sty
(/usr/local/texlive/2020/texmf-dist/tex/latex/bxwareki/bxwareki-cd.def))
(/usr/local/texlive/2020/texmf-dist/tex/latex/bxjscls/bxjsja-standard.def
(/usr/local/texlive/2020/texmf-dist/tex/latex/bxjscls/bxjsja-minimal.def)
(/usr/local/texlive/2020/texmf-dist/tex/platex/pxjahyper/pxjahyper-enc.sty)))
(/usr/local/texlive/2020/texmf-dist/tex/platex/japanese-otf-uptex/otf.sty
(/usr/local/texlive/2020/texmf-dist/tex/platex/japanese-otf/ajmacros.sty))
(/usr/local/texlive/2020/texmf-dist/tex/latex/base/fontenc.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/lm/lmodern.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/hyperref/hyperref.sty
(/usr/local/texlive/2020/texmf-dist/tex/generic/ltxcmds/ltxcmds.sty)
(/usr/local/texlive/2020/texmf-dist/tex/generic/pdftexcmds/pdftexcmds.sty
(/usr/local/texlive/2020/texmf-dist/tex/generic/infwarerr/infwarerr.sty))
(/usr/local/texlive/2020/texmf-dist/tex/generic/kvsetkeys/kvsetkeys.sty)
(/usr/local/texlive/2020/texmf-dist/tex/generic/kvdefinekeys/kvdefinekeys.sty)
(/usr/local/texlive/2020/texmf-dist/tex/generic/pdfescape/pdfescape.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/hycolor/hycolor.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/letltxmacro/letltxmacro.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/auxhook/auxhook.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/kvoptions/kvoptions.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/hyperref/pd1enc.def)
(/usr/local/texlive/2020/texmf-dist/tex/latex/hyperref/hyperref-langpatches.def
) (/usr/local/texlive/2020/texmf-dist/tex/generic/intcalc/intcalc.sty)
(/usr/local/texlive/2020/texmf-dist/tex/generic/etexcmds/etexcmds.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/hyperref/puenc.def)
(/usr/local/texlive/2020/texmf-dist/tex/latex/url/url.sty)
(/usr/local/texlive/2020/texmf-dist/tex/generic/bitset/bitset.sty
(/usr/local/texlive/2020/texmf-dist/tex/generic/bigintcalc/bigintcalc.sty))
(/usr/local/texlive/2020/texmf-dist/tex/latex/base/atbegshi-ltx.sty))
(/usr/local/texlive/2020/texmf-dist/tex/latex/hyperref/hdvipdfm.def
(/usr/local/texlive/2020/texmf-dist/tex/latex/rerunfilecheck/rerunfilecheck.sty
(/usr/local/texlive/2020/texmf-dist/tex/latex/base/atveryend-ltx.sty)
(/usr/local/texlive/2020/texmf-dist/tex/generic/uniquecounter/uniquecounter.sty
))) (/usr/local/texlive/2020/texmf-dist/tex/platex/pxjahyper/pxjahyper.sty
(/usr/local/texlive/2020/texmf-dist/tex/latex/etoolbox/etoolbox.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/bxjatoucs/bxjatoucs.sty))
(/usr/local/texlive/2020/texmf-dist/tex/latex/lm/t1lmr.fd)
(/usr/local/texlive/2020/texmf-dist/tex/latex/l3backend/l3backend-dvipdfmx.def
(|extractbb --version)) (./test.aux)
*geometry* detected driver: dvipdfm
(/usr/local/texlive/2020/texmf-dist/tex/latex/graphics/color.sty
(/usr/local/texlive/2020/texmf-dist/tex/latex/graphics-cfg/color.cfg)
(/usr/local/texlive/2020/texmf-dist/tex/latex/graphics-def/dvipdfmx.def)
(/usr/local/texlive/2020/texmf-dist/tex/latex/graphics/dvipsnam.def))
(/usr/local/texlive/2020/texmf-dist/tex/latex/hyperref/nameref.sty
(/usr/local/texlive/2020/texmf-dist/tex/latex/refcount/refcount.sty)
(/usr/local/texlive/2020/texmf-dist/tex/generic/gettitlestring/gettitlestring.s
ty)) (./test.out) (./test.out)
Package hyperref Warning: Rerun to get /PageLabels entry.
(/usr/local/texlive/2020/texmf-dist/tex/platex/pxjahyper/pxjahyper-ajm.def
! Improper \spacefactor.
\bxjs@SE ->\ifnum \spacefactor
<\@m \spacefactor \@m \else \spacefactor \sfc...
l.39 \@
gobbletwo\if\if \def\pxhy@cond#1\fi{%
? x
No pages of output.
Transcript written on test.log.
ちなみに,pxjahyper を 57732 に戻すとこのエラーは発現しませんので,今はそのように対処しています.改善のアドバイスをお願いできればありがたいです.