如何在参考文献中优雅地引用URL?How do you get nicely formatted URLs in the bibliography?

在论文应用URL参考文献的过程中, 总感觉编译出来的格式怪怪的,而且最严重的的一个问题是,若URL标题比较短,而URL地址比较长的时候,URL的标题部分会被横向拉伸以填充整行的长度,从而导致单词之间的间隔特别大。解决这个问题也很简单,主要就是使用\url{}来处理URL地址。但是这个\url{URL地址}部分放到哪个字段里,在网上找到两种不同的说法:

一篇比较老的外文教程是这么说的,网址http://www.kronto.org/thesis/tips/url-formatting.html

Answer

Use the url package by Donald Arseneau.


Example usage

In the preamble:

\usepackage{url}

%% Define a new 'leo' style for the package that will use a smaller font.
\makeatletter
\def\url@leostyle{%
  \@ifundefined{selectfont}{\def\UrlFont{\sf}}{\def\UrlFont{\small\ttfamily}}}
\makeatother
%% Now actually use the newly defined style.
\urlstyle{leo}

In a BibTEX entry:

@misc{
    c.elmohamed,
    author = "Saleh Elmohamed",
    title = "Examples in {H}igh {P}erformance {F}ortran",
    howpublished = "Website",
    year = {1996},
    note = {\url{http://www.npac.syr.edu/projects/
                    cpsedu/summer98summary/ examples/hpf/hpf.html}}
}


Result, before

'Before' screenshot

Result, after

'After' screenshot

Things to watch out for

I tweak the default url style to use a smaller version of the typewriter font because I otherwise find that the Adobe Courier font I use (see also the Using Courier tip) displays a bit too large for my tastes, but also because the larger font still causes more spacing ugliness (in terms of underfull hboxes), as illustrated by the following screenshot:

'After'screenshot

If strange ‘%’ signs start appearing in the list of references in the bibliography section, this is because BibTEX inserts those when it encounters a line it feels is too long:

'After'screenshot

This is purely a BibTEX thing: inside a URL being handled by the url package, the line won't actually be too long — after all the whole idea is for url to be responsible for splitting it. The solution, as shown in the listing given earlier, is to add some stray whitespace to the long url. BibTEX will then no longer think the line is too long, and \url{} ignores all whitespace anyway, so it will not appear in the output.

The biggest problem with the url package is that you do not use it in your LATEX source file, but in your BibTEX source files, thus making your bibliographies non-portable: once you start using \url{} in your BibTEX entries, you will be forced to include the url package in all your LATEX files that use that bibliography file.


在StackExchange上有人的回答是这样的,网址http://tex.stackexchange.com/questions/35977/how-to-add-a-url-to-a-latex-bibtex-file

这个网页的内容不好复制,就不贴在这里了,只给出一段例子

@misc{bworld,
  author = {Ingo Lütkebohle},
  title = {{BWorld Robot Control Software}},
  howpublished = "\url{http://aiweb.techfak.uni-bielefeld.de/content/bworld-robot-control-software/}",
  year = {2008}, 
  note = "[Online; accessed 19-July-2008]"
}


两个的相同之处在于:

都使用的@misc标签,URL标题放到title字段中,URL地址需要包含到"\url{}"中。都需要引入url包,\usepackage{url}.


两个的不同之处在于:

第一种说法中,"\url{}"部分放到note字段中;第二种说法里,"\url{}"部分放到howpublished字段中,经过实际验证,放在哪个字段中,对最终肉眼可见的格式没有任何影响(至于有没有什么理论上的,含义上的或者编译中的潜在不兼容或者冲突目前不得而知)。
GPS和IMU组合导航的例程和代码可以使用许多不同的编程语言来实现。下面是一些可能有用的信息: 1. 例程和代码可以根据不同的硬件平台和传感器选择而有所不同。例如,你可以使用Arduino和MPU-6050 IMU和NEO-6M GPS模块。 2. 在许多情况下,需要将IMU数据进行滤波和校准,以提高其准确性。这可以通过使用滤波算法(如卡尔曼滤波器)和校准程序来实现。 3. 一般而言,GPS提供的位置信息不够精确,因此需要使用IMU提供的姿态信息来改进估计。常用的方法是使用扩展卡尔曼滤波器(EKF)来将GPS和IMU数据进行融合。 4. 对于代码实现,可能需要使用一些库或者工具,如Matlab,Python,C++和ROS等,这些库可以大大简化代码的实现和测试过程。 以下是一个简单的Arduino和MPU-6050 IMU和NEO-6M GPS模块的组合导航代码的例程: ```arduino #include <Wire.h> #include <Adafruit_Sensor.h> #include <Adafruit_BNO055.h> #include <Adafruit_GPS.h> #include <SoftwareSerial.h> #include <EEPROM.h> Adafruit_BNO055 bno = Adafruit_BNO055(); SoftwareSerial mySerial(3, 2); // RX, TX Adafruit_GPS GPS(&mySerial); // Set GPSECHO to 'false' to turn off echoing the GPS data to the Serial console // Set to 'true' if you want to see the data in the Serial console #define GPSECHO true // this keeps track of whether we're using the interrupt // off by default! boolean usingInterrupt = false; void useInterrupt(boolean); // Func prototype keeps Arduino 0023 happy void setup() { Serial.begin(115200); Wire.begin(); bno.begin(); mySerial.begin(9600); EEPROM.write(0, 'h'); EEPROM.write(1, 'i'); // uncomment this line to turn on RMC (recommended minimum) and GGA (fix data) including altitude GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCGGA); // uncomment this line to turn on only the "minimum recommended" data //GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCONLY); // For parsing data, we don't suggest using anything but either RMC only or RMC+GGA since // the parser doesn't care about other sentences at this time // Set the update rate GPS.sendCommand(PMTK_SET_NMEA_UPDATE_1HZ); // 1 Hz update rate // For the parsing code to work nicely and have time to sort thru the data, and // print it out we don't suggest using anything higher than 1 Hz // Request updates on antenna status, comment out to keep quiet GPS.sendCommand(PGCMD_ANTENNA); // the nice thing about this code is you can have a timer0 interrupt go off // every 1 millisecond,
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值