画像ベースのアプローチ

画像ベースのアプローチ

これ自体を Google で検索するのは非常に困難です。LaTeX の通常のテキストでロゴを使用できると聞いていますGoogleが、その方法を見つけるのに苦労しています。

例えば:

Some words, then {Google Logo here} and then so on...

答え1

画像ベースのアプローチ

スケーリングは完璧ではありませんが、かなり近いです。基本的な考え方は、画像の高さを現在のフォントの高さGと深さの合計に設定することです。次に、ベースラインを揃えるために、g画像を深さだけ下げます。g

残念ながら、この方法は、TeX ドキュメントで使用されているフォントのロゴ フォントのディセンダの深さと大文字の高さに依存します。若干の調整が必要になる場合があります。私はロゴを SVG 画像としてダウンロードし、 で使用するために PDF に変換しました\includegraphics

\protected\def、引数を移動する際に コマンドを使用できるようにするためです。hyperrefを使用する場合は、\texorpdfstringブックマークなどに または同様の も必要になる場合があります。

\documentclass{article}
\usepackage{calc,graphicx}
\newlength\htG\newlength\dpg
\protected\def\google{\settoheight{\htG}{G}\settodepth{\dpg}{g}%
  \raisebox{-\dpg}{\includegraphics[height=\htG+\dpg]{Google_2015_logo}}}

\title{\google\ in the title}
\author{A \google r}

\begin{document}
\maketitle
\section{\google\ in a section}
\google\ all around!
\end{document}

ここに画像の説明を入力してください


SVGパスアプローチ(スターウォーズ- インスピレーションを受けたテストコード)

画像ベースのアプローチの代わりに、Tiを使用することもできます。Z のsvg.pathライブラリを使用して、各文字のパスを Google の SVG ファイルから直接借用します。これにより、「l」の長方形の下部にベースラインをより正確に設定できます (これが最初に描画される理由です)。ただし、基本的な考え方は元の方法と非常に似ています。

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{svg.path}
\definecolor{gG}{RGB}{ 60, 186,  84}
\definecolor{gY}{RGB}{244, 194,  13}
\definecolor{gB}{RGB}{ 72, 133, 237}
\definecolor{gR}{RGB}{219,  50,  54}

\newlength\htG
\protected\def\google{\settoheight{\htG}{G}%
  \begin{tikzpicture}[yscale=-1,scale=(\htG/240pt),baseline=(baseline)]
    \fill[fill=gG] svg {m797.49 249.7h35.975v-240.75h-35.975z};
    \coordinate (baseline) at (current bounding box.south);
    \fill[fill=gB] svg {m246.11 116.18h-116.57v34.591h82.673c-4.0842 48.506-44.44 69.192-82.533 69.192-48.736 0-91.264-38.346-91.264-92.092 0-52.357 40.54-92.679 91.371-92.679 39.217 0 62.326 25 62.326 25l24.22-25.081s-31.087-34.608-87.784-34.608c-72.197-0.001-128.05 60.933-128.05 126.75 0 64.493 52.539 127.38 129.89 127.38 68.031 0 117.83-46.604 117.83-115.52 0-14.539-2.1109-22.942-2.1109-22.942z};
    \fill[fill=gR] svg {m341.6 91.129c-47.832 0-82.111 37.395-82.111 81.008 0 44.258 33.249 82.348 82.673 82.348 44.742 0 81.397-34.197 81.397-81.397 0-54.098-42.638-81.959-81.959-81.959zm0.47563 32.083c23.522 0 45.812 19.017 45.812 49.66 0 29.993-22.195 49.552-45.92 49.552-26.068 0-46.633-20.878-46.633-49.79 0-28.292 20.31-49.422 46.741-49.422z};
    \fill[fill=gY] svg {m520.18 91.129c-47.832 0-82.111 37.395-82.111 81.008 0 44.258 33.249 82.348 82.673 82.348 44.742 0 81.397-34.197 81.397-81.397 0-54.098-42.638-81.959-81.959-81.959zm0.47562 32.083c23.522 0 45.812 19.017 45.812 49.66 0 29.993-22.195 49.552-45.92 49.552-26.068 0-46.633-20.878-46.633-49.79 0-28.292 20.31-49.422 46.741-49.422z};
    \fill[fill=gB] svg {m695.34 91.215c-43.904 0-78.414 38.453-78.414 81.613 0 49.163 40.009 81.765 77.657 81.765 23.279 0 35.657-9.2405 44.796-19.847v16.106c0 28.18-17.11 45.055-42.936 45.055-24.949 0-37.463-18.551-41.812-29.078l-31.391 13.123c11.136 23.547 33.554 48.103 73.463 48.103 43.652 0 76.922-27.495 76.922-85.159v-146.77h-34.245v13.836c-10.53-11.347-24.93-18.745-44.04-18.745zm3.178 32.018c21.525 0 43.628 18.38 43.628 49.768 0 31.904-22.056 49.487-44.104 49.487-23.406 0-45.185-19.005-45.185-49.184 0-31.358 22.619-50.071 45.66-50.071z};
    \fill[fill=gR] svg {m925.89 91.02c-41.414 0-76.187 32.95-76.187 81.57 0 51.447 38.759 81.959 80.165 81.959 34.558 0 55.768-18.906 68.426-35.845l-28.235-18.787c-7.3268 11.371-19.576 22.484-40.018 22.484-22.962 0-33.52-12.574-40.061-24.754l109.52-45.444-5.6859-13.318c-10.58-26.08-35.26-47.86-67.92-47.86zm1.4268 31.413c14.923 0 25.663 7.9342 30.224 17.447l-73.139 30.57c-3.1532-23.667 19.269-48.017 42.915-48.017z};
  \end{tikzpicture}%
}

% just for the testing section
\newcommand{\testing}[1]{\noindent\leavevmode#1\rlap{G}\google\llap{e} \quad \rlap{Google}\google \qquad \google\llap{Google}\par}

\title{\google\ in the title}
\author{A \google r}

\begin{document}
\maketitle
\section{\google\ in a section}
\google\ all around! 

\section{Some testing code}
\testing{\tiny}
\testing{\scriptsize}
\testing{\footnotesize}
\testing{\small}
\testing{\normalsize}
\testing{\large}
\testing{\Large}
\testing{\LARGE}
\testing{\huge}
\testing{\Huge}
\end{document}

ここに画像の説明を入力してください

答え2

これはどういう意味ですか:

\documentclass[12pt]{book}

\usepackage{fontawesome}

\begin{document}
Some foo text with \faGoogle
\end{document}

アップデートフォントとFutura-Normal使用XeLaTeX。色の定義は以下から取得されますGoogle の新しいロゴ、フォントは ですProduct Sansが、このフォントは無料ではないので、Futura-Normal(を選択しました。http://allfont.net/download/futura-normal/

\documentclass[12pt]{book}
\usepackage{xcolor}
\usepackage{fontspec}

\definecolor{GoogleGreen}{RGB}{60, 186, 84}
\definecolor{GoogleYellow}{RGB}{244, 194, 13}
\definecolor{GoogleBlue}{RGB}{72, 133, 237}
\definecolor{GoogleRed}{RGB}{219, 50, 54}
\newcommand{\GoogleLogo}{{\setmainfont{futura-Normal}\textcolor{GoogleBlue}{G}\textcolor{GoogleRed}{o}\textcolor{GoogleYellow}{o}\textcolor{GoogleBlue}{g}\textcolor{GoogleGreen}{l}\textcolor{GoogleRed}{e}}}

\begin{document}
\huge \GoogleLogo

Some foo text with 
\end{document}

ここに画像の説明を入力してください

答え3

私の答えはベクターグラフィックからラテックスシンボルを作成する(古いGoogleロゴで)これを行います。ここでは、Davidが参照したロゴに更新しました(https://www.google.co.uk/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png)、パラメータを若干調整しました。

\documentclass{article}
\usepackage{scalerel}
\def\theirlogo{%
  \scalerel*{\includegraphics{googlelogo_color_272x92dp}}{X\rule[-.55ex]{0pt}{1pt}}}
\begin{document}
\Huge Google \theirlogo{}

\normalsize Can I insert my \theirlogo{} inline?

\tiny Can I insert my \theirlogo{} inline?
\end{document}

ここに画像の説明を入力してください

答え4

もう一つのテキストベースの偽ロゴ。完璧ではありませんが、ほぼ...

ムウェ

注: コンパイルされたwin xelatex.ttfオープンソースフォントは、Googleフォント

\documentclass[12pt]{article}
\usepackage[export]{adjustbox} % just to valign the .png 

\usepackage{xcolor}
\usepackage{fontspec}
\definecolor{B}{HTML}{4285F4}
\definecolor{R}{HTML}{EA4335}
\definecolor{Y}{HTML}{FBBC05}
\definecolor{G}{HTML}{34A853}

\newcommand{\Google}{%
\textcolor{B}{\setmainfont{Poppins-Medium} G}%
{\setmainfont{JosefinSans-Bold}%
\textcolor{R}{o}%
\textcolor{Y}{o}%
\textcolor{B}{g}%
\textcolor{G}{l}%
\textcolor{R}{e}}}

\usepackage{graphicx}
\begin{document}
\tiny Fake \Google\ logo\par
\normalsize Fake \Google\ logo\par
\Large Fake \Google\ logo\par
\Huge Fake \Google\ logo\par
\bigskip\hrule\bigskip
\normalsize Real \verb|.png| logo: 
\includegraphics[valign=c,height=2.5ex]{Escritorio/googlelogo_color_272x92dp.png}  
\end{document}

関連情報