LaTeX
- 1 Not-so-frequently asked questions for LaTeX
- 2 Superscript symbols
- 3 Mid-point in TikZ
- 4 TikZ to SVG
- 5 Math-mode fonts
- 6 Font for number domains
- 7 tikzscale doesn’t work when tikz figures are externalized by name
- 8 \cite and \citep don’t work inside changes commands when used with ulem
- 9 Redefining an existing command using the same command inside
- 10 The TikZ trapezium node has a sizing bug
- 11 TikZ externalization conflicts with the endfloat package
- 12 lineno numbering issue
- 13 elsarticle corresponding author issue
- 14 Tikz externalize not working when jobname is specified for main document
- 15 References
1 Not-so-frequently asked questions for LaTeX
2 Superscript symbols
Alternatives to asterisk and star for superscripts
*
\dagger
\ddagger
\mathsection
\mathparagraph
\|
**
\dagger\dagger
\ddagger\ddagger
3 Mid-point in TikZ
Path to midpoint of other path
Find the mid-point between (A) and (B), and define it as (C):
\draw (A)--coordinate[midway](C) (B);
or
\usetikzlibrary{calc}
\coordinate (C) at ($(A)!0.5!(B)$);
4 TikZ to SVG
5 Math-mode fonts
6 Font for number domains
Use \mathds from the dsfont package.
\mathds{R}^n
7 tikzscale doesn’t work when tikz figures are externalized by name
tikzscale not working with externalize using named only
tikzscale and \tikzsetnextfilename do not work together
Scale tikz figure to a percentage of \textwidth
Use \begin{tikzpicture}[scale=0.5\textwidth/240cm]
or \begin{tikzpicture}\begin{axis}[width=0.5\textwidth]
instead of \includegraphics[width=0.5\textwidth]
.
8 \cite and \citep don’t work inside changes commands when used with ulem
Change tracking while using bilatex-apa results in an error
ulem commands don’t work with \cite and \citep. A workaround is to redefine \cite and \citep as follows:
\let\origcite\cite
\let\origcite\citep
\renewcommand\cite[1]{\mbox{\origcite{#1}}}
\renewcommand\citep[1]{\mbox{\origcitep{#1}}}
Redefine these commands only for marked manuscripts because I don’t want excessively long text boxes in the final version. For example,
\newif\ifmarked
\markedtrue
\ifmarked
\usepackage[markup=underlined]{changes}
\let\origcite\cite
\let\origcitep\citep
\renewcommand\cite[1]{\mbox{\origcite{#1}}}
\renewcommand\citep[1]{\mbox{\origcitep{#1}}}
\else
\usepackage[final]{changes}
\fi
However, I still have an issue with the above approach because, even in a marked version, the new \cite and \citep should be used only inside changes commands and the original version of these commands should be used elsewhere. An ugly hack is provided below:
\newif\ifmarked
\markedtrue
\ifmarked
\usepackage[markup=underlined]{changes}
\let\origcite\cite
\let\origcitep\citep
\newcommand\redefineforchanges{%
\renewcommand\cite[1]{\mbox{\origcite{##1}}}%
\renewcommand\citep[1]{\mbox{\origcitep{##1}}}}
\newcommand\redefineforothers{%
\let\cite\origcite%
\let\citep\origcitep}
\else
\usepackage[final]{changes}
\newcommand\redefineforchanges{}
\newcommand\redefineforothers{}
\fi
Use \redefineforchanges before using \cite and \citep inside changes commands and restore the original version of these commands later:
\redefineforchanges\added{\cite{Cho.2016} proposed a new approach...}\redefineforothers
An alternative approach is to define separate cite commands for changes commands:
\newif\ifmarked
\markedtrue
\ifmarked
\usepackage[markup=underlined]{changes}
\newcommand\changescite[1]{\mbox{\cite{#1}}}
\newcommand\changescitep[1]{\mbox{\citep{#1}}}
\else
\usepackage[final]{changes}
\let\changescite\cite
\let\changescitep\citep
\fi
Use them like this:
\added{\changescite{Cho.2016} proposed a new approach...}
9 Redefining an existing command using the same command inside
10 The TikZ trapezium node has a sizing bug
11 TikZ externalization conflicts with the endfloat package
pdflatex -shell-escape main
would not run successfully if main.tex includes \usepackage{endfloat}
.
12 lineno numbering issue
\newcommand*\patchAmsMathEnvironmentForLineno[1]{%
\expandafter\let\csname old#1\expandafter\endcsname\csname #1\endcsname
\expandafter\let\csname oldend#1\expandafter\endcsname\csname end#1\endcsname
\renewenvironment{#1}%
{\linenomath\csname old#1\endcsname}%
{\csname oldend#1\endcsname\endlinenomath}}%
\newcommand*\patchBothAmsMathEnvironmentsForLineno[1]{%
\patchAmsMathEnvironmentForLineno{#1}%
\patchAmsMathEnvironmentForLineno{#1*}}%
\AtBeginDocument{%
\patchBothAmsMathEnvironmentsForLineno{equation}%
\patchBothAmsMathEnvironmentsForLineno{align}%
\patchBothAmsMathEnvironmentsForLineno{flalign}%
\patchBothAmsMathEnvironmentsForLineno{alignat}%
\patchBothAmsMathEnvironmentsForLineno{gather}%
\patchBothAmsMathEnvironmentsForLineno{multline}%
}
14 Tikz externalize not working when jobname is specified for main document
Tikz externalize not working when jobname is specified for main document